Elffuss BraidHub

kikocis/continue public

753e021a1971 · 19.5 KiBRawPermalink
1---
2title: "config.yaml Reference"
3description: "Comprehensive guide to the config.yaml format used by Continue.dev for building custom coding assistants. Learn how to define models, context providers, rules, prompts, and more using reusable blocks and YAML configuration."
4---
5
6## Introduction
7
8Continue hub assistants are defined using the `config.yaml` specification. Assistants can be loaded from [the Hub](https://hub.continue.dev/explore/assistants) or locally
9
10- [Continue Hub](https://hub.continue.dev/explore/assistants) - YAML is stored on the hub and automatically synced to the extension
11
12- Locally
13 - in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) within `.continue/assistants`. The name of the file will be used as the display name of the assistant, e.g. `My Assistant.yaml`
14 - in your workspace in a `/.continue/assistants` folder, with the same naming convention
15
16<Info>
17 Config YAML replaces `config.json`, which is deprecated. View the **[Migration
18 Guide](/reference/yaml-migration)**.
19</Info>
20
21An assistant is made up of:
22
231. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the assistant
242. **Block lists**, which are composable arrays of coding assistant building blocks available to the assistant, such as models, docs, and context providers.
25
26A block is a single standalone building block of a coding assistants, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as assistants (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is.
27
28Examples of blocks and assistants can be found on the [Continue hub](https://hub.continue.dev/explore/assistants).
29
30Assistants can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks.
31
32### Using Blocks
33
34Hub blocks and assistants are identified with a slug in the format `owner-slug/block-or-assistant-slug`, where an owner can be a user or organization (For example, if you want to use the [OpenAI 4o Model block](https://hub.continue.dev/openai/gpt-4o), your slug would be `openai/gpt-4o`). These blocks are pulled from [https://hub.continue.dev](https://hub.continue.dev).
35
36Blocks can be imported into an assistant by adding a `uses` clause under the block type. This can be alongside other `uses` clauses or explicit blocks of that type.
37
38For example, the following assistant imports an Anthropic model and defines an Ollama DeepSeek one.
39
40Assistant models section
41
42```yaml
43models:
44 - uses: anthropic/claude-3.5-sonnet # an imported model block
45 - model: deepseek-reasoner # an explicit model block
46 provider: ollama
47```
48
49### Local Blocks
50
51It is also possible to define blocks locally in a `.continue` folder. This folder can be located at either the root of your workspace (these will automatically be applied to all assistants when you are in that workspace) or in your home directory at `~/.continue` (these will automatically be applied globally).
52
53Place your YAML files in the following folders:
54
55Assistants:
56
57- `.continue/assistants` - for assistants
58
59Blocks:
60
61- `.continue/rules` - for rules
62- `.continue/models` - for models
63- `.continue/prompts` - for prompts
64- `.continue/context` - for context providers
65- `.continue/docs` - for docs
66- `.continue/data` - for data
67- `.continue/mcpServers` - for MCP Servers
68
69You can find many examples of each of these block types on the [Continue Explore Page](https://hub.continue.dev/explore/models)
70
71<Info>
72Local blocks utilizing mustache notation for secrets (`${{ secrets.SECRET_NAME }}`) can read secret values:
73
74- globally, from a `.env` located in the global `.continue` folder (`~/.continue/.env`)
75- per-workspace, from a `.env` file located at the root of the current workspace.
76
77</Info>
78
79### Inputs
80
81Blocks can be passed user inputs, including hub secrets and raw text values. To create a block that has an input, use mustache templating as follows:
82
83```yaml title="config.yaml"
84name: myprofile/custom-model
85models:
86 - name: My Favorite Model
87 provider: anthropic
88 apiKey: ${{ inputs.ANTHROPIC_API_KEY }}
89 defaultCompletionOptions:
90 temperature: ${{ inputs.TEMP }}
91```
92
93Which can then be imported like this:
94
95```yaml title="config.yaml"
96name: myprofile/custom-assistant
97models:
98 - uses: myprofile/custom-model
99 with:
100 ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }}
101 TEMP: 0.9
102```
103
104Note that hub secrets can be passed as inputs, using a similar mustache format: `secrets.SECRET_NAME`.
105
106### Overrides
107
108Block properties can be also be directly overriden using `override`. For example:
109
110```yaml title="config.yaml"
111name: myprofile/custom-assistant
112models:
113 - uses: myprofile/custom-model
114 with:
115 ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }}
116 TEMP: 0.9
117 override:
118 roles:
119 - chat
120```
121
122## Properties
123
124Below are details for each property that can be set in `config.yaml`.
125
126**All properties at all levels are optional unless explicitly marked as required.**
127
128The top-level properties in the `config.yaml` configuration file are:
129
130- [`name`](#name) (**required**)
131- [`version`](#version) (**required**)
132- [`schema`](#schema) (**required**)
133- [`models`](#models)
134- [`context`](#context)
135- [`rules`](#rules)
136- [`prompts`](#prompts)
137- [`docs`](#docs)
138- [`mcpServers`](#mcpservers)
139- [`data`](#data)
140
141---
142
143### `name`
144
145The `name` property specifies the name of your project or configuration.
146
147```yaml title="config.yaml"
148name: MyProject
149```
150
151---
152
153### `version`
154
155The `version` property specifies the version of your project or configuration.
156
157### `schema`
158
159The `schema` property specifies the schema version used for the `config.yaml`, e.g. `v1`
160
161---
162
163### `models`
164
165The `models` section defines the language models used in your configuration. Models are used for functionalities such as chat, editing, and summarizing.
166
167**Properties:**
168
169- `name` (**required**): A unique name to identify the model within your configuration.
170
171- `provider` (**required**): The provider of the model (e.g., `openai`, `ollama`).
172
173- `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`).
174
175- `apiBase`: Can be used to override the default API base that is specified per model
176
177- `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.
178
179- `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:
180
181 - `tool_use`: Enables function/tool calling support (required for Agent mode)
182 - `image_input`: Enables image upload and processing support
183
184 Continue automatically detects these capabilities for most models, but you can override this when using custom deployments or if autodetection isn't working correctly.
185
186- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.
187
188- `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`.
189
190- `chatOptions`: If the model includes role `chat`, these settings apply for Agent and Chat mode:
191
192 - `baseSystemMessage`: Can be used to override the default system prompt for **Chat** mode.
193 - `baseAgentSystemMessage`: Can be used to override the default system prompt for **Agent** mode.
194 - `basePlanSystemMessage`: Can be used to override the default system prompt for **Plan** mode.
195
196- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings:
197
198 - `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens.
199 - `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk.
200
201- `defaultCompletionOptions`: Default completion options for model settings.
202
203 - `contextLength`: Maximum context length of the model, typically in tokens.
204 - `maxTokens`: Maximum number of tokens to generate in a completion.
205 - `temperature`: Controls the randomness of the completion. Values range from `0.0` (deterministic) to `1.0` (random).
206 - `topP`: The cumulative probability for nucleus sampling.
207 - `topK`: Maximum number of tokens considered at each step.
208 - `stop`: An array of stop tokens that will terminate the completion.
209 - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ models.
210 - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models.
211
212- `requestOptions`: HTTP request options specific to the model.
213
214 - `timeout`: Timeout for each request to the language model.
215
216 - `verifySsl`: Whether to verify SSL certificates for requests.
217
218 - `caBundlePath`: Path to a custom CA bundle for HTTP requests.
219
220 - `proxy`: Proxy URL for HTTP requests.
221
222 - `headers`: Custom headers for HTTP requests.
223
224 - `extraBodyProperties`: Additional properties to merge with the HTTP request body.
225
226 - `noProxy`: List of hostnames that should bypass the specified proxy.
227
228 - `clientCertificate`: Client certificate for HTTP requests.
229 - `cert`: Path to the client certificate file.
230 - `key`: Path to the client certificate key file.
231 - `passphrase`: Optional passphrase for the client certificate key file.
232
233- `autocompleteOptions`: If the model includes role `autocomplete`, these settings apply for tab autocompletion:
234
235 - `disable`: If `true`, disables autocomplete for this model.
236 - `maxPromptTokens`: Maximum number of tokens for the autocomplete prompt.
237 - `debounceDelay`: Delay before triggering autocomplete in milliseconds.
238 - `modelTimeout`: Model timeout for autocomplete requests in milliseconds.
239 - `maxSuffixPercentage`: Maximum percentage of prompt allocated for suffix.
240 - `prefixPercentage`: Percentage of input allocated for prefix.
241 - `template`: Custom template for autocomplete using Mustache syntax. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables.
242 - `onlyMyCode`: Only includes code within the repository for context.
243 - `useCache`: If `true`, enables caching for completions.
244 - `useImports`: If `true`, includes imports in context.
245 - `useRecentlyEdited`: If `true`, includes recently edited files in context.
246 - `useRecentlyOpened`: If `true`, includes recently opened files in context.
247
248**Example:**
249
250```yaml title="config.yaml"
251models:
252 - name: GPT-4o
253 provider: openai
254 model: gpt-4o
255 roles:
256 - chat
257 - edit
258 - apply
259 defaultCompletionOptions:
260 temperature: 0.7
261 maxTokens: 1500
262 - name: Codestral
263 provider: mistral
264 model: codestral-latest
265 roles:
266 - autocomplete
267 autocompleteOptions:
268 debounceDelay: 250
269 maxPromptTokens: 1024
270 onlyMyCode: true
271 - name: My Model - OpenAI-Compatible
272 provider: openai
273 apiBase: http://my-endpoint/v1
274 model: my-custom-model
275 capabilities:
276 - tool_use
277 - image_input
278 roles:
279 - chat
280 - edit
281```
282
283---
284
285### `context`
286
287The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
288
289More information about usage/params for each context provider can be found [here](/customize/custom-providers)
290
291**Properties:**
292
293- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
294- `name`: Optional name for the provider
295- `params`: Optional parameters to configure the context provider's behavior.
296
297**Example:**
298
299```yaml title="config.yaml"
300context:
301 - provider: file
302 - provider: code
303 - provider: codebase
304 params:
305 nFinal: 10
306 - provider: docs
307 - provider: diff
308 - provider: http
309 name: Context Server 1
310 params:
311 url: "https://api.example.com/server1"
312 - provider: folder
313 - provider: terminal
314```
315
316---
317
318### `rules`
319
320List 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.
321
322Explicit rules can either be simple text or an object with the following properties:
323
324- `name` (**required**): A display name/title for the rule
325- `rule` (**required**): The text content of the rule
326- `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"]`).
327
328```yaml title="config.yaml"l
329rules:
330 - Always annotate Python functions with their parameter and return types
331 - name: TypeScript best practices
332 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
333 globs: "**/*.{ts,tsx}"
334 - name: TypeScript test patterns
335 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
336 globs:
337 - "src/**/*.test.ts"
338 - "tests/**/*.ts"
339 - uses: myprofile/my-mood-setter
340 with:
341 TONE: concise
342```
343
344---
345
346### `prompts`
347
348A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
349
350```yaml title="config.yaml"
351prompts:
352 - name: check
353 description: Check for mistakes in my code
354 prompt: |
355 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
356 - Syntax errors
357 - Logic errors
358 - Security vulnerabilities
359```
360
361---
362
363### `docs`
364
365List of documentation sites to index.
366
367**Properties:**
368
369- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
370- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
371- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
372- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
373
374**Example:**
375
376```yaml title="config.yaml"
377docs:
378 - name: Continue
379 startUrl: https://docs.continue.dev/intro
380 favicon: https://docs.continue.dev/favicon.ico
381```
382
383---
384
385### `mcpServers`
386
387The [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.
388
389**Properties:**
390
391- `name` (**required**): The name of the MCP server.
392- `command` (**required**): The command used to start the server.
393- `args`: An optional array of arguments for the command.
394- `env`: An optional map of environment variables for the server process.
395- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
396- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
397
398**Example:**
399
400```yaml title="config.yaml"
401mcpServers:
402 - name: My MCP Server
403 command: uvx
404 args:
405 - mcp-server-sqlite
406 - --db-path
407 - ./test.db
408 cwd: /Users/NAME/project
409 env:
410 NODE_ENV: production
411```
412
413### `data`
414
415Destinations to which [development data](/customize/deep-dives/development-data) will be sent.
416
417**Properties:**
418
419- `name` (**required**): The display name of the data destination
420- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
421 - an HTTP endpoint that will receive a POST request with a JSON blob
422 - a file URL to a directory in which events will be dumpted to `.jsonl` files
423- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
424- `events`: an array of event names to include. Defaults to all events if not specified.
425- `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`
426- `apiKey`: api key to be sent with request (Bearer header)
427- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
428
429**Example:**
430
431```yaml title="config.yaml"
432data:
433 - name: Local Data Bank
434 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
435 schema: 0.2.0
436 level: all
437 - name: My Private Company
438 destination: https://mycompany.com/ingest
439 schema: 0.2.0
440 level: noCode
441 events:
442 - autocomplete
443 - chatInteraction
444```
445
446---
447
448## Complete YAML Config Example
449
450Putting it all together, here's a complete example of a `config.yaml` configuration file:
451
452```yaml title="config.yaml"
453name: MyProject
454version: 0.0.1
455schema: v1
456models:
457 - uses: anthropic/claude-3.5-sonnet
458 with:
459 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
460 override:
461 defaultCompletionOptions:
462 temperature: 0.8
463 - name: GPT-4
464 provider: openai
465 model: gpt-4
466 roles:
467 - chat
468 - edit
469 defaultCompletionOptions:
470 temperature: 0.5
471 maxTokens: 2000
472 requestOptions:
473 headers:
474 Authorization: Bearer YOUR_OPENAI_API_KEY
475 - name: Ollama Starcoder
476 provider: ollama
477 model: starcoder
478 roles:
479 - autocomplete
480 autocompleteOptions:
481 debounceDelay: 350
482 maxPromptTokens: 1024
483 onlyMyCode: true
484 defaultCompletionOptions:
485 temperature: 0.3
486 stop:
487 - "\n"
488rules:
489 - Give concise responses
490 - Always assume TypeScript rather than JavaScript
491prompts:
492 - name: test
493 description: Unit test a function
494 prompt: |
495 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
496 The tests should cover all possible edge cases and should be as thorough as possible.
497 You should also include a description of each test case.
498 - uses: myprofile/my-favorite-prompt
499context:
500 - provider: diff
501 - provider: file
502 - provider: codebase
503 - provider: code
504 - provider: docs
505 params:
506 startUrl: https://docs.example.com/introduction
507 rootUrl: https://docs.example.com
508mcpServers:
509 - name: DevServer
510 command: npm
511 args:
512 - run
513 - dev
514 env:
515 PORT: "3000"
516data:
517 - name: My Private Company
518 destination: https://mycompany.com/ingest
519 schema: 0.2.0
520 level: noCode
521 events:
522 - autocomplete
523 - chatInteraction
524```
525
526## Using YAML anchors to avoid config duplication
527
528You 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:
529
530```yaml title="config.yaml"
531%YAML 1.1
532---
533name: MyProject
534version: 0.0.1
535schema: v1
536model_defaults: &model_defaults
537 provider: openai
538 apiKey: my-api-key
539 apiBase: https://api.example.com/llm
540models:
541 - name: mistral
542 <<: *model_defaults
543 model: mistral-7b-instruct
544 roles:
545 - chat
546 - edit
547 - name: qwen2.5-coder-7b-instruct
548 <<: *model_defaults
549 model: qwen2.5-coder-7b-instruct
550 roles:
551 - chat
552 - edit
553 - name: qwen2.5-coder-7b
554 <<: *model_defaults
555 model: qwen2.5-coder-7b
556 useLegacyCompletionsEndpoint: false
557 roles:
558 - autocomplete
559 autocompleteOptions:
560 debounceDelay: 350
561 maxPromptTokens: 1024
562 onlyMyCode: true
563```