Elffuss BraidHub

kikocis/continue public

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