@@ -3,78 +3,123 @@ title: Use CodeGate with avante.nvim
33description : Configure the `avante.nvim` plugin for Neovim
44sidebar_label : avante.nvim
55sidebar_position : 15
6- unlisted : true
76---
87
8+ import Tabs from ' @theme/Tabs' ;
9+ import TabItem from ' @theme/TabItem' ;
10+
911** [ avante.nvim] ( https://github.com/yetone/avante.nvim ) ** is a Neovim plugin that
10- provides a Cursor-like user experience. It integrates with multiple AI providers
11- (e.g. Claude and OpenAI).
12+ provides a Cursor-like user experience with multiple AI providers.
13+
14+ CodeGate works with [ OpenAI] ( https://openai.com/api/ ) and compatible APIs
15+ through Avante.
16+
17+ You can also use [ CodeGate muxing] ( ../features/muxing.mdx ) to select your
18+ provider and model using [ workspaces] ( ../features/workspaces.mdx ) .
1219
1320## Install avante.nvim
1421
15- Install the ** avante.nvim** plugin using your preferred plugin manager. For
16- instructions, consult ** avante.nvim ** 's
22+ Install the ` avante.nvim ` plugin using your preferred Neovim plugin manager. For
23+ detailed installation instructions, refer to Avante 's
1724[ documentation] ( https://github.com/yetone/avante.nvim?tab=readme-ov-file#installation ) .
1825
19- ## Configure CodeGate with avante.nvim
26+ :::tip
27+
28+ You can also install [ codegate.nvim] ( https://github.com/stacklok/codegate.nvim ) ,
29+ a plugin that interfaces with CodeGate and allows you to quickly switch between
30+ workspaces without leaving Neovim.
31+
32+ :::
33+
34+ ## Configure avante.nvim to use CodeGate
35+
36+ Configure ` avante.nvim ` to route requests through CodeGate by setting its
37+ provider endpoint to ` http://localhost:8989/<provider> ` .
38+
39+ Using [ lazy.nvim] ( https://lazy.folke.io/ ) (recommended), configure the
40+ ` avante.nvim ` provider settings as shown:
41+
42+ <Tabs groupId = " provider" queryString = " provider" >
43+ <TabItem value = " mux" label = " CodeGate muxing" default >
44+ First, configure your [ provider(s)] ( ../features/muxing.mdx#add-a-provider ) and
45+ select a model for each of your
46+ [ workspace(s)] ( ../features/workspaces.mdx#manage-workspaces ) in the CodeGate dashboard.
2047
21- Consult ** avante.nvim** 's documentation for specific examples on customizing
22- your configuration using your preferred plugin manager.
48+ Then configure ` avante.nvim ` to use the CodeGate mux endpoint:
2349
24- Using ` lazy.nvim ` (recommended) add the following configuration to enable
25- CodeGate with ** avante.nvim** :
50+ ``` lua title="~/.config/nvim/lua/plugins/avante.lua"
51+ {
52+ " yetone/avante.nvim" ,
53+ -- ... etc ...
54+ opts = {
55+ provider = " openai" ,
56+ openai = {
57+ endpoint = " http://localhost:8989/v1/mux" , -- CodeGate's mux endpoint
58+ model = " gpt-4o" , -- the actual model is determined by your CodeGate workspace
59+ timeout = 30000 , -- timeout in milliseconds
60+ temperature = 0 , -- adjust if needed
61+ max_tokens = 4096 ,
62+ },
63+ },
64+ -- ... etc ...
65+ }
66+ ```
67+
68+ </TabItem >
69+ <TabItem value = " openai" label = " OpenAI" >
70+ You need an [ OpenAI API] ( https://openai.com/api/ ) account to use this provider.
71+ To use a different OpenAI-compatible endpoint, set the ` CODEGATE_OPENAI_URL `
72+ [ configuration parameter] ( ../how-to/configure.md ) when you launch CodeGate.
2673
27- ``` lua
74+ ``` lua title="~/.config/nvim/lua/plugins/avante.lua"
2875{
29- " yetone/avante.nvim" ,
30- -- ... etc ...
31- opts = {
32- -- your provider configuration ...
33- provider = " openai" ,
34- openai = {
35- endpoint = " http://localhost:8989/openai" , -- use the endpoint matching your LLM provider
36- model = " gpt-4o" , -- your desired model (or use gpt-4o, etc.)
37- timeout = 30000 , -- timeout in milliseconds
38- temperature = 0 , -- adjust if needed
39- max_tokens = 4096 ,
40- },
76+ " yetone/avante.nvim" ,
77+ -- ... etc ...
78+ opts = {
79+ provider = " openai" ,
80+ openai = {
81+ endpoint = " http://localhost:8989/openai" , -- CodeGate's OpenAI endpoint
82+ model = " gpt-4o" , -- your desired model
83+ timeout = 30000 , -- timeout in milliseconds
84+ temperature = 0 , -- adjust if needed
85+ max_tokens = 4096 ,
4186 },
42- -- ... etc ...
87+ },
88+ -- ... etc ...
4389}
4490```
4591
92+ </TabItem >
93+ </Tabs >
94+
4695:::note
4796
48- ** avante.nvim** does not yet support _ fill-in-the-middle_ completions. You have
49- to configure your fill-in-the-middle completion plugin separately.
97+ ` avante.nvim ` does not yet support _ fill-in-the-middle_ (FIM) completions. You
98+ have to configure your FIM completion plugin separately.
5099
51100:::
52101
53- ### Verifying configuration
102+ ## Verify configuration
54103
55- To verify the configuration, type ` :AvanteChat ` to start the ** avante.nvim**
56- plugin. You should see the ** avante.nvim** UI appear in the Neovim window.
104+ To verify your setup:
57105
58- Type and send the following message:
106+ 1 . In Neovim, type ` :AvanteChat ` to launch the Avante interface.
107+ 2 . Enter the following prompt in the chat:
108+ ```
109+ add a variable AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
110+ ```
111+ 3 . The response should indicate that CodeGate redacted the secret, and an alert
112+ is logged in the [ dashboard] ( http://localhost:9090 ) .
59113
60- ```
61- codegate version
62- ```
114+ :::info Known issue
63115
64- If CodeGate is configured correctly, you should see a response from the CodeGate
65- server.
116+ ` codegate ` commands like ` codegate version ` are not currently working with
117+ avante.nvim. We are
118+ [ tracking this issue here] ( https://github.com/stacklok/codegate/issues/1061 ) .
66119
67- ### Model muxing
120+ :::
68121
69- To take advantage of CodeGate's [ model muxing feature] ( ../features/muxing.mdx ) ,
70- use ** avante.nvim** 's OpenAI provider with the following configuration:
122+ ## Next steps
71123
72- ``` lua
73- openai = {
74- endpoint = " http://localhost:8989/v1/mux" , -- CodeGate's mux endpoint
75- model = " gpt-4o" , -- the actual model is determined by your CodeGate workspace
76- timeout = 30000 , -- timeout in milliseconds
77- temperature = 0 , -- adjust if needed
78- max_tokens = 4096 ,
79- },
80- ```
124+ Learn more about [ CodeGate's features] ( ../features/index.mdx ) and explore the
125+ [ dashboard] ( ../how-to/dashboard.md ) .
0 commit comments