[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-nomnivore--ollama.nvim":3,"tool-nomnivore--ollama.nvim":64},[4,17,25,39,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":26,"name":27,"github_repo":28,"description_zh":29,"stars":30,"difficulty_score":10,"last_commit_at":31,"category_tags":32,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[33,34,35,36,14,37,15,13,38],"图像","数据工具","视频","插件","其他","音频",{"id":40,"name":41,"github_repo":42,"description_zh":43,"stars":44,"difficulty_score":45,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[14,33,13,15,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":45,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[15,33,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":45,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70612,"2026-04-05T11:12:22",[15,14,13,36],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":80,"owner_twitter":80,"owner_website":80,"owner_url":81,"languages":82,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":45,"env_os":91,"env_gpu":92,"env_ram":93,"env_deps":94,"category_tags":102,"github_topics":80,"view_count":10,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":103,"updated_at":104,"faqs":105,"releases":136},1243,"nomnivore\u002Follama.nvim","ollama.nvim","A plugin for managing and integrating your ollama workflows in neovim.","ollama.nvim 是一个为 Neovim 编辑器设计的插件，用于管理和集成 ollama 的工作流程。它允许用户在编辑代码或文档时，直接调用本地运行的大型语言模型（LLM），例如生成代码、回答问题或进行文本分析等。\n\n这个插件解决了在 Neovim 中直接使用 LLM 的痛点，无需频繁切换工具或环境，即可在编辑过程中获得智能辅助。用户可以通过自定义提示词、选择模型、设置参数等方式灵活控制模型行为，极大提升了工作效率。\n\n它适合开发者、研究人员以及需要频繁与语言模型交互的用户使用，尤其适合那些习惯使用 Neovim 作为主力编辑器的人群。对于希望将 AI 功能深度集成到日常开发流程中的用户来说，ollama.nvim 提供了简洁而强大的支持。\n\n其独特之处在于高度可配置和可扩展的设计，用户可以自定义提示模板、管理模型参数，甚至通过 Docker 支持灵活部署 ollama 服务。整体使用体验流畅，是 Neovim 用户与 LLM 协作的理想助手。","# ollama.nvim\n\nA plugin for managing and integrating your [ollama](https:\u002F\u002Follama.ai) workflows in neovim.\n\nDesigned to be flexible in configuration and extensible\nwith custom functionality.\n\n## Features\n\n- [x] Connects over HTTP, run your ollama server anywhere\n- [x] Query and select from available models\n- [x] Prompt the LLM with context from your buffer\n- [x] Display, replace, or write your own actions for the response\n- [x] Specify additional parameters for a prompt (temperature, top_k, etc)\n\n### Planned \u002F Ideas (implemented depending on interest)\n\n- [ ] Download and manage models\n- [ ] Clone or create models from [Modelfiles](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fmodelfile.md)\n- [ ] Chat\n\n## Usage\n\n`ollama.nvim` provides the following commands, which map to\nmethods exposed by the plugin:\n\n- `Ollama`: Prompt the user to select a prompt to run.\n- `OllamaModel`: Prompt the user to select a model to use as session default.\n- `OllamaServe`: Start the ollama server.\n- `OllamaServeStop`: Stop the ollama server.\n\n## Installation\n\n`ollama.nvim` uses `curl` to communicate with your ollama server over HTTP. Please ensure that `curl` is installed on your system.\n\nInstall using [lazy.nvim](https:\u002F\u002Fgithub.com\u002Ffolke\u002Flazy.nvim):\n\n```lua\nreturn {\n  \"nomnivore\u002Follama.nvim\",\n  dependencies = {\n    \"nvim-lua\u002Fplenary.nvim\",\n  },\n\n  -- All the user commands added by the plugin\n  cmd = { \"Ollama\", \"OllamaModel\", \"OllamaServe\", \"OllamaServeStop\" },\n\n  keys = {\n    -- Sample keybind for prompt menu. Note that the \u003Cc-u> is important for selections to work properly.\n    {\n      \"\u003Cleader>oo\",\n      \":\u003Cc-u>lua require('ollama').prompt()\u003Ccr>\",\n      desc = \"ollama prompt\",\n      mode = { \"n\", \"v\" },\n    },\n\n    -- Sample keybind for direct prompting. Note that the \u003Cc-u> is important for selections to work properly.\n    {\n      \"\u003Cleader>oG\",\n      \":\u003Cc-u>lua require('ollama').prompt('Generate_Code')\u003Ccr>\",\n      desc = \"ollama Generate Code\",\n      mode = { \"n\", \"v\" },\n    },\n  },\n\n  ---@type Ollama.Config\n  opts = {\n    -- your configuration overrides\n  }\n}\n```\n\nTo get a fuzzy-finding Telescope prompt selector you can optionally install [`stevearc\u002Fdressing.nvim`](https:\u002F\u002Fgithub.com\u002Fstevearc\u002Fdressing.nvim).\n\n## Configuration\n\n### Default Options\n\n```lua\nopts = {\n  model = \"mistral\",\n  url = \"http:\u002F\u002F127.0.0.1:11434\",\n  serve = {\n    on_start = false,\n    command = \"ollama\",\n    args = { \"serve\" },\n    stop_command = \"pkill\",\n    stop_args = { \"-SIGTERM\", \"ollama\" },\n  },\n  -- View the actual default prompts in .\u002Flua\u002Follama\u002Fprompts.lua\n  prompts = {\n    Sample_Prompt = {\n      prompt = \"This is a sample prompt that receives $input and $sel(ection), among others.\",\n      input_label = \"> \",\n      model = \"mistral\",\n      action = \"display\",\n    }\n  }\n}\n```\n\n### Docker\n\nDue to `ollama.nvim`'s flexible configuration, docker support is included with minimal extra effort.\n\nIf your container is running on a **separate machine**, you just need to configure the `url` option to point\nto your server.\n\nFor **local containers**, you can configure the `serve` options to use the `docker` cli to create and destroy a container.\nHere's an example configuration that uses the official `ollama` docker image to create an ephemeral container with a shared volume:\n\n```lua\nopts = {\n  -- $ docker run -d --rm --gpus=all -v \u003Cvolume>:\u002Froot\u002F.ollama -p 11434:11434 --name ollama ollama\u002Follama\n  url = \"http:\u002F\u002F127.0.0.1:11434\",\n  serve = {\n    command = \"docker\",\n    args = {\n      \"run\",\n      \"-d\",\n      \"--rm\",\n      \"--gpus=all\",\n      \"-v\",\n      \"ollama:\u002Froot\u002F.ollama\",\n      \"-p\",\n      \"11434:11434\",\n      \"--name\",\n      \"ollama\",\n      \"ollama\u002Follama\",\n    },\n    stop_command = \"docker\",\n    stop_args = { \"stop\", \"ollama\" },\n  },\n}\n```\n\n### Writing your own prompts\n\nBy default, `ollama.nvim` comes with a few prompts that are useful for most workflows.\nHowever, you can also write your own prompts directly in your config, as shown above.\n\n`prompts` is a dictionary of prompt names to prompt configurations. The prompt name is used in prompt selection menus\nwhere you can select which prompt to run, where \"Sample_Prompt\" is shown as \"Sample Prompt\".\n\nThis dictionary accepts the following keys:\n\n| Key         | Type                           | Description                                                                                                                                                                                                    |\n| ----------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| prompt      | `string`                       | The prompt to send to the LLM. Can contain special tokens that are substituted with context before sending. See [Tokens](#tokens).                                                                             |\n| model       | `string` (Optional)            | The model to use for the prompt. Defaults to the global `opts.model`.                                                                                                                                          |\n| input_label | `string` (Optional)            | The label to use for the input prompt. Defaults to `\"> \"`.                                                                                                                                                     |\n| action      | `string` or `table` (Optional) | The action to take with the response from the LLM. See [Actions](#actions). Defaults to \"display\".                                                                                                             |\n| extract     | `string` (Optional)            | A Lua match pattern to extract from the response. Used only by certain actions. See [Extracting](#extracting). Set to `false` if you want to disable this step.                                                |\n| options     | `table` (Optional)             | Additional model parameter overrides, such as temperature, listed in the documentation for the [Ollama Modelfile](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fmodelfile.md#valid-parameters-and-values) |\n| system      | `string` (Optional)            | The system prompt to be used in the Modelfile template, if applicable. (overrides what's in the Modelfile)                                                                                                     |\n| format      | `string` (Optional)            | The format to return a response in. Currently the only accepted value is \"json\"                                                                                                                                |\n\nIf you'd like to disable a prompt (such as one of the default ones), set the value of the prompt to `false`.\n\n```lua\nprompts = {\n  Sample_Prompt = false\n}\n```\n\n### Extracting\n\nWhen using certain actions (or custom ones you write),\nyou may want to operate on a specific part of the response.\nTo do this, you can use the `extract` key in your prompt configuration.\n\n````lua\nextract = \"```$ftype\\n(.-)```\"\n````\n\n`ollama.nvim` will parse the `extract` string the same way as a prompt, substituting tokens (see below). The parsed extract pattern\nwill then be sent to the action associated with the prompt.\n\n### Tokens\n\nBefore sending the prompt, `ollama.nvim` will replace certain special tokens in\nthe prompt string with context in the following ways:\n\n| Token   | Description                                            |\n| ------- | ------------------------------------------------------ |\n| $input  | Prompt the user for input.                             |\n| $sel    | The current or previous selection.                     |\n| $ftype  | The filetype of the current buffer.                    |\n| $fname  | The filename of the current buffer.                    |\n| $buf    | The full contents of the current buffer.               |\n| $before | The contents of the current buffer, before the pointer |\n| $after  | The contents of the current buffer, after the pointer  |\n| $line   | The current line in the buffer.                        |\n| $lnum   | The current line number in the buffer.                 |\n\n### Actions\n\n`ollama.nvim` provides the following built-in actions:\n\n- `display`: Stream and display the response in a floating window.\n- `replace`: Replace the current selection with the response.\n  - Uses the `extract` pattern to extract the response.\n- `insert`: Insert the response at the current cursor line\n  - Uses the `extract` pattern to extract the response.\n- `display_replace`: Stream and display the response in a floating window, then replace the current selection with the response.\n  - Uses the `extract` pattern to extract the response.\n- `display_insert`: Stream and display the response in a floating window, then insert the response at the current cursor line.\n  - Uses the `extract` pattern to extract the response.\n\nSometimes, you may need functionality that is not provided by\nthe built-in actions. In this case, you can write your own Custom Actions with the following interface:\n\n```lua\n---@type Ollama.PromptAction\naction = {\n  fn = function(prompt)\n    -- This function is called when the prompt is selected\n    -- just before sending the prompt to the LLM.\n    -- Useful for setting up UI or other state.\n\n    -- Return a function that will be used as a callback\n    -- when a response is received.\n    ---@type Ollama.PromptActionResponseCallback\n    return function(body, job)\n      -- body is a table of the json response\n      -- body.response is the response text received\n\n      -- job is the plenary.job object when opts.stream = true\n      -- job is nil otherwise\n    end\n\n  end,\n\n  opts = { stream = true } -- optional, default is false\n}\n```\n\nInstead of returning a callback function, you can also return `false` or `nil`\nto indicate that the prompt should be cancelled and not be sent to the LLM.\nThis can be useful for actions that require a selection or for other criteria not being met.\n\nActions can also be written without the table keys, like so:\n\n```lua\naction = {\n  function(prompt)\n    -- ...\n    return function(body, job)\n      -- ...\n    end\n  end,\n  { stream = true }\n}\n```\n\n#### Actions Factory\n\nThe built-in actions are implemented using a factory function that takes a table of options and returns a prompt action.\nYou can use this factory to quickly make small adjustments to the built-in actions.\n\n```lua\naction = require(\"ollama.actions.factory\").create_action({ display = true, replace = true, show_prompt = false })\n```\n\nThe following options are available:\n\n| Option      | Type                         | Description                                                                              |\n| ----------- | ---------------------------- | ---------------------------------------------------------------------------------------- |\n| display     | `boolean`                    | whether to display the response (default: `true`)                                        |\n| insert      | `boolean`                    | whether to insert the response at the cursor (default: `false`)                          |\n| replace     | `boolean`                    | whether to replace the selection with the response. Precedes `insert` (default: `false`) |\n| show_prompt | `boolean`                    | whether to prepend the display buffer with the parsed prompt (default: `false`)          |\n| window      | `\"float\"\\|\"split\"\\|\"vsplit\"` | type of window to display the response in (default: `\"float\"`)                           |\n\n### Status\n\n`ollama.nvim` module exposes a `.status()` method for checking the status of the ollama server.\nThis is used to see if any jobs are currently running. It returns the type\n`Ollama.StatusEnum` which is one of:\n\n- `\"IDLE\"`: No jobs are running\n- `\"WORKING\"`: One or more jobs are running\n\nYou can use this to display a prompt running status in your statusline.\nHere are a few example recipes for [lualine](https:\u002F\u002Fgithub.com\u002Fnvim-lualine\u002Flualine.nvim):\n\n\n#### Assuming you already have lualine set up in your config, and that you are using a package manager that can merge configs\n\n```lua\n{\n  \"nvim-lualine\u002Flualine.nvim\",\n  optional = true,\n\n  opts = function(_, opts)\n    table.insert(opts.sections.lualine_x, {\n      function()\n        local status = require(\"ollama\").status()\n\n        if status == \"IDLE\" then\n          return \"󱙺\" -- nf-md-robot-outline\n        elseif status == \"WORKING\" then\n          return \"󰚩\" -- nf-md-robot\n        end\n      end,\n      cond = function()\n        return package.loaded[\"ollama\"] and require(\"ollama\").status() ~= nil\n      end,\n    })\n  end,\n},\n```\n\n#### Alternatively, Assuming you want all of the statusline config entries in one file.\n\n```lua\n-- assuming the following plugin is installed\n{\n  \"nvim-lualine\u002Flualine.nvim\",\n},\n\n-- Define a function to check that ollama is installed and working\nlocal function get_condition()\n    return package.loaded[\"ollama\"] and require(\"ollama\").status ~= nil\nend\n\n\n-- Define a function to check the status and return the corresponding icon\nlocal function get_status_icon()\n  local status = require(\"ollama\").status()\n\n  if status == \"IDLE\" then\n    return \"OLLAMA IDLE\"\n  elseif status == \"WORKING\" then\n    return \"OLLAMA BUSY\"\n  end\nend\n\n-- Load and configure 'lualine'\nrequire(\"lualine\").setup({\n\tsections = {\n\t\tlualine_a = {},\n\t\tlualine_b = { \"branch\", \"diff\", \"diagnostics\" },\n\t\tlualine_c = { { \"filename\", path = 1 } },\n\t\tlualine_x = { get_status_icon, get_condition },\n\t\tlualine_y = { \"progress\" },\n\t\tlualine_z = { \"location\" },\n\t},\n})\n```\n\n## Credits\n\n- [ollama](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama) for running LLMs locally\n- [gen.nvim](https:\u002F\u002Fgithub.com\u002FDavid-Kunz\u002Fgen.nvim) for inspiration\n","# ollama.nvim\n\n一个用于在 Neovim 中管理和集成你的 [ollama](https:\u002F\u002Follama.ai) 工作流的插件。\n\n旨在配置灵活且可扩展，支持自定义功能。\n\n## 特性\n\n- [x] 通过 HTTP 连接，可在任意位置运行你的 ollama 服务器\n- [x] 查询并选择可用模型\n- [x] 使用缓冲区中的上下文向 LLM 提供提示\n- [x] 显示、替换或编写自己的响应操作\n- [x] 为提示指定额外参数（温度、top_k 等）\n\n### 计划中\u002F想法（视兴趣而定是否实现）\n\n- [ ] 下载并管理模型\n- [ ] 从 [Modelfiles](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fmodelfile.md) 克隆或创建模型\n- [ ] 聊天\n\n## 使用方法\n\n`ollama.nvim` 提供以下命令，这些命令映射到插件公开的方法：\n\n- `Ollama`：提示用户选择要运行的提示。\n- `OllamaModel`：提示用户选择要用作会话默认值的模型。\n- `OllamaServe`：启动 ollama 服务器。\n- `OllamaServeStop`：停止 ollama 服务器。\n\n## 安装\n\n`ollama.nvim` 使用 `curl` 通过 HTTP 与你的 ollama 服务器通信。请确保你的系统已安装 `curl`。\n\n使用 [lazy.nvim](https:\u002F\u002Fgithub.com\u002Ffolke\u002Flazy.nvim) 安装：\n\n```lua\nreturn {\n  \"nomnivore\u002Follama.nvim\",\n  dependencies = {\n    \"nvim-lua\u002Fplenary.nvim\",\n  },\n\n  -- 插件添加的所有用户命令\n  cmd = { \"Ollama\", \"OllamaModel\", \"OllamaServe\", \"OllamaServeStop\" },\n\n  keys = {\n    -- 提示菜单的示例键绑定。请注意，\u003Cc-u> 对于正确选择非常重要。\n    {\n      \"\u003Cleader>oo\",\n      \":\u003Cc-u>lua require('ollama').prompt()\u003Ccr>\",\n      desc = \"ollama 提示\",\n      mode = { \"n\", \"v\" },\n    },\n\n    -- 直接提示的示例键绑定。同样，\u003Cc-u> 对于正确选择非常重要。\n    {\n      \"\u003Cleader>oG\",\n      \":\u003Cc-u>lua require('ollama').prompt('Generate_Code')\u003Ccr>\",\n      desc = \"ollama 生成代码\",\n      mode = { \"n\", \"v\" },\n    },\n  },\n\n  ---@type Ollama.Config\n  opts = {\n    -- 你的配置覆盖\n  }\n}\n```\n\n若需获得模糊查找的 Telescope 提示选择器，可选择安装 [`stevearc\u002Fdressing.nvim`](https:\u002F\u002Fgithub.com\u002Fstevearc\u002Fdressing.nvim)。\n\n## 配置\n\n### 默认选项\n\n```lua\nopts = {\n  model = \"mistral\",\n  url = \"http:\u002F\u002F127.0.0.1:11434\",\n  serve = {\n    on_start = false,\n    command = \"ollama\",\n    args = { \"serve\" },\n    stop_command = \"pkill\",\n    stop_args = { \"-SIGTERM\", \"ollama\" },\n  },\n  -- 在 .\u002Flua\u002Follama\u002Fprompts.lua 中查看实际的默认提示\n  prompts = {\n    Sample_Prompt = {\n      prompt = \"这是一个示例提示，接收 $input 和 $sel(ection) 等。\",\n      input_label = \"> \",\n      model = \"mistral\",\n      action = \"display\",\n    }\n  }\n}\n```\n\n### Docker\n\n由于 `ollama.nvim` 的配置灵活，因此只需少量额外工作即可实现 Docker 支持。\n\n如果你的容器运行在**另一台机器上**，只需将 `url` 选项配置为指向你的服务器即可。\n\n对于**本地容器**，你可以配置 `serve` 选项，使用 `docker` CLI 创建和销毁容器。以下是一个使用官方 `ollama` Docker 镜像创建临时容器并共享卷的示例配置：\n\n```lua\nopts = {\n  -- $ docker run -d --rm --gpus=all -v \u003Cvolume>:\u002Froot\u002F.ollama -p 11434:11434 --name ollama ollama\u002Follama\n  url = \"http:\u002F\u002F127.0.0.1:11434\",\n  serve = {\n    command = \"docker\",\n    args = {\n      \"run\",\n      \"-d\",\n      \"--rm\",\n      \"--gpus=all\",\n      \"-v\",\n      \"ollama:\u002Froot\u002F.ollama\",\n      \"-p\",\n      \"11434:11434\",\n      \"--name\",\n      \"ollama\",\n      \"ollama\u002Follama\",\n    },\n    stop_command = \"docker\",\n    stop_args = { \"stop\", \"ollama\" },\n  },\n}\n```\n\n### 编写自己的提示\n\n默认情况下，`ollama.nvim` 随附几个对大多数工作流有用的提示。不过，你也可以直接在配置中编写自己的提示，如上所示。\n\n`prompts` 是一个提示名称到提示配置的字典。提示名称用于提示选择菜单，你可以在其中选择要运行的提示，例如“Sample_Prompt”显示为“示例提示”。\n\n该字典接受以下键：\n\n| 键         | 类型                           | 描述                                                                                                                                                                                                    |\n| ----------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| prompt      | `string`                       | 发送给 LLM 的提示。可以包含特殊标记，在发送前会被上下文替换。参见[Tokens](#tokens)。                                                                             |\n| model       | `string`（可选）               | 用于提示的模型。默认为全局 `opts.model`。                                                                                                                                          |\n| input_label | `string`（可选）               | 输入提示使用的标签。默认为 `\"> \"`。                                                                                                                                                     |\n| action      | `string` 或 `table`（可选）    | 对 LLM 响应采取的操作。参见[Actions](#actions)。默认为“display”。                                                                                                             |\n| extract     | `string`（可选）               | 用于从响应中提取的 Lua 匹配模式。仅由某些操作使用。参见[Extracting](#extracting)。如果希望禁用此步骤，则设置为 `false`。                                                |\n| options     | `table`（可选）                | 额外的模型参数覆盖，例如温度，详见 [Ollama Modelfile](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fmodelfile.md#valid-parameters-and-values) 文档。 |\n| system      | `string`（可选）               | 如果适用，用于 Modelfile 模板中的系统提示。（覆盖 Modelfile 中的内容）                                                                                                     |\n| format      | `string`（可选）               | 返回响应的格式。目前唯一接受的值是“json”。                                                                                                                                |\n\n如果你想禁用某个提示（例如默认提示之一），将该提示的值设为 `false`。\n\n```lua\nprompts = {\n  Sample_Prompt = false\n}\n```\n\n### 提取\n\n在使用某些操作（或您编写的自定义操作）时，\n您可能希望对响应的特定部分进行处理。\n为此，您可以在提示配置中使用 `extract` 键。\n\n````lua\nextract = \"```$ftype\\n(.-)```\"\n````\n\n`ollama.nvim` 会以与提示相同的方式解析 `extract` 字符串，并替换其中的标记（见下文）。解析后的提取模式\n随后将被发送到与该提示关联的操作。\n\n### 标记\n\n在发送提示之前，`ollama.nvim` 会按照以下方式用上下文替换提示字符串中的某些特殊标记：\n\n| 标记   | 描述                                            |\n| ------- | ------------------------------------------------------ |\n| $input  | 提示用户输入。                             |\n| $sel    | 当前或上一次的选择。                     |\n| $ftype  | 当前缓冲区的文件类型。                    |\n| $fname  | 当前缓冲区的文件名。                    |\n| $buf    | 当前缓冲区的完整内容。                   |\n| $before | 当前缓冲区中指针之前的内容             |\n| $after  | 当前缓冲区中指针之后的内容              |\n| $line   | 缓冲区中的当前行。                        |\n| $lnum   | 缓冲区中的当前行号。                     |\n\n### 操作\n\n`ollama.nvim` 提供了以下内置操作：\n\n- `display`：在浮动窗口中流式显示响应。\n- `replace`：用响应替换当前选择。\n  - 使用 `extract` 模式提取响应。\n- `insert`：在当前光标行插入响应。\n  - 使用 `extract` 模式提取响应。\n- `display_replace`：先在浮动窗口中流式显示响应，再用响应替换当前选择。\n  - 使用 `extract` 模式提取响应。\n- `display_insert`：先在浮动窗口中流式显示响应，再在当前光标行插入响应。\n  - 使用 `extract` 模式提取响应。\n\n有时，您可能需要内置操作未提供的功能。在这种情况下，您可以编写自己的自定义操作，其接口如下：\n\n```lua\n---@type Ollama.PromptAction\naction = {\n  fn = function(prompt)\n    -- 此函数在选择提示时调用\n    -- 在将提示发送给 LLM 之前。\n    -- 适用于设置 UI 或其他状态。\n\n    -- 返回一个将在收到响应时作为回调使用的函数\n    ---@type Ollama.PromptActionResponseCallback\n    return function(body, job)\n      -- body 是 JSON 响应的表\n      -- body.response 是接收到的响应文本\n\n      -- job 是 plenary.job 对象，当 opts.stream = true 时\n      -- 否则 job 为 nil\n    end\n\n  end,\n\n  opts = { stream = true } -- 可选，默认为 false\n}\n```\n\n您也可以不返回回调函数，而是返回 `false` 或 `nil`\n来表示应取消该提示，不将其发送给 LLM。\n这对于需要满足特定选择条件或其他标准未达的情况非常有用。\n\n操作也可以不使用表键直接编写，如下所示：\n\n```lua\naction = {\n  function(prompt)\n    -- ...\n    return function(body, job)\n      -- ...\n    end\n  end,\n  { stream = true }\n}\n```\n\n#### 操作工厂\n\n内置操作是通过一个工厂函数实现的，该函数接收一个选项表并返回一个提示操作。\n您可以使用此工厂快速对内置操作进行小幅调整。\n\n```lua\naction = require(\"ollama.actions.factory\").create_action({ display = true, replace = true, show_prompt = false })\n```\n\n可用的选项如下：\n\n| 选项      | 类型                         | 描述                                                                              |\n| ----------- | ---------------------------- | ---------------------------------------------------------------------------------------- |\n| display     | `boolean`                    | 是否显示响应（默认：`true`）                                        |\n| insert      | `boolean`                    | 是否在光标处插入响应（默认：`false`）                          |\n| replace     | `boolean`                    | 是否用响应替换选择。优先于 `insert`（默认：`false`）                           |\n| show_prompt | `boolean`                    | 是否在显示缓冲区前加上解析后的提示（默认：`false`）                          |\n| window      | `\"float\"\\|\"split\"\\|\"vsplit\"` | 显示响应的窗口类型（默认：`\"float\"`）                           |\n\n### 状态\n\n`ollama.nvim` 模块公开了一个 `.status()` 方法，用于检查 ollama 服务器的状态。\n这用于查看是否有作业正在运行。它返回类型\n`Ollama.StatusEnum`，其值为：\n\n- `\"IDLE\"`：没有作业运行\n- `\"WORKING\"`：有一个或多个作业正在运行\n\n您可以使用此方法在状态栏中显示提示的运行状态。\n以下是 [lualine](https:\u002F\u002Fgithub.com\u002Fnvim-lualine\u002Flualine.nvim) 的几个示例配方：\n\n\n#### 假设您已经在配置中设置了 lualine，并且使用的是可以合并配置的包管理器\n\n```lua\n{\n  \"nvim-lualine\u002Flualine.nvim\",\n  optional = true,\n\n  opts = function(_, opts)\n    table.insert(opts.sections.lualine_x, {\n      function()\n        local status = require(\"ollama\").status()\n\n        if status == \"IDLE\" then\n          return \"󱙺\" -- nf-md-robot-outline\n        elseif status == \"WORKING\" then\n          return \"󰚩\" -- nf-md-robot\n        end\n      end,\n      cond = function()\n        return package.loaded[\"ollama\"] and require(\"ollama\").status() ~= nil\n      end,\n    })\n  end,\n},\n```\n\n#### 或者，假设您希望将所有状态栏配置条目放在一个文件中。\n\n```lua\n-- 假设已安装以下插件\n{\n  \"nvim-lualine\u002Flualine.nvim\",\n},\n\n-- 定义一个函数来检查 ollama 是否已安装并正常工作\nlocal function get_condition()\n    return package.loaded[\"ollama\"] and require(\"ollama\").status ~= nil\nend\n\n\n-- 定义一个函数来检查状态并返回相应的图标\nlocal function get_status_icon()\n  local status = require(\"ollama\").status()\n\n  if status == \"IDLE\" then\n    return \"OLLAMA IDLE\"\n  elseif status == \"WORKING\" then\n    return \"OLLAMA BUSY\"\n  end\nend\n\n-- 加载并配置 'lualine'\nrequire(\"lualine\").setup({\n\tsections = {\n\t\tlualine_a = {},\n\t\tlualine_b = { \"branch\", \"diff\", \"diagnostics\" },\n\t\tlualine_c = { { \"filename\", path = 1 } },\n\t\tlualine_x = { get_status_icon, get_condition },\n\t\tlualine_y = { \"progress\" },\n\t\tlualine_z = { \"location\" },\n\t},\n})\n```\n\n## 致谢\n\n- [ollama](https:\u002F\u002Fgithub.com\u002Fjmorganca\u002Follama) 用于在本地运行 LLM\n- [gen.nvim](https:\u002F\u002Fgithub.com\u002FDavid-Kunz\u002Fgen.nvim) 为本项目提供了灵感","# ollama.nvim 快速上手指南\n\n## 环境准备\n\n### 系统要求\n- 支持 Neovim（建议使用 v0.9 以上版本）\n- 系统需安装 `curl` 工具，用于与 Ollama 服务进行通信\n\n### 前置依赖\n- 安装 [lazy.nvim](https:\u002F\u002Fgithub.com\u002Ffolke\u002Flazy.nvim) 作为插件管理器\n- 可选：安装 [`stevearc\u002Fdressing.nvim`](https:\u002F\u002Fgithub.com\u002Fstevearc\u002Fdressing.nvim)，以获得更友好的提示选择界面\n\n---\n\n## 安装步骤\n\n1. 在你的 Neovim 配置文件中（通常是 `init.lua` 或 `lua\u002Fconfig.lua`），添加以下内容：\n\n```lua\nreturn {\n  \"nomnivore\u002Follama.nvim\",\n  dependencies = {\n    \"nvim-lua\u002Fplenary.nvim\",\n  },\n\n  cmd = { \"Ollama\", \"OllamaModel\", \"OllamaServe\", \"OllamaServeStop\" },\n\n  keys = {\n    {\n      \"\u003Cleader>oo\",\n      \":\u003Cc-u>lua require('ollama').prompt()\u003Ccr>\",\n      desc = \"ollama prompt\",\n      mode = { \"n\", \"v\" },\n    },\n    {\n      \"\u003Cleader>oG\",\n      \":\u003Cc-u>lua require('ollama').prompt('Generate_Code')\u003Ccr>\",\n      desc = \"ollama Generate Code\",\n      mode = { \"n\", \"v\" },\n    },\n  },\n\n  opts = {\n    model = \"mistral\",\n    url = \"http:\u002F\u002F127.0.0.1:11434\",\n    serve = {\n      on_start = false,\n      command = \"ollama\",\n      args = { \"serve\" },\n      stop_command = \"pkill\",\n      stop_args = { \"-SIGTERM\", \"ollama\" },\n    },\n    prompts = {\n      Sample_Prompt = {\n        prompt = \"This is a sample prompt that receives $input and $sel(ection), among others.\",\n        input_label = \"> \",\n        model = \"mistral\",\n        action = \"display\",\n      }\n    }\n  }\n}\n```\n\n2. 保存配置并重新加载 Neovim。\n\n---\n\n## 基本使用\n\n### 启动 Ollama 服务\n\n在 Neovim 中运行以下命令启动 Ollama 服务：\n\n```vim\n:OllamaServe\n```\n\n如果服务已运行，则无需重复执行此命令。\n\n### 停止 Ollama 服务\n\n运行以下命令停止 Ollama 服务：\n\n```vim\n:OllamaServeStop\n```\n\n### 使用默认提示模板\n\n按下 `\u003Cleader>oo`（默认键位）打开提示菜单，选择一个模型后，输入你想要的内容，即可获取 LLM 的响应结果。\n\n### 自定义提示模板\n\n你可以在配置中自定义提示模板。例如：\n\n```lua\nprompts = {\n  Generate_Code = {\n    prompt = \"请根据以下内容生成代码：$input\",\n    model = \"codellama\",\n    action = \"insert\"\n  }\n}\n```\n\n然后通过以下命令调用该模板：\n\n```vim\n:lua require('ollama').prompt('Generate_Code')\n```\n\n---\n\n## 小贴士\n\n- 如果你在使用 Docker 运行 Ollama，可以参考文档中的 Docker 示例配置。\n- 默认模型为 `mistral`，你可以通过 `:OllamaModel` 命令切换当前会话使用的模型。","一个资深的 Lua 开发者正在使用 Neovim 进行代码开发，他经常需要借助大语言模型来生成代码片段、调试逻辑或解释复杂的函数行为。\n\n### 没有 ollama.nvim 时\n\n- 需要频繁切换到浏览器或其他终端工具启动 Ollama 服务，操作繁琐且打断工作流。\n- 在 Neovim 中无法直接调用模型，每次都需要复制代码内容到外部工具中进行查询。\n- 无法在 Neovim 内部快速选择模型或调整参数（如温度、top_k 等），导致效率低下。\n- 对于不同的任务（如生成代码、解释文档等）没有预设的提示模板，需要手动编写提示词，浪费时间。\n- 缺乏对本地 Docker 容器的支持，难以在不同环境中灵活部署和管理 Ollama 服务。\n\n### 使用 ollama.nvim 后\n\n- 可以在 Neovim 内一键启动或停止 Ollama 服务，无需离开编辑器即可完成模型调用。\n- 直接在 Neovim 编辑器中调用模型，支持从当前缓冲区提取上下文作为输入，提升交互效率。\n- 提供快捷方式选择模型和调整参数，支持自定义提示模板，满足不同场景下的需求。\n- 可以通过配置文件定义多种提示模板（如“生成代码”、“解释函数”等），减少重复劳动。\n- 支持 Docker 部署，方便开发者在本地容器中运行 Ollama，并通过 Neovim 管理服务启停。\n\nollama.nvim 让开发者能够在 Neovim 中无缝集成大语言模型，极大提升了代码辅助与调试的效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fnomnivore_ollama.nvim_7db1f873.png","nomnivore","Kyle","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fnomnivore_5efed803.jpg","Web dev grad","Student",null,"https:\u002F\u002Fgithub.com\u002Fnomnivore",[83],{"name":84,"color":85,"percentage":86},"Lua","#000080",100,566,35,"2026-04-03T19:07:46","MIT","Linux, macOS, Windows","需要 NVIDIA GPU，显存 8GB+，CUDA 11.7+","16GB+",{"notes":95,"python":96,"dependencies":97},"ollama.nvim 本身不依赖 Python，但 Ollama 服务可能需要 Python 环境。建议使用 Docker 或本地安装 Ollama 服务。首次运行需下载模型文件，具体大小取决于所选模型。","未说明",[98,99,100,101],"curl","lazy.nvim","plenary.nvim","dressing.nvim (可选)",[15,36],"2026-03-27T02:49:30.150509","2026-04-06T05:37:54.498313",[106,111,116,121,126,131],{"id":107,"question_zh":108,"answer_zh":109,"source_url":110},5658,"如何解决 Ollama 服务无法停止的问题？","如果 Ollama 服务由 systemd 单元启动，它可能以另一个用户（如 ollama 用户）运行，导致 pkill 命令因权限不足而失败。建议通过系统服务管理工具（如 systemctl）单独启动和停止 Ollama 服务，而不是依赖插件提供的命令。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F22",{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},5659,"如何忽略 DeepSeek 模型生成的 '\u003C\u002Fthink>' 字段？","可以在提示词中添加 `\u002Fno_think` 标记来忽略模型生成的特定字段。例如：`prompt = \"\u002Fno_think bala bala\"`。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F45",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},5660,"如何实现响应流式输出？","Ollama.nvim 支持流式响应输出，所有内置的 `display_` 动作都会逐行显示响应内容。你可以根据需要配置提示词指向这些动作，包括默认提示词。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F27",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},5661,"如何解决远程连接时出现 'model not found' 错误？","确保目标机器上已经拉取了所需的模型。在 Ubuntu 上运行以下命令：`ollama serve` 和 `ollama pull mistral`。此插件不处理模型安装或 Ollama 的设置，请确保服务器端已正确配置。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F17",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},5662,"如何解决 'start_col must be less than end_col' 错误？","该错误通常发生在使用包含 $sel（选择）标记的提示词时，且未正确选择文本。请确保在执行插件命令前，在可视模式下选中文本。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F14",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},5663,"如何解决 'Column index is too high' 错误？","该错误可能是由于插件版本问题引起的。可以尝试回退到之前的稳定版本，例如提交 `6c5f7e8c50196e68bdc1622378a0b8c00328aeeb`，或者等待维护者发布修复后的版本。","https:\u002F\u002Fgithub.com\u002Fnomnivore\u002Follama.nvim\u002Fissues\u002F6",[]]