Use CodeGate with avante.nvim
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 avante.nvim
Install the avante.nvim
plugin using your preferred Neovim plugin manager. For
detailed installation instructions, refer to Avante's
documentation.
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 use CodeGate
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:
- CodeGate muxing
- OpenAI
First, configure your provider(s) and select a model for each of your workspace(s) in the CodeGate dashboard.
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 ...
}
You need an OpenAI API account to use this provider.
To use a different OpenAI-compatible endpoint, set the CODEGATE_OPENAI_URL
configuration parameter when you launch CodeGate.
{
"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 ...
}
avante.nvim
does not yet support fill-in-the-middle (FIM) completions. You
have to configure your FIM completion plugin separately.
Verify configuration
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.
codegate
commands like codegate version
are not currently working with
avante.nvim. We are
tracking this issue here.
Next steps
Learn more about CodeGate's features and explore the dashboard.