Elffuss BraidHub

kikocis/continue public

0cbdfa622ced · 19.6 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 reusable blocks and YAML configuration."
4---
5
6## Introduction
7
8Continue hub agents are defined using the `config.yaml` specification. Agents can be loaded from [the Hub](https://hub.continue.dev/explore/agents) or locally
9
10- [Continue Hub](https://hub.continue.dev/explore/agents) - 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/agents`. The name of the file will be used as the display name of the agent, e.g. `My Agent.yaml`
14 - in your workspace in a `/.continue/agents` 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 agent is made up of:
22
231. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the agent
242. **Block lists**, which are composable arrays of coding agent building blocks available to the agent, such as models, docs, and context providers.
25
26A block is a single standalone building block of a coding agents, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as agents (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is.
27
28Examples of blocks and agents can be found on the [Continue Hub](https://hub.continue.dev).
29
30Agents can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks.
31
32### Using Blocks
33
34Hub blocks and agents are identified with a slug in the format `owner-slug/block-or-agent-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 agent 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 agent imports an Anthropic model and defines an Ollama DeepSeek one.
39
40Agent 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 agents 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
59Agents:
60
61- `.continue/agents` - for agents
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-agent
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-agent
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+ and some Ollama 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 - `transform`: If `false`, disables trimming of multiline completions. Defaults to `true`. Useful for models that generate better multiline completions without transformations.
255 - `template`: Custom template for autocomplete using Mustache syntax. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables.
256 - `onlyMyCode`: Only includes code within the repository for context.
257 - `useCache`: If `true`, enables caching for completions.
258 - `useImports`: If `true`, includes imports in context.
259 - `useRecentlyEdited`: If `true`, includes recently edited files in context.
260 - `useRecentlyOpened`: If `true`, includes recently opened files in context.
261
262**Example:**
263
264```yaml title="config.yaml"
265models:
266 - name: GPT-4o
267 provider: openai
268 model: gpt-4o
269 roles:
270 - chat
271 - edit
272 - apply
273 defaultCompletionOptions:
274 temperature: 0.7
275 maxTokens: 1500
276 - name: Codestral
277 provider: mistral
278 model: codestral-latest
279 roles:
280 - autocomplete
281 autocompleteOptions:
282 debounceDelay: 250
283 maxPromptTokens: 1024
284 onlyMyCode: true
285 - name: My Model - OpenAI-Compatible
286 provider: openai
287 apiBase: http://my-endpoint/v1
288 model: my-custom-model
289 capabilities:
290 - tool_use
291 - image_input
292 roles:
293 - chat
294 - edit
295```
296
297---
298
299### `context`
300
301The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
302
303More information about usage/params for each context provider can be found [here](/customize/deep-dives/custom-providers)
304
305**Properties:**
306
307- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
308- `name`: Optional name for the provider
309- `params`: Optional parameters to configure the context provider's behavior.
310
311**Example:**
312
313```yaml title="config.yaml"
314context:
315 - provider: file
316 - provider: code
317 - provider: diff
318 - provider: http
319 name: Context Server 1
320 params:
321 url: "https://api.example.com/server1"
322 - provider: terminal
323```
324
325---
326
327### `rules`
328
329List 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.
330
331Explicit rules can either be simple text or an object with the following properties:
332
333- `name` (**required**): A display name/title for the rule
334- `rule` (**required**): The text content of the rule
335- `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"]`).
336
337```yaml title="config.yaml"l
338rules:
339 - Always annotate Python functions with their parameter and return types
340 - name: TypeScript best practices
341 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
342 globs: "**/*.{ts,tsx}"
343 - name: TypeScript test patterns
344 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
345 globs:
346 - "src/**/*.test.ts"
347 - "tests/**/*.ts"
348 - uses: myprofile/my-mood-setter
349 with:
350 TONE: concise
351```
352
353---
354
355### `prompts`
356
357A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
358
359```yaml title="config.yaml"
360prompts:
361 - name: check
362 description: Check for mistakes in my code
363 prompt: |
364 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
365 - Syntax errors
366 - Logic errors
367 - Security vulnerabilities
368```
369
370---
371
372### `docs`
373
374List of documentation sites to index.
375
376**Properties:**
377
378- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
379- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
380- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
381- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
382
383**Example:**
384
385```yaml title="config.yaml"
386docs:
387 - name: Continue
388 startUrl: https://docs.continue.dev/intro
389 favicon: https://docs.continue.dev/favicon.ico
390```
391
392---
393
394### `mcpServers`
395
396The [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.
397
398**Properties:**
399
400- `name` (**required**): The name of the MCP server.
401- `command` (**required**): The command used to start the server.
402- `args`: An optional array of arguments for the command.
403- `env`: An optional map of environment variables for the server process.
404- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
405- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
406- `requestOptions`: Optional request options for `sse` and `streamable-http` servers. Same format as [model requestOptions](#models).
407
408**Example:**
409
410```yaml title="config.yaml"
411mcpServers:
412 - name: My MCP Server
413 command: uvx
414 args:
415 - mcp-server-sqlite
416 - --db-path
417 - ./test.db
418 cwd: /Users/NAME/project
419 env:
420 NODE_ENV: production
421```
422
423### `data`
424
425Destinations to which [development data](/customize/deep-dives/development-data) will be sent.
426
427**Properties:**
428
429- `name` (**required**): The display name of the data destination
430- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
431 - an HTTP endpoint that will receive a POST request with a JSON blob
432 - a file URL to a directory in which events will be dumpted to `.jsonl` files
433- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
434- `events`: an array of event names to include. Defaults to all events if not specified.
435- `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`
436- `apiKey`: api key to be sent with request (Bearer header)
437- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
438
439**Example:**
440
441```yaml title="config.yaml"
442data:
443 - name: Local Data Bank
444 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
445 schema: 0.2.0
446 level: all
447 - name: My Private Company
448 destination: https://mycompany.com/ingest
449 schema: 0.2.0
450 level: noCode
451 events:
452 - autocomplete
453 - chatInteraction
454```
455
456---
457
458## Complete YAML Config Example
459
460Putting it all together, here's a complete example of a `config.yaml` configuration file:
461
462```yaml title="config.yaml"
463name: MyProject
464version: 0.0.1
465schema: v1
466models:
467 - uses: anthropic/claude-3.5-sonnet
468 with:
469 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
470 override:
471 defaultCompletionOptions:
472 temperature: 0.8
473 - name: GPT-4
474 provider: openai
475 model: gpt-4
476 roles:
477 - chat
478 - edit
479 defaultCompletionOptions:
480 temperature: 0.5
481 maxTokens: 2000
482 requestOptions:
483 headers:
484 Authorization: Bearer YOUR_OPENAI_API_KEY
485 - name: Ollama Starcoder
486 provider: ollama
487 model: starcoder
488 roles:
489 - autocomplete
490 autocompleteOptions:
491 debounceDelay: 350
492 maxPromptTokens: 1024
493 onlyMyCode: true
494 defaultCompletionOptions:
495 temperature: 0.3
496 stop:
497 - "\n"
498rules:
499 - Give concise responses
500 - Always assume TypeScript rather than JavaScript
501prompts:
502 - name: test
503 description: Unit test a function
504 prompt: |
505 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
506 The tests should cover all possible edge cases and should be as thorough as possible.
507 You should also include a description of each test case.
508 - uses: myprofile/my-favorite-prompt
509context:
510 - provider: diff
511 - provider: file
512 - provider: code
513mcpServers:
514 - name: DevServer
515 command: npm
516 args:
517 - run
518 - dev
519 env:
520 PORT: "3000"
521data:
522 - name: My Private Company
523 destination: https://mycompany.com/ingest
524 schema: 0.2.0
525 level: noCode
526 events:
527 - autocomplete
528 - chatInteraction
529```
530
531## Using YAML anchors to avoid config duplication
532
533You 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:
534
535```yaml title="config.yaml"
536%YAML 1.1
537---
538name: MyProject
539version: 0.0.1
540schema: v1
541model_defaults: &model_defaults
542 provider: openai
543 apiKey: my-api-key
544 apiBase: https://api.example.com/llm
545models:
546 - name: mistral
547 <<: *model_defaults
548 model: mistral-7b-instruct
549 roles:
550 - chat
551 - edit
552 - name: qwen2.5-coder-7b-instruct
553 <<: *model_defaults
554 model: qwen2.5-coder-7b-instruct
555 roles:
556 - chat
557 - edit
558 - name: qwen2.5-coder-7b
559 <<: *model_defaults
560 model: qwen2.5-coder-7b
561 useLegacyCompletionsEndpoint: false
562 roles:
563 - autocomplete
564 autocompleteOptions:
565 debounceDelay: 350
566 maxPromptTokens: 1024
567 onlyMyCode: true
568```