Elffuss BraidHub

kikocis/continue public

main · 15.2 KiBRawPermalink
1---
2title: "config.yaml Reference"
3description: "Comprehensive guide to the config.yaml format used by Continue.dev for building custom coding agents. Learn how to define models, context providers, rules, prompts, and more using YAML configuration."
4---
5
6## Introduction
7
8Continue Agents are defined using the `config.yaml` specification.
9
10**Agents** are composed of models, rules, and tools (MCP servers).
11
12<Columns cols={2}>
13<Card title="Configuring Models, Rules, and Tools" icon="cube" href="/guides/configuring-models-rules-tools">
14Learn how to work with Continue's configuration system, including using hub models, rules, and tools, creating local configurations, and organizing your setup.
15</Card>
16
17<Card title="Understanding Agents" icon="robot" href="/guides/understanding-agents">
18Learn how to build and configure agents, understand their capabilities, and customize them for your development workflow.
19</Card>
20</Columns>
21
22## Properties
23
24Below are details for each property that can be set in `config.yaml`.
25
26**All properties at all levels are optional unless explicitly marked as required.**
27
28The top-level properties in the `config.yaml` configuration file are:
29
30- [`name`](#name) (**required**)
31- [`version`](#version) (**required**)
32- [`schema`](#schema) (**required**)
33- [`models`](#models)
34- [`context`](#context)
35- [`rules`](#rules)
36- [`prompts`](#prompts)
37- [`docs`](#docs)
38- [`mcpServers`](#mcpservers)
39- [`data`](#data)
40
41---
42
43### `name`
44
45The `name` property specifies the name of your project or configuration.
46
47```yaml title="config.yaml"
48name: MyProject
49```
50
51---
52
53### `version`
54
55The `version` property specifies the version of your project or configuration.
56
57### `schema`
58
59The `schema` property specifies the schema version used for the `config.yaml`, e.g. `v1`
60
61---
62
63### `models`
64
65The `models` section defines the language models used in your configuration. Models are used for functionalities such as chat, editing, and summarizing.
66
67**Properties:**
68
69- `name` (**required**): A unique name to identify the model within your configuration.
70
71- `provider` (**required**): The provider of the model (e.g., `openai`, `ollama`).
72
73- `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`).
74
75- `apiBase`: Can be used to override the default API base that is specified per model
76
77- `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used.
78
79- `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. See the [Model Capabilities guide](/customize/deep-dives/model-capabilities) for detailed information. Supported capabilities include:
80
81 - `tool_use`: Enables function/tool calling support (required for Agent mode)
82 - `image_input`: Enables image upload and processing support
83
84 Continue automatically detects these capabilities for most models, but you can override this when using custom deployments or if autodetection isn't working correctly.
85
86- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.
87
88- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are [`chat`](), [`edit`](/customize/model-roles/edit#edit-prompt-templating), [`apply`](/customize/model-roles/apply#apply-prompt-templating) and [`autocomplete`](/customize/model-roles/autocomplete#autocomplete-prompt-templating). The `chat` property must be a valid template name, such as `llama3` or `anthropic`.
89
90- `chatOptions`: If the model includes role `chat`, these settings apply for Agent and Chat mode:
91
92 - `baseSystemMessage`: Can be used to override the default system prompt for **Chat** mode.
93 - `baseAgentSystemMessage`: Can be used to override the default system prompt for **Agent** mode.
94 - `basePlanSystemMessage`: Can be used to override the default system prompt for **Plan** mode.
95
96- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings:
97
98 - `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens.
99 - `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk.
100
101- `defaultCompletionOptions`: Default completion options for model settings.
102
103 - `contextLength`: Maximum context length of the model, typically in tokens.
104 - `maxTokens`: Maximum number of tokens to generate in a completion.
105 - `temperature`: Controls the randomness of the completion. Values range from `0.0` (deterministic) to `1.0` (random).
106 - `topP`: The cumulative probability for nucleus sampling.
107 - `topK`: Maximum number of tokens considered at each step.
108 - `stop`: An array of stop tokens that will terminate the completion.
109 - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ and some Ollama models.
110 - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models.
111
112- `requestOptions`: HTTP request options specific to the model.
113
114 - `timeout`: Timeout for each request to the language model.
115
116 - `verifySsl`: Whether to verify SSL certificates for requests.
117
118 - `caBundlePath`: Path to a custom CA bundle for HTTP requests.
119
120 - `proxy`: Proxy URL for HTTP requests.
121
122 - `headers`: Custom headers for HTTP requests.
123
124 - `extraBodyProperties`: Additional properties to merge with the HTTP request body.
125
126 - `noProxy`: List of hostnames that should bypass the specified proxy.
127
128 - `clientCertificate`: Client certificate for HTTP requests.
129 - `cert`: Path to the client certificate file.
130 - `key`: Path to the client certificate key file.
131 - `passphrase`: Optional passphrase for the client certificate key file.
132
133- `autocompleteOptions`: If the model includes role `autocomplete`, these settings apply for tab autocompletion:
134
135 - `disable`: If `true`, disables autocomplete for this model.
136 - `maxPromptTokens`: Maximum number of tokens for the autocomplete prompt.
137 - `debounceDelay`: Delay before triggering autocomplete in milliseconds.
138 - `modelTimeout`: Model timeout for autocomplete requests in milliseconds.
139 - `maxSuffixPercentage`: Maximum percentage of prompt allocated for suffix.
140 - `prefixPercentage`: Percentage of input allocated for prefix.
141 - `transform`: If `false`, disables trimming of multiline completions. Defaults to `true`. Useful for models that generate better multiline completions without transformations.
142 - `template`: Custom template for autocomplete using Mustache syntax. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables.
143 - `onlyMyCode`: Only includes code within the repository for context.
144 - `useCache`: If `true`, enables caching for completions.
145 - `useImports`: If `true`, includes imports in context.
146 - `useRecentlyEdited`: If `true`, includes recently edited files in context.
147 - `useRecentlyOpened`: If `true`, includes recently opened files in context.
148
149**Example:**
150
151```yaml title="config.yaml"
152models:
153 - name: GPT-4o
154 provider: openai
155 model: gpt-4o
156 roles:
157 - chat
158 - edit
159 - apply
160 defaultCompletionOptions:
161 temperature: 0.7
162 maxTokens: 1500
163 - name: Codestral
164 provider: mistral
165 model: codestral-latest
166 roles:
167 - autocomplete
168 autocompleteOptions:
169 debounceDelay: 250
170 maxPromptTokens: 1024
171 onlyMyCode: true
172 - name: My Model - OpenAI-Compatible
173 provider: openai
174 apiBase: http://my-endpoint/v1
175 model: my-custom-model
176 capabilities:
177 - tool_use
178 - image_input
179 roles:
180 - chat
181 - edit
182```
183
184---
185
186### `context`
187
188The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
189
190More information about usage/params for each context provider can be found [here](/customize/deep-dives/custom-providers)
191
192**Properties:**
193
194- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
195- `name`: Optional name for the provider
196- `params`: Optional parameters to configure the context provider's behavior.
197
198**Example:**
199
200```yaml title="config.yaml"
201context:
202 - provider: file
203 - provider: code
204 - provider: diff
205 - provider: http
206 name: Context Server 1
207 params:
208 url: "https://api.example.com/server1"
209 - provider: terminal
210```
211
212---
213
214### `rules`
215
216Rules are concatenated into the system message for all [Agent](/features/agent/quick-start), [Chat](/features/chat/quick-start), and [Edit](/features/edit/quick-start) requests.
217
218Confiugration example:
219
220```yaml title="config.yaml"
221rules:
222 - uses: sanity/sanity-opinionated # rules file stored on Continue Hub
223 - uses: file://user/Desktop/rules.md # rules file stored on local computer
224```
225
226Rules file example:
227
228```md title="rules.md"
229---
230name: Pirate rule
231---
232
233Talk like a pirate
234```
235
236See the [rules deep dive](/customize/deep-dives/rules) for more details.
237
238---
239
240### `prompts`
241
242Prompts can be invoked with a <kbd>/</kbd> command.
243
244Configuration example:
245
246```yaml title="config.yaml"
247prompts:
248 - uses: supabase/create-functions # prompts file stored on Continue Hub
249 - uses: file://user/Desktop/prompts.md # prompts file stored on local computer
250```
251
252Prompts file example:
253
254```md title="prompts.md"
255---
256name: Make pirate comments
257invokable: true
258---
259
260Rewrite all comments in the active file to talk like a pirate
261```
262
263See the [prompts deep dive](/customize/deep-dives/prompts) for more details.
264
265---
266
267### `docs`
268
269List of documentation sites to index.
270
271**Properties:**
272
273- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
274- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
275- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
276- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
277
278**Example:**
279
280```yaml title="config.yaml"
281docs:
282 - name: Continue
283 startUrl: https://docs.continue.dev/intro
284 favicon: https://docs.continue.dev/favicon.ico
285```
286
287---
288
289### `mcpServers`
290
291The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a standard proposed by Anthropic to unify prompts, context, and tool use. Continue supports any MCP server with the MCP context provider.
292
293**Properties:**
294
295- `name` (**required**): The name of the MCP server.
296- `command` (**required**): The command used to start the server.
297- `args`: An optional array of arguments for the command.
298- `env`: An optional map of environment variables for the server process.
299- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
300- `requestOptions`: Optional request options for `sse` and `streamable-http` servers. Same format as [model requestOptions](#models).
301- `connectionTimeout`: Optional timeout for _initial_ connection to MCP server
302
303**Example:**
304
305```yaml title="config.yaml"
306mcpServers:
307 - name: My MCP Server
308 command: uvx
309 args:
310 - mcp-server-sqlite
311 - --db-path
312 - ./test.db
313 cwd: /Users/NAME/project
314 env:
315 NODE_ENV: production
316```
317
318### `data`
319
320Destinations to which [development data](/customize/deep-dives/development-data) will be sent.
321
322**Properties:**
323
324- `name` (**required**): The display name of the data destination
325- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
326 - an HTTP endpoint that will receive a POST request with a JSON blob
327 - a file URL to a directory in which events will be dumpted to `.jsonl` files
328- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
329- `events`: an array of event names to include. Defaults to all events if not specified.
330- `level`: a pre-defined filter for event fields. Options include `all` and `noCode`; the latter excludes data like file contents, prompts, and completions. Defaults to `all`
331- `apiKey`: api key to be sent with request (Bearer header)
332- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
333
334**Example:**
335
336```yaml title="config.yaml"
337data:
338 - name: Local Data Bank
339 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
340 schema: 0.2.0
341 level: all
342 - name: My Private Company
343 destination: https://mycompany.com/ingest
344 schema: 0.2.0
345 level: noCode
346 events:
347 - autocomplete
348 - chatInteraction
349```
350
351---
352
353## Complete YAML Config Example
354
355Putting it all together, here's a complete example of a `config.yaml` configuration file:
356
357```yaml title="config.yaml"
358name: MyProject
359version: 0.0.1
360schema: v1
361models:
362 - uses: anthropic/claude-3.5-sonnet
363 with:
364 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
365 override:
366 defaultCompletionOptions:
367 temperature: 0.8
368 - name: GPT-4
369 provider: openai
370 model: gpt-4
371 roles:
372 - chat
373 - edit
374 defaultCompletionOptions:
375 temperature: 0.5
376 maxTokens: 2000
377 requestOptions:
378 headers:
379 Authorization: Bearer YOUR_OPENAI_API_KEY
380 - name: Ollama Starcoder
381 provider: ollama
382 model: starcoder
383 roles:
384 - autocomplete
385 autocompleteOptions:
386 debounceDelay: 350
387 maxPromptTokens: 1024
388 onlyMyCode: true
389 defaultCompletionOptions:
390 temperature: 0.3
391 stop:
392 - "\n"
393rules:
394 - Give concise responses
395 - Always assume TypeScript rather than JavaScript
396prompts:
397 - name: test
398 description: Unit test a function
399 prompt: |
400 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
401 The tests should cover all possible edge cases and should be as thorough as possible.
402 You should also include a description of each test case.
403 - uses: myprofile/my-favorite-prompt
404context:
405 - provider: diff
406 - provider: file
407 - provider: code
408mcpServers:
409 - name: DevServer
410 command: npm
411 args:
412 - run
413 - dev
414 env:
415 PORT: "3000"
416data:
417 - name: My Private Company
418 destination: https://mycompany.com/ingest
419 schema: 0.2.0
420 level: noCode
421 events:
422 - autocomplete
423 - chatInteraction
424```
425
426## Using YAML anchors to avoid config duplication
427
428You can also use node anchors to avoid duplication of properties. To do so, adding the YAML version header `%YAML 1.1` is needed, here's an example of a `config.yaml` configuration file using anchors:
429
430```yaml title="config.yaml"
431%YAML 1.1
432---
433name: MyProject
434version: 0.0.1
435schema: v1
436model_defaults: &model_defaults
437 provider: openai
438 apiKey: my-api-key
439 apiBase: https://api.example.com/llm
440models:
441 - name: mistral
442 <<: *model_defaults
443 model: mistral-7b-instruct
444 roles:
445 - chat
446 - edit
447 - name: qwen2.5-coder-7b-instruct
448 <<: *model_defaults
449 model: qwen2.5-coder-7b-instruct
450 roles:
451 - chat
452 - edit
453 - name: qwen2.5-coder-7b
454 <<: *model_defaults
455 model: qwen2.5-coder-7b
456 useLegacyCompletionsEndpoint: false
457 roles:
458 - autocomplete
459 autocompleteOptions:
460 debounceDelay: 350
461 maxPromptTokens: 1024
462 onlyMyCode: true
463```
464
465---
466
467## `config.json` Deprecation
468
469`config.yaml `replaces `config.json`, which is deprecated. View the **[Migration Guide](/reference/yaml-migration)** for help transitioning from the old format.