Skip to main content

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.

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 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:

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:

~/.config/nvim/lua/plugins/avante.lua
{
"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 ...
}
note

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:

  1. In Neovim, type :AvanteChat to launch the Avante interface.
  2. Enter the following prompt in the chat:
    add a variable AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
  3. The response should indicate that CodeGate redacted the secret, and an alert is logged in the dashboard.
Known issue

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.