Elffuss BraidHub

kikocis/continue public

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