Elffuss BraidHub

kikocis/continue public

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