Elffuss BraidHub

kikocis/continue public

9d5865e0e05b · 8.2 KiBRawPermalink
1---
2title: "Migrating Config to YAML"
3description: "Continue's YAML configuration format provides more readable, maintainable, consistent configuration files, as well as new configuration options and removal of some old configuration options. YAML is the preferred format and will be used to integrate with future Continue products. Below is a brief guide for migration from config.json to config.yaml."
4---
5
6See also
7
8- [Intro to YAML](https://yaml.org/)
9- [YAML Continue Config Reference](/reference)
10
11## Create YAML file
12
13Create a `config.yaml` file in your Continue Global Directory (`~/.continue` on Mac, `%USERPROFILE%\.continue`) alongside your current config.json file. If a `config.yaml` file is present, it will be loaded instead of config.json.
14
15Give your configuration a `name` and a `version`:
16
17config.yaml
18
19```
20name: my-configurationversion: 0.0.1schema: v1
21```
22
23### Models
24
25Add all model configurations in `config.json`, including models in `models`, `tabAutocompleteModel`, `embeddingsProvider`, and `reranker`, to the `models` section of your new YAML config file. A new `roles` YAML field specifies which roles a model can be used for, with possible values `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`.
26
27- `models` in config should have `roles: [chat]`
28
29- `tabAutocompleteModel`(s) in config should have `roles: [autocomplete]`
30
31- `embeddingsProvider` in config should have `roles: [embed]`
32
33- `reranker` in config should have `roles: [rerank]`
34
35- `experimental.modelRoles` is replaced by simply adding roles to the model
36 - `inlineEdit` -> e.g. `roles: [chat, edit]`
37 - `applyCodeBlock` -> e.g. `roles: [chat, apply]`
38
39Model-level `requestOptions` remain, with minor changes. See [YAML Continue Config Reference](/reference#models)
40
41Model-level `completionOptions` are replaced by `defaultCompletionOptions`, with minor changes. See [YAML Continue Config Reference](/reference#models)
42
43**Before**
44
45config.json
46
47```yaml
48models:
49 - title: GPT-4
50 provider: openai
51 model: gpt-4
52 apiKey: <YOUR_OPENAI_API_KEY>
53 completionOptions:
54 temperature: 0.5
55 maxTokens: 2000
56 - title: Ollama
57 provider: ollama
58 model: AUTODETECT
59 - title: My Open AI Compatible Model
60 provider: openai
61 apiBase: http://3.3.3.3/v1
62 model: my-openai-compatible-model
63 requestOptions:
64 headers:
65 X-Auth-Token: <API_KEY>
66tabAutocompleteModel:
67 title: My Starcoder
68 provider: ollama
69 model: starcoder2:3b
70embeddingsProvider:
71 provider: openai
72 model: text-embedding-ada-002
73 apiKey: <YOUR_OPENAI_API_KEY>
74 maxEmbeddingChunkSize: 256
75 maxEmbeddingBatchSize: 5
76reranker:
77 name: voyage
78 params:
79 model: rerank-2
80 apiKey: <YOUR_VOYAGE_API_KEY>
81```
82
83**After**
84
85config.yaml
86
87```
88models:
89 - name: GPT-4
90 provider: openai
91 model: gpt-4
92 apiKey: <YOUR_OPENAI_KEY>
93 defaultCompletionOptions:
94 temperature: 0.5
95 maxTokens: 2000
96 roles:
97 - chat
98 - edit
99 - name: My Voyage Reranker
100 provider: voyage
101 apiKey: <YOUR_VOYAGE_KEY>
102 roles:
103 - rerank
104 - name: My Starcoder
105 provider: ollama
106 model: starcoder2:3b
107 roles:
108 - autocomplete
109 - name: My Ada Embedder
110 provider: openai
111 apiKey: <YOUR_ADA_API_KEY>
112 roles:
113 - embed
114 embedOptions:
115 - maxChunkSize: 256
116 - maxBatchSize: 5
117 - name: Ollama Autodetect
118 provider: ollama
119 model: AUTODETECT
120 - name: My Open AI Compatible Model - Apply
121 provider: openai
122 model: my-openai-compatible-model
123 apiBase: http://3.3.3.3/v1
124 requestOptions:
125 headers:
126 X-Auth-Token: <MY_API_KEY>
127 roles:
128 - chat
129 - apply
130```
131
132Note that the `repoMapFileSelection` experimental model role has been deprecated and is only available in `config.json`.
133
134### Context Providers
135
136The JSON `contextProviders` field is replaced by the YAML `context` array.
137
138- JSON `name` maps to `provider`
139- JSON `params` map to `params`
140
141**Before**
142
143config.json
144
145```yaml
146contextProviders:
147 - name: docs
148 - name: codebase
149 params:
150 nRetrieve: 30
151 nFinal: 3
152 - name: diff
153 params: {}
154```
155
156**After**
157
158config.yaml
159
160```
161context:
162 - provider: docs
163 - provider: codebase
164 params:
165 nRetrieve: 30
166 nFinal: 3
167 - provider: diff
168```
169
170### System Message
171
172The `systemMessage` property has been replaced with a `rules` property that takes an array of strings.
173
174**Before**
175
176config.json
177
178```yaml
179systemMessage: Always give concise responses
180```
181
182**After**
183
184config.yaml
185
186```
187rules:
188 - Always give concise responses
189```
190
191### Prompts
192
193Rather than with `customCommands`, you can now use the `prompts` field to define custom prompts.
194
195**Before**
196
197config.json
198
199```yaml
200customCommands:
201 - name: check
202 description: Check for mistakes in my code
203 prompt: |
204 {{{ input }}}
205
206 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
207 - Syntax errors
208 - Logic errors
209 - Security vulnerabilities
210 - Performance issues
211 - Anything else that looks wrong
212
213 Once you find an error, please explain it as clearly as possible, but without using extra words. For example, instead of saying 'I think there is a syntax error on line 5', you should say 'Syntax error on line 5'. Give your answer as one bullet point per mistake found.
214```
215
216**After**
217
218config.yaml
219
220```
221prompts:
222 - name: check
223 description: Check for mistakes in my code
224 prompt: |
225 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
226 - Syntax errors
227 - Logic errors
228 - Security vulnerabilities
229 - Performance issues
230 - Anything else that looks wrong
231 Once you find an error, please explain it as clearly as possible, but without using extra words. For example, instead of saying 'I think there is a syntax error on line 5', you should say 'Syntax error on line 5'. Give your answer as one bullet point per mistake found.
232```
233
234### Documentation
235
236Documentation is largely the same, but the `title` property has been replaced with `name`. The `startUrl`, `rootUrl`, and `faviconUrl` properties remain.
237
238**Before**
239
240config.json
241
242```yaml
243docs:
244 - startUrl: https://docs.nestjs.com/
245 title: nest.js
246 - startUrl: https://mysite.com/docs/
247 title: My site
248```
249
250**After**
251
252config.yaml
253
254```
255docs:
256 - name: nest.js
257 startUrl: https://docs.nestjs.com/
258 - name: My site
259 startUrl: https://mysite.com/docs/
260```
261
262### MCP Servers
263
264**Properties:**
265
266- `name` (**required**): The name of the MCP server.
267- `command` (**required**): The command used to start the server.
268- `args`: An optional array of arguments for the command.
269- `env`: An optional map of environment variables for the server process.
270- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
271
272**Before**
273
274config.json
275
276```yaml
277experimental:
278 modelContextProtocolServers:
279 - transport:
280 type: stdio
281 command: uvx
282 args:
283 - mcp-server-sqlite
284 - --db-path
285 - /Users/NAME/test.db
286 env:
287 KEY: <VALUE>
288```
289
290**After**
291
292config.yaml
293
294```
295mcpServers:
296 - name: My MCP Server
297 command: uvx
298 args:
299 - mcp-server-sqlite
300 - --db-path
301 - /Users/NAME/test.db
302 env:
303 KEY: <VALUE>
304```
305
306---
307
308## Deprecated configuration options
309
310Some deprecated config.json settings are no longer stored in config and have been moved to be editable through the user settings (Gear Icon). If found in config.json, they will be auto-migrated to User Settings and removed from config.json.
311
312The following top-level fields from config.json have been deprecated and don't have a config.yaml equivalent:
313
314- Slash commands (`slashCommands`)
315
316- top-level `requestOptions`
317
318- top-level `completionOptions`
319
320- `tabAutocompleteOptions`
321
322 - `disable`
323 - `maxPromptTokens`
324 - `debounceDelay`
325 - `maxSuffixPercentage`
326 - `prefixPercentage`
327 - `template`
328 - `onlyMyCode`
329
330- `analytics`
331
332The following top-level fields from config.json have been deprecated. Most UI-related and user-specific options will move into a settings page in the UI
333
334- `customCommands`
335- `experimental`
336- `userToken`
337
338## New Configuration options
339
340The YAML configuration format offers new configuration options not available in the JSON format. See the [YAML Config Reference](/reference) for more information.