Elffuss BraidHub

kikocis/continue public

87544dc1817f · 19.3 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+ 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/deep-dives/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: diff
317 - provider: http
318 name: Context Server 1
319 params:
320 url: "https://api.example.com/server1"
321 - provider: terminal
322```
323
324---
325
326### `rules`
327
328List 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.
329
330Explicit rules can either be simple text or an object with the following properties:
331
332- `name` (**required**): A display name/title for the rule
333- `rule` (**required**): The text content of the rule
334- `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"]`).
335
336```yaml title="config.yaml"l
337rules:
338 - Always annotate Python functions with their parameter and return types
339 - name: TypeScript best practices
340 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
341 globs: "**/*.{ts,tsx}"
342 - name: TypeScript test patterns
343 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
344 globs:
345 - "src/**/*.test.ts"
346 - "tests/**/*.ts"
347 - uses: myprofile/my-mood-setter
348 with:
349 TONE: concise
350```
351
352---
353
354### `prompts`
355
356A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
357
358```yaml title="config.yaml"
359prompts:
360 - name: check
361 description: Check for mistakes in my code
362 prompt: |
363 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
364 - Syntax errors
365 - Logic errors
366 - Security vulnerabilities
367```
368
369---
370
371### `docs`
372
373List of documentation sites to index.
374
375**Properties:**
376
377- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
378- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
379- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
380- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
381
382**Example:**
383
384```yaml title="config.yaml"
385docs:
386 - name: Continue
387 startUrl: https://docs.continue.dev/intro
388 favicon: https://docs.continue.dev/favicon.ico
389```
390
391---
392
393### `mcpServers`
394
395The [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.
396
397**Properties:**
398
399- `name` (**required**): The name of the MCP server.
400- `command` (**required**): The command used to start the server.
401- `args`: An optional array of arguments for the command.
402- `env`: An optional map of environment variables for the server process.
403- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
404- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
405
406**Example:**
407
408```yaml title="config.yaml"
409mcpServers:
410 - name: My MCP Server
411 command: uvx
412 args:
413 - mcp-server-sqlite
414 - --db-path
415 - ./test.db
416 cwd: /Users/NAME/project
417 env:
418 NODE_ENV: production
419```
420
421### `data`
422
423Destinations to which [development data](/customize/deep-dives/development-data) will be sent.
424
425**Properties:**
426
427- `name` (**required**): The display name of the data destination
428- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
429 - an HTTP endpoint that will receive a POST request with a JSON blob
430 - a file URL to a directory in which events will be dumpted to `.jsonl` files
431- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
432- `events`: an array of event names to include. Defaults to all events if not specified.
433- `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`
434- `apiKey`: api key to be sent with request (Bearer header)
435- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
436
437**Example:**
438
439```yaml title="config.yaml"
440data:
441 - name: Local Data Bank
442 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
443 schema: 0.2.0
444 level: all
445 - name: My Private Company
446 destination: https://mycompany.com/ingest
447 schema: 0.2.0
448 level: noCode
449 events:
450 - autocomplete
451 - chatInteraction
452```
453
454---
455
456## Complete YAML Config Example
457
458Putting it all together, here's a complete example of a `config.yaml` configuration file:
459
460```yaml title="config.yaml"
461name: MyProject
462version: 0.0.1
463schema: v1
464models:
465 - uses: anthropic/claude-3.5-sonnet
466 with:
467 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
468 override:
469 defaultCompletionOptions:
470 temperature: 0.8
471 - name: GPT-4
472 provider: openai
473 model: gpt-4
474 roles:
475 - chat
476 - edit
477 defaultCompletionOptions:
478 temperature: 0.5
479 maxTokens: 2000
480 requestOptions:
481 headers:
482 Authorization: Bearer YOUR_OPENAI_API_KEY
483 - name: Ollama Starcoder
484 provider: ollama
485 model: starcoder
486 roles:
487 - autocomplete
488 autocompleteOptions:
489 debounceDelay: 350
490 maxPromptTokens: 1024
491 onlyMyCode: true
492 defaultCompletionOptions:
493 temperature: 0.3
494 stop:
495 - "\n"
496rules:
497 - Give concise responses
498 - Always assume TypeScript rather than JavaScript
499prompts:
500 - name: test
501 description: Unit test a function
502 prompt: |
503 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
504 The tests should cover all possible edge cases and should be as thorough as possible.
505 You should also include a description of each test case.
506 - uses: myprofile/my-favorite-prompt
507context:
508 - provider: diff
509 - provider: file
510 - provider: code
511mcpServers:
512 - name: DevServer
513 command: npm
514 args:
515 - run
516 - dev
517 env:
518 PORT: "3000"
519data:
520 - name: My Private Company
521 destination: https://mycompany.com/ingest
522 schema: 0.2.0
523 level: noCode
524 events:
525 - autocomplete
526 - chatInteraction
527```
528
529## Using YAML anchors to avoid config duplication
530
531You 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:
532
533```yaml title="config.yaml"
534%YAML 1.1
535---
536name: MyProject
537version: 0.0.1
538schema: v1
539model_defaults: &model_defaults
540 provider: openai
541 apiKey: my-api-key
542 apiBase: https://api.example.com/llm
543models:
544 - name: mistral
545 <<: *model_defaults
546 model: mistral-7b-instruct
547 roles:
548 - chat
549 - edit
550 - name: qwen2.5-coder-7b-instruct
551 <<: *model_defaults
552 model: qwen2.5-coder-7b-instruct
553 roles:
554 - chat
555 - edit
556 - name: qwen2.5-coder-7b
557 <<: *model_defaults
558 model: qwen2.5-coder-7b
559 useLegacyCompletionsEndpoint: false
560 roles:
561 - autocomplete
562 autocompleteOptions:
563 debounceDelay: 350
564 maxPromptTokens: 1024
565 onlyMyCode: true
566```