Elffuss BraidHub

kikocis/continue public

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