> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Avante.nvim

> 在 Avante.nvim 中接入 AIHubMix：在 Neovim 编辑器里用单个 API key 完成 AI 编程，自由切换模型。

## Avante.nvim 是什么

[Avante.nvim](https://github.com/yetone/avante.nvim) 是一款 Neovim 插件,作者 [yetone](https://github.com/yetone):**让 Neovim 用上 Cursor 的 AI 编程体验**。

它不是普通的 Copilot 替代品,而是把 Cursor 里这套 "Composer + Inline Edit + Diff Apply" 工作流完整搬进 Neovim:

* **Ask**(`<leader>aa`)——浮窗对话,可引用当前 buffer、选区、整个项目
* **Edit**(`<leader>ae`)——选中代码 → 自然语言描述改动 → 看 diff → 一键 apply
* **Suggest**——可选的内联自动补全(类似 Copilot)
* **Agentic Mode**——AI 自主执行 shell / 读写文件 / 跑 Python / 操作 Git

| 维度              | 详情                                                                                                             |
| :-------------- | :------------------------------------------------------------------------------------------------------------- |
| **GitHub**      | [yetone/avante.nvim](https://github.com/yetone/avante.nvim)(17.9k ⭐,Apache 2.0)                                |
| **Neovim 版本要求** | ≥ 0.11.0                                                                                                       |
| **支持 Provider** | Claude / OpenAI / Azure / Gemini / Copilot / Ollama / Bedrock / Moonshot / **AIHubMix(一级支持)** / 任意 OpenAI 兼容端点 |
| **ACP 协议**      | 可对接 Claude Code、Codex、Gemini CLI 等外部 Agent                                                                     |
| **官方文档**        | [yetone-avante-nvim.mintlify.app](http://yetone-avante-nvim.mintlify.app)                                      |

***

## Avante vs CodeCompanion vs Copilot:Neovim

| 维度                 | **Avante.nvim**          | **CodeCompanion.nvim** | **GitHub Copilot** |
| :----------------- | :----------------------- | :--------------------- | :----------------- |
| **核心隐喻**           | Cursor 的 Composer        | Zed AI 的内联编辑           | 后台自动补全             |
| **交互形态**           | 浮窗 + diff + apply        | Buffer 流 + slash 命令    | 灰色 ghost text      |
| **侵入程度**           | 高(多浮窗、多 keybind)         | 低(4 个命令搞定)             | 极低                 |
| **配置复杂度**          | 中(需要 Rust 工具链 build)     | 低(纯 Lua)               | 极低                 |
| **后端灵活度**          | 全 LLM + ACP 协议           | 全 LLM + GitHub Models  | 仅 Copilot 后端       |
| **多步推理任务**         | ✅ Agentic Mode           | ⚠️ 通过 slash 命令拼        | ❌                  |
| **价格(走 AIHubMix)** | 按 token 计费               | 按 token 计费             | \$10/月订阅           |
| **适合谁**            | 从 Cursor 迁移过来、要可视 diff 流 | 喜欢 Vim 化、buffer 流的人    | 只想要补全、不要对话         |

## 调用方式

```text theme={null}
        opts = {
            provider = "openai",
            openai = {
                endpoint = "https://aihubmix.com/v1",
                model = "claude-3-5-sonnet-20240620",
                temperature = 0,
                max_tokens = 4096,
            }
        },
```

***

更新时间：2026-06-01
