title | description | sidebar_label | sidebar_position |
---|---|---|---|
Use CodeGate with avante.nvim |
Configure the `avante.nvim` plugin for Neovim |
avante.nvim |
15 |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
avante.nvim is a Neovim plugin that provides a Cursor-like user experience with multiple AI providers.
CodeGate works with OpenAI and compatible APIs through Avante.
You can also use CodeGate muxing to select your provider and model using workspaces.
Install the avante.nvim
plugin using your preferred Neovim plugin manager. For
detailed installation instructions, refer to Avante's
documentation.
:::tip
You can also install codegate.nvim, a plugin that interfaces with CodeGate and allows you to quickly switch between workspaces without leaving Neovim.
:::
Configure avante.nvim
to route requests through CodeGate by setting its
provider endpoint to http://localhost:8989/<provider>
.
Using lazy.nvim (recommended), configure the
avante.nvim
provider settings as shown:
Then configure avante.nvim
to use the CodeGate mux endpoint:
{
"yetone/avante.nvim",
-- ... etc ...
opts = {
provider = "openai",
openai = {
endpoint = "http://localhost:8989/v1/mux", -- CodeGate's mux endpoint
model = "gpt-4o", -- the actual model is determined by your CodeGate workspace
timeout = 30000, -- timeout in milliseconds
temperature = 0, -- adjust if needed
max_tokens = 4096,
},
},
-- ... etc ...
}
{
"yetone/avante.nvim",
-- ... etc ...
opts = {
provider = "openai",
openai = {
endpoint = "http://localhost:8989/openai", -- CodeGate's OpenAI endpoint
model = "gpt-4o", -- your desired model
timeout = 30000, -- timeout in milliseconds
temperature = 0, -- adjust if needed
max_tokens = 4096,
},
},
-- ... etc ...
}
:::note
avante.nvim
does not yet support fill-in-the-middle (FIM) completions. You
have to configure your FIM completion plugin separately.
:::
To verify your setup:
- In Neovim, type
:AvanteChat
to launch the Avante interface. - Enter the following prompt in the chat:
add a variable AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
- The response should indicate that CodeGate redacted the secret, and an alert is logged in the dashboard.
:::info Known issue
codegate
commands like codegate version
are not currently working with
avante.nvim. We are
tracking this issue here.
:::
Learn more about CodeGate's features and explore the dashboard.