Elffuss BraidHub

kikocis/continue public

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