Elffuss BraidHub

kikocis/continue public

a765bb1061c8 · 17.9 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 - `tool_use`: Enables function/tool calling support (required for Agent mode)
180 - `image_input`: Enables image upload and processing support
181
182 Continue automatically detects these capabilities for most models, but you can override this when using custom deployments or if autodetection isn't working correctly.
183
184- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.
185
186- `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`.
187
188- `chatOptions`: If the model includes role `chat`, these settings apply for Agent and Chat mode:
189
190 - `baseSystemMessage`: Can be used to override the default system prompt for **Chat** mode.
191 - `baseAgentSystemMessage`: Can be used to override the default system prompt for **Agent** mode.
192 - `basePlanSystemMessage`: Can be used to override the default system prompt for **Plan** mode.
193
194- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings:
195
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
201 - `contextLength`: Maximum context length of the model, typically in tokens.
202 - `maxTokens`: Maximum number of tokens to generate in a completion.
203 - `temperature`: Controls the randomness of the completion. Values range from `0.0` (deterministic) to `1.0` (random).
204 - `topP`: The cumulative probability for nucleus sampling.
205 - `topK`: Maximum number of tokens considered at each step.
206 - `stop`: An array of stop tokens that will terminate the completion.
207 - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ models.
208 - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models.
209
210- `requestOptions`: HTTP request options specific to the model.
211
212 - `timeout`: Timeout for each request to the language model.
213
214 - `verifySsl`: Whether to verify SSL certificates for requests.
215
216 - `caBundlePath`: Path to a custom CA bundle for HTTP requests.
217
218 - `proxy`: Proxy URL for HTTP requests.
219
220 - `headers`: Custom headers for HTTP requests.
221
222 - `extraBodyProperties`: Additional properties to merge with the HTTP request body.
223
224 - `noProxy`: List of hostnames that should bypass the specified proxy.
225
226 - `clientCertificate`: Client certificate for HTTP requests.
227 - `cert`: Path to the client certificate file.
228 - `key`: Path to the client certificate key file.
229 - `passphrase`: Optional passphrase for the client certificate key file.
230
231**Example:**
232
233```yaml title="config.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`
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
278```yaml title="config.yaml"
279context:
280 - provider: file
281 - provider: code
282 - provider: codebase
283 params:
284 nFinal: 10
285 - provider: docs
286 - provider: diff
287 - provider: http
288 name: Context Server 1
289 params:
290 url: "https://api.example.com/server1"
291 - provider: folder
292 - provider: terminal
293```
294
295---
296
297### `rules`
298
299List 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.
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 can be either a single pattern (e.g., `"**/*.{ts,tsx}"`) or an array of patterns (e.g., `["src/**/*.ts", "tests/**/*.ts"]`).
306
307```yaml title="config.yaml"l
308rules:
309 - Always annotate Python functions with their parameter and return types
310 - name: TypeScript best practices
311 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
312 globs: "**/*.{ts,tsx}"
313 - name: TypeScript test patterns
314 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
315 globs:
316 - "src/**/*.test.ts"
317 - "tests/**/*.ts"
318 - uses: myprofile/my-mood-setter
319 with:
320 TONE: concise
321```
322
323---
324
325### `prompts`
326
327A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
328
329```yaml title="config.yaml"
330prompts:
331 - name: check
332 description: Check for mistakes in my code
333 prompt: |
334 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
335 - Syntax errors
336 - Logic errors
337 - Security vulnerabilities
338```
339
340---
341
342### `docs`
343
344List of documentation sites to index.
345
346**Properties:**
347
348- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
349- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
350- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
351- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
352
353**Example:**
354
355```yaml title="config.yaml"
356docs:
357 - name: Continue
358 startUrl: https://docs.continue.dev/intro
359 favicon: https://docs.continue.dev/favicon.ico
360```
361
362---
363
364### `mcpServers`
365
366The [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.
367
368**Properties:**
369
370- `name` (**required**): The name of the MCP server.
371- `command` (**required**): The command used to start the server.
372- `args`: An optional array of arguments for the command.
373- `env`: An optional map of environment variables for the server process.
374- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
375- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
376
377**Example:**
378
379```yaml title="config.yaml"
380mcpServers:
381 - name: My MCP Server
382 command: uvx
383 args:
384 - mcp-server-sqlite
385 - --db-path
386 - ./test.db
387 cwd: /Users/NAME/project
388 env:
389 NODE_ENV: production
390```
391
392### `data`
393
394Destinations to which [development data](/customize/overview#development-data) will be sent.
395
396**Properties:**
397
398- `name` (**required**): The display name of the data destination
399- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
400 - an HTTP endpoint that will receive a POST request with a JSON blob
401 - a file URL to a directory in which events will be dumpted to `.jsonl` files
402- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
403- `events`: an array of event names to include. Defaults to all events if not specified.
404- `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`
405- `apiKey`: api key to be sent with request (Bearer header)
406- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
407
408**Example:**
409
410```yaml title="config.yaml"
411data:
412 - name: Local Data Bank
413 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
414 schema: 0.2.0
415 level: all
416 - name: My Private Company
417 destination: https://mycompany.com/ingest
418 schema: 0.2.0
419 level: noCode
420 events:
421 - autocomplete
422 - chatInteraction
423```
424
425---
426
427## Complete YAML Config Example
428
429Putting it all together, here's a complete example of a `config.yaml` configuration file:
430
431```yaml title="config.yaml"
432name: MyProject
433version: 0.0.1
434schema: v1
435models:
436 - uses: anthropic/claude-3.5-sonnet
437 with:
438 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
439 override:
440 defaultCompletionOptions:
441 temperature: 0.8
442 - name: GPT-4
443 provider: openai
444 model: gpt-4
445 roles:
446 - chat
447 - edit
448 defaultCompletionOptions:
449 temperature: 0.5
450 maxTokens: 2000
451 requestOptions:
452 headers:
453 Authorization: Bearer YOUR_OPENAI_API_KEY
454 - name: Ollama Starcoder
455 provider: ollama
456 model: starcoder
457 roles:
458 - autocomplete
459 defaultCompletionOptions:
460 temperature: 0.3
461 stop:
462 - "\n"
463rules:
464 - Give concise responses
465 - Always assume TypeScript rather than JavaScript
466prompts:
467 - name: test
468 description: Unit test a function
469 prompt: |
470 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
471 The tests should cover all possible edge cases and should be as thorough as possible.
472 You should also include a description of each test case.
473 - uses: myprofile/my-favorite-prompt
474context:
475 - provider: diff
476 - provider: file
477 - provider: codebase
478 - provider: code
479 - provider: docs
480 params:
481 startUrl: https://docs.example.com/introduction
482 rootUrl: https://docs.example.com
483mcpServers:
484 - name: DevServer
485 command: npm
486 args:
487 - run
488 - dev
489 env:
490 PORT: "3000"
491data:
492 - name: My Private Company
493 destination: https://mycompany.com/ingest
494 schema: 0.2.0
495 level: noCode
496 events:
497 - autocomplete
498 - chatInteraction
499```
500
501## Using YAML anchors to avoid config duplication
502
503You 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:
504
505```yaml title="config.yaml"
506%YAML 1.1
507---
508name: MyProject
509version: 0.0.1
510schema: v1
511model_defaults: &model_defaults
512 provider: openai
513 apiKey: my-api-key
514 apiBase: https://api.example.com/llm
515models:
516 - name: mistral
517 <<: *model_defaults
518 model: mistral-7b-instruct
519 roles:
520 - chat
521 - edit
522 - name: qwen2.5-coder-7b-instruct
523 <<: *model_defaults
524 model: qwen2.5-coder-7b-instruct
525 roles:
526 - chat
527 - edit
528 - name: qwen2.5-coder-7b
529 <<: *model_defaults
530 model: qwen2.5-coder-7b
531 useLegacyCompletionsEndpoint: false
532 roles:
533 - autocomplete
534```