Elffuss BraidHub

kikocis/continue public

c657d7bd6e88 · 8.7 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: - name: GPT-4 provider: openai model: gpt-4 apiKey: <YOUR_OPENAI_KEY> defaultCompletionOptions: temperature: 0.5 maxTokens: 2000 roles: - chat - edit - name: My Voyage Reranker provider: voyage apiKey: <YOUR_VOYAGE_KEY> roles: - rerank - name: My Starcoder provider: ollama model: starcoder2:3b roles: - autocomplete - name: My Ada Embedder provider: openai apiKey: <YOUR_ADA_API_KEY> roles: - embed embedOptions: - maxChunkSize: 256 - maxBatchSize: 5 - name: Ollama Autodetect provider: ollama model: AUTODETECT - name: My Open AI Compatible Model - Apply provider: openai model: my-openai-compatible-model apiBase: http://3.3.3.3/v1 requestOptions: headers: X-Auth-Token: <MY_API_KEY> roles: - chat - apply
92```
93
94Note that the `repoMapFileSelection` experimental model role has been deprecated and is only available in `config.json`.
95
96### Context Providers
97
98The JSON `contextProviders` field is replaced by the YAML `context` array.
99
100- JSON `name` maps to `provider`
101- JSON `params` map to `params`
102
103**Before**
104
105config.json
106
107```json
108{
109 "contextProviders": [
110 { "name": "docs" },
111 { "name": "codebase", "params": { "nRetrieve": 30, "nFinal": 3 } },
112 { "name": "diff", "params": {} }
113 ]
114}
115```
116
117**After**
118
119config.yaml
120
121```
122context: - provider: docs - provider: codebase params: nRetrieve: 30 nFinal: 3 - provider: diff
123```
124
125### System Message
126
127The `systemMessage` property has been replaced with a `rules` property that takes an array of strings.
128
129**Before**
130
131config.json
132
133```json
134{ "systemMessage": "Always give concise responses" }
135```
136
137**After**
138
139config.yaml
140
141```
142rules: - Always give concise responses
143```
144
145### Prompts
146
147Rather than with `customCommands`, you can now use the `prompts` field to define custom prompts.
148
149**Before**
150
151config.json
152
153```json
154{
155 "customCommands": [
156 {
157 "name": "check",
158 "description": "Check for mistakes in my code",
159 "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."
160 }
161 ]
162}
163```
164
165**After**
166
167config.yaml
168
169```
170prompts: - name: check description: Check for mistakes in my code prompt: | Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant: - Syntax errors - Logic errors - Security vulnerabilities - Performance issues - Anything else that looks wrong 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.
171```
172
173### Documentation
174
175Documentation is largely the same, but the `title` property has been replaced with `name`. The `startUrl`, `rootUrl`, and `faviconUrl` properties remain.
176
177**Before**
178
179config.json
180
181```json
182{
183 "docs": [
184 { "startUrl": "https://docs.nestjs.com/", "title": "nest.js" },
185 { "startUrl": "https://mysite.com/docs/", "title": "My site" }
186 ]
187}
188```
189
190**After**
191
192config.yaml
193
194```
195docs: - name: nest.js startUrl: https://docs.nestjs.com/ - name: My site startUrl: https://mysite.com/docs/
196```
197
198### MCP Servers
199
200**Properties:**
201
202- `name` (**required**): The name of the MCP server.
203- `command` (**required**): The command used to start the server.
204- `args`: An optional array of arguments for the command.
205- `env`: An optional map of environment variables for the server process.
206- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
207
208**Before**
209
210config.json
211
212```json
213{
214 "experimental": {
215 "modelContextProtocolServers": [
216 {
217 "transport": {
218 "type": "stdio",
219 "command": "uvx",
220 "args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"],
221 "env": { "KEY": "<VALUE>" }
222 }
223 }
224 ]
225 }
226}
227```
228
229**After**
230
231config.yaml
232
233```
234mcpServers: - name: My MCP Server command: uvx args: - mcp-server-sqlite - --db-path - /Users/NAME/test.db env: KEY: <VALUE>
235```
236
237---
238
239## Deprecated configuration options
240
241Some deprecated `config.json` settings are no longer stored in config and have been moved to be editable through the [User Settings Page](/customize/settings) (Gear Icon). If found in `config.json`, they will be auto-migrated to User Settings and removed from `config.json`.
242
243See the [JSON Config Reference](/reference) for more information on fully deprecated options.
244
245The following top-level fields from `config.json` still work when using `config.json` but have been deprecated and don't have a YAML equivalent:
246
247- Slash commands (JSON `slashCommands`)
248
249- top-level `requestOptions`
250
251- top-level `completionOptions`
252
253- `tabAutocompleteOptions`
254 - `disable`
255 - `maxPromptTokens`
256 - `debounceDelay`
257 - `maxSuffixPercentage`
258 - `prefixPercentage`
259 - `template`
260 - `onlyMyCode`
261
262- `analytics`
263
264The 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
265
266- `customCommands`
267- `experimental`
268- `userToken`
269
270## New Configuration options
271
272The YAML configuration format offers new configuration options not available in the JSON format. See the [YAML Config Reference](/reference) for more information.