Elffuss BraidHub

kikocis/continue public

f34c6dd29412 · 15.9 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
216List of rules that the LLM should follow. These 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. See the [rules deep dive](/customize/deep-dives/rules) for details.
217
218Explicit rules can either be simple text or an object with the following properties:
219
220- `name` (**required**): A display name/title for the rule
221- `rule` (**required**): The text content of the rule
222- `globs` (optional): When files are provided as context that match this glob pattern, the rule will be included. This can be either a single pattern (e.g., `"**/*.{ts,tsx}"`) or an array of patterns (e.g., `["src/**/*.ts", "tests/**/*.ts"]`).
223
224```yaml title="config.yaml"l
225rules:
226 - Always annotate Python functions with their parameter and return types
227 - name: TypeScript best practices
228 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
229 globs: "**/*.{ts,tsx}"
230 - name: TypeScript test patterns
231 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
232 globs:
233 - "src/**/*.test.ts"
234 - "tests/**/*.ts"
235 - uses: myprofile/my-mood-setter
236 with:
237 TONE: concise
238```
239
240---
241
242### `prompts`
243
244A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
245
246```yaml title="config.yaml"
247prompts:
248 - name: check
249 description: Check for mistakes in my code
250 prompt: |
251 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
252 - Syntax errors
253 - Logic errors
254 - Security vulnerabilities
255```
256
257---
258
259### `docs`
260
261List of documentation sites to index.
262
263**Properties:**
264
265- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
266- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
267- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
268- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
269
270**Example:**
271
272```yaml title="config.yaml"
273docs:
274 - name: Continue
275 startUrl: https://docs.continue.dev/intro
276 favicon: https://docs.continue.dev/favicon.ico
277```
278
279---
280
281### `mcpServers`
282
283The [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.
284
285**Properties:**
286
287- `name` (**required**): The name of the MCP server.
288- `command` (**required**): The command used to start the server.
289- `args`: An optional array of arguments for the command.
290- `env`: An optional map of environment variables for the server process.
291- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
292- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
293- `requestOptions`: Optional request options for `sse` and `streamable-http` servers. Same format as [model requestOptions](#models).
294
295**Example:**
296
297```yaml title="config.yaml"
298mcpServers:
299 - name: My MCP Server
300 command: uvx
301 args:
302 - mcp-server-sqlite
303 - --db-path
304 - ./test.db
305 cwd: /Users/NAME/project
306 env:
307 NODE_ENV: production
308```
309
310### `data`
311
312Destinations to which [development data](/customize/deep-dives/development-data) will be sent.
313
314**Properties:**
315
316- `name` (**required**): The display name of the data destination
317- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
318 - an HTTP endpoint that will receive a POST request with a JSON blob
319 - a file URL to a directory in which events will be dumpted to `.jsonl` files
320- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
321- `events`: an array of event names to include. Defaults to all events if not specified.
322- `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`
323- `apiKey`: api key to be sent with request (Bearer header)
324- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
325
326**Example:**
327
328```yaml title="config.yaml"
329data:
330 - name: Local Data Bank
331 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
332 schema: 0.2.0
333 level: all
334 - name: My Private Company
335 destination: https://mycompany.com/ingest
336 schema: 0.2.0
337 level: noCode
338 events:
339 - autocomplete
340 - chatInteraction
341```
342
343---
344
345## Complete YAML Config Example
346
347Putting it all together, here's a complete example of a `config.yaml` configuration file:
348
349```yaml title="config.yaml"
350name: MyProject
351version: 0.0.1
352schema: v1
353models:
354 - uses: anthropic/claude-3.5-sonnet
355 with:
356 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
357 override:
358 defaultCompletionOptions:
359 temperature: 0.8
360 - name: GPT-4
361 provider: openai
362 model: gpt-4
363 roles:
364 - chat
365 - edit
366 defaultCompletionOptions:
367 temperature: 0.5
368 maxTokens: 2000
369 requestOptions:
370 headers:
371 Authorization: Bearer YOUR_OPENAI_API_KEY
372 - name: Ollama Starcoder
373 provider: ollama
374 model: starcoder
375 roles:
376 - autocomplete
377 autocompleteOptions:
378 debounceDelay: 350
379 maxPromptTokens: 1024
380 onlyMyCode: true
381 defaultCompletionOptions:
382 temperature: 0.3
383 stop:
384 - "\n"
385rules:
386 - Give concise responses
387 - Always assume TypeScript rather than JavaScript
388prompts:
389 - name: test
390 description: Unit test a function
391 prompt: |
392 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
393 The tests should cover all possible edge cases and should be as thorough as possible.
394 You should also include a description of each test case.
395 - uses: myprofile/my-favorite-prompt
396context:
397 - provider: diff
398 - provider: file
399 - provider: code
400mcpServers:
401 - name: DevServer
402 command: npm
403 args:
404 - run
405 - dev
406 env:
407 PORT: "3000"
408data:
409 - name: My Private Company
410 destination: https://mycompany.com/ingest
411 schema: 0.2.0
412 level: noCode
413 events:
414 - autocomplete
415 - chatInteraction
416```
417
418## Using YAML anchors to avoid config duplication
419
420You 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:
421
422```yaml title="config.yaml"
423%YAML 1.1
424---
425name: MyProject
426version: 0.0.1
427schema: v1
428model_defaults: &model_defaults
429 provider: openai
430 apiKey: my-api-key
431 apiBase: https://api.example.com/llm
432models:
433 - name: mistral
434 <<: *model_defaults
435 model: mistral-7b-instruct
436 roles:
437 - chat
438 - edit
439 - name: qwen2.5-coder-7b-instruct
440 <<: *model_defaults
441 model: qwen2.5-coder-7b-instruct
442 roles:
443 - chat
444 - edit
445 - name: qwen2.5-coder-7b
446 <<: *model_defaults
447 model: qwen2.5-coder-7b
448 useLegacyCompletionsEndpoint: false
449 roles:
450 - autocomplete
451 autocompleteOptions:
452 debounceDelay: 350
453 maxPromptTokens: 1024
454 onlyMyCode: true
455```
456
457---
458
459## `config.json` Deprecation
460
461`config.yaml `replaces `config.json`, which is deprecated. View the **[Migration Guide](/reference/yaml-migration)** for help transitioning from the old format.