|
| 1 | +--- |
| 2 | +title: Use CodeGate with avante.nvim |
| 3 | +description: Configure the `avante.nvim` plugin for Neovim |
| 4 | +sidebar_label: avante.nvim |
| 5 | +sidebar_position: 15 |
| 6 | +--- |
| 7 | + |
| 8 | +**[avante.nvim](https://github.com/yetone/avante.nvim)** is a Neovim plugin that |
| 9 | +provides a Cursor-like user experience. It integrates with multiple AI providers |
| 10 | +(e.g. Claude and OpenAI). |
| 11 | + |
| 12 | +## Install avante.nvim |
| 13 | + |
| 14 | +Install the **avante.nvim** plugin using your preferred plugin manager. For |
| 15 | +instructions, consult **avante.nvim**'s |
| 16 | +[documentation](https://github.com/yetone/avante.nvim?tab=readme-ov-file#installation). |
| 17 | + |
| 18 | +## Configure CodeGate with avante.nvim |
| 19 | + |
| 20 | +Consult **avante.nvim**'s documentation for specific examples on customizing |
| 21 | +your configuration using your preferred plugin manager. |
| 22 | + |
| 23 | +Using `lazy.nvim` (recommended) add the following configuration to enable |
| 24 | +CodeGate with **avante.nvim**: |
| 25 | + |
| 26 | +```lua |
| 27 | +{ |
| 28 | + "yetone/avante.nvim", |
| 29 | + -- ... etc ... |
| 30 | + opts = { |
| 31 | + -- your provider configuration ... |
| 32 | + provider = "openai", |
| 33 | + openai = { |
| 34 | + endpoint = "http://localhost:8989/openai", -- use the endpoint matching your LLM provider |
| 35 | + model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) |
| 36 | + timeout = 30000, -- timeout in milliseconds |
| 37 | + temperature = 0, -- adjust if needed |
| 38 | + max_tokens = 4096, |
| 39 | + }, |
| 40 | + }, |
| 41 | + -- ... etc ... |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +:::note |
| 46 | + |
| 47 | +**avante.nvim** does not yet support _fill-in-the-middle_ completions. You have |
| 48 | +to configure your fill-in-the-middle completion plugin separately. |
| 49 | + |
| 50 | +::: |
| 51 | + |
| 52 | +### Verifying configuration |
| 53 | + |
| 54 | +To verify the configuration, type `:AvanteChat` to start the **avante.nvim** |
| 55 | +plugin. You should see the **avante.nvim** UI appear in the Neovim window. |
| 56 | + |
| 57 | +Type and send the following message: |
| 58 | + |
| 59 | +``` |
| 60 | +codegate version |
| 61 | +``` |
| 62 | + |
| 63 | +If CodeGate is configured correctly, you should see a response from the CodeGate |
| 64 | +server. |
| 65 | + |
| 66 | +### Model muxing |
| 67 | + |
| 68 | +To take advantage of CodeGate's [model muxing feature](../features/muxing.md), |
| 69 | +use **avante.nvim**'s OpenAI provider with the following configuration: |
| 70 | + |
| 71 | +```lua |
| 72 | +openai = { |
| 73 | + endpoint = "http://localhost:8989/v1/mux", -- CodeGate's mux endpoint |
| 74 | + model = "gpt-4o", -- the actual model is determined by your CodeGate workspace |
| 75 | + timeout = 30000, -- timeout in milliseconds |
| 76 | + temperature = 0, -- adjust if needed |
| 77 | + max_tokens = 4096, |
| 78 | +}, |
| 79 | +``` |
0 commit comments