Elffuss BraidHub

kikocis/continue public

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