Elffuss BraidHub

kikocis/continue public

796feb88992e · 17.3 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
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
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
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`
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`
161
162The `version` property specifies the version of your project or configuration.
163
164### `schema`
165
166The `schema` property specifies the schema version used for the `config.yaml`, e.g. `v1`
167
168---
169
170### `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
194 - `baseSystemMessage`: Can be used to override the default system prompt for **Chat** mode.
195
196- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings:
197
198 - `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens.
199 - `maxBatchSize`: Maximum number of chunks per request. Minimum is 1 chunk.
200
201- `defaultCompletionOptions`: Default completion options for model settings.
202
203 - `contextLength`: Maximum context length of the model, typically in tokens.
204 - `maxTokens`: Maximum number of tokens to generate in a completion.
205 - `temperature`: Controls the randomness of the completion. Values range from `0.0` (deterministic) to `1.0` (random).
206 - `topP`: The cumulative probability for nucleus sampling.
207 - `topK`: Maximum number of tokens considered at each step.
208 - `stop`: An array of stop tokens that will terminate the completion.
209 - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ models.
210 - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models.
211
212- `requestOptions`: HTTP request options specific to the model.
213
214 - `timeout`: Timeout for each request to the language model.
215
216 - `verifySsl`: Whether to verify SSL certificates for requests.
217
218 - `caBundlePath`: Path to a custom CA bundle for HTTP requests.
219
220 - `proxy`: Proxy URL for HTTP requests.
221
222 - `headers`: Custom headers for HTTP requests.
223
224 - `extraBodyProperties`: Additional properties to merge with the HTTP request body.
225
226 - `noProxy`: List of hostnames that should bypass the specified proxy.
227
228 - `clientCertificate`: Client certificate for HTTP requests.
229 - `cert`: Path to the client certificate file.
230 - `key`: Path to the client certificate key file.
231 - `passphrase`: Optional passphrase for the client certificate key file.
232
233#### Example
234
235config.yaml
236
237```yaml
238models:
239 - name: GPT-4o
240 provider: openai
241 model: gpt-4o
242 roles:
243 - chat
244 - edit
245 - apply
246 defaultCompletionOptions:
247 temperature: 0.7
248 maxTokens: 1500
249 - name: Codestral
250 provider: mistral
251 model: codestral-latest
252 roles:
253 - autocomplete
254 - name: My Model - OpenAI-Compatible
255 provider: openai
256 apiBase: http://my-endpoint/v1
257 model: my-custom-model
258 capabilities:
259 - tool_use
260 - image_input
261 roles:
262 - chat
263 - edit
264```
265
266---
267
268### `context`
269
270The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
271
272More information about usage/params for each context provider can be found [here](/customize/custom-providers)
273
274**Properties:**
275
276- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
277- `name`: Optional name for the provider
278- `params`: Optional parameters to configure the context provider's behavior.
279
280**Example:**
281
282config.yaml
283
284```yaml
285context:
286 - provider: file
287 - provider: code
288 - provider: codebase
289 params:
290 nFinal: 10
291 - provider: docs
292 - provider: diff
293 - provider: http
294 name: Context Server 1
295 params:
296 url: "https://api.example.com/server1"
297 - provider: folder
298 - provider: terminal
299```
300
301---
302
303### `rules`
304
305List 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.
306
307Explicit rules can either be simple text or an object with the following properties:
308
309- `name` (**required**): A display name/title for the rule
310- `rule` (**required**): The text content of the rule
311- `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"]`).
312
313config.yaml
314
315```yaml
316rules:
317 - Always annotate Python functions with their parameter and return types
318 - name: TypeScript best practices
319 rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
320 globs: "**/*.{ts,tsx}"
321 - name: TypeScript test patterns
322 rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
323 globs:
324 - "src/**/*.test.ts"
325 - "tests/**/*.ts"
326 - uses: myprofile/my-mood-setter
327 with:
328 TONE: concise
329```
330
331---
332
333### `prompts`
334
335A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.
336
337config.yaml
338
339```yaml
340prompts:
341 - name: check
342 description: Check for mistakes in my code
343 prompt: |
344 Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
345 - Syntax errors
346 - Logic errors
347 - Security vulnerabilities
348```
349
350---
351
352### `docs`
353
354List of documentation sites to index.
355
356**Properties:**
357
358- `name` (**required**): Name of the documentation site, displayed in dropdowns, etc.
359- `startUrl` (**required**): Start page for crawling - usually root or intro page for docs
360
361- `maxDepth`: Maximum link depth for crawling. Default `4`
362- `favicon`: URL for site favicon (default is `/favicon.ico` from `startUrl`).
363- `useLocalCrawling`: Skip the default crawler and only crawl using a local crawler.
364
365Example
366
367config.yaml
368
369```yaml
370docs:
371 - name: Continue
372 startUrl: https://docs.continue.dev/intro
373 favicon: https://docs.continue.dev/favicon.ico
374```
375
376---
377
378### `mcpServers`
379
380The [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.
381
382**Properties:**
383
384- `name` (**required**): The name of the MCP server.
385- `command` (**required**): The command used to start the server.
386- `args`: An optional array of arguments for the command.
387- `env`: An optional map of environment variables for the server process.
388- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
389- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
390
391**Example:**
392
393config.yaml
394
395```yaml
396mcpServers:
397 - name: My MCP Server
398 command: uvx
399 args:
400 - mcp-server-sqlite
401 - --db-path
402 - ./test.db
403 cwd: /Users/NAME/project
404 env:
405 NODE_ENV: production
406```
407
408### `data`
409
410Destinations to which [development data](/customize/overview#development-data) will be sent.
411
412**Properties:**
413
414- `name` (**required**): The display name of the data destination
415
416- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
417
418 - an HTTP endpoint that will receive a POST request with a JSON blob
419 - a file URL to a directory in which events will be dumpted to `.jsonl` files
420
421- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
422
423- `events`: an array of event names to include. Defaults to all events if not specified.
424
425- `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`
426
427- `apiKey`: api key to be sent with request (Bearer header)
428
429- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
430
431 **Example:**
432
433config.yaml
434
435```yaml
436data:
437 - name: Local Data Bank
438 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
439 schema: 0.2.0
440 level: all
441 - name: My Private Company
442 destination: https://mycompany.com/ingest
443 schema: 0.2.0
444 level: noCode
445 events:
446 - autocomplete
447 - chatInteraction
448```
449
450---
451
452## Complete YAML Config Example
453
454Putting it all together, here's a complete example of a `config.yaml` configuration file:
455
456config.yaml
457
458```yaml
459name: MyProject
460version: 0.0.1
461schema: v1
462models:
463 - uses: anthropic/claude-3.5-sonnet
464 with:
465 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
466 override:
467 defaultCompletionOptions:
468 temperature: 0.8
469 - name: GPT-4
470 provider: openai
471 model: gpt-4
472 roles:
473 - chat
474 - edit
475 defaultCompletionOptions:
476 temperature: 0.5
477 maxTokens: 2000
478 requestOptions:
479 headers:
480 Authorization: Bearer YOUR_OPENAI_API_KEY
481 - name: Ollama Starcoder
482 provider: ollama
483 model: starcoder
484 roles:
485 - autocomplete
486 defaultCompletionOptions:
487 temperature: 0.3
488 stop:
489 - "\n"
490rules:
491 - Give concise responses
492 - Always assume TypeScript rather than JavaScript
493prompts:
494 - name: test
495 description: Unit test a function
496 prompt: |
497 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
498 The tests should cover all possible edge cases and should be as thorough as possible.
499 You should also include a description of each test case.
500 - uses: myprofile/my-favorite-prompt
501context:
502 - provider: diff
503 - provider: file
504 - provider: codebase
505 - provider: code
506 - provider: docs
507 params:
508 startUrl: https://docs.example.com/introduction
509 rootUrl: https://docs.example.com
510 maxDepth: 3
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
533config.yaml
534
535```yaml
536%YAML 1.1
537---
538name: MyProject
539version: 0.0.1
540schema: v1
541model_defaults: &model_defaults
542 provider: openai
543 apiKey: my-api-key
544 apiBase: https://api.example.com/llm
545models:
546 - name: mistral
547 <<: *model_defaults
548 model: mistral-7b-instruct
549 roles:
550 - chat
551 - edit
552 - name: qwen2.5-coder-7b-instruct
553 <<: *model_defaults
554 model: qwen2.5-coder-7b-instruct
555 roles:
556 - chat
557 - edit
558 - name: qwen2.5-coder-7b
559 <<: *model_defaults
560 model: qwen2.5-coder-7b
561 useLegacyCompletionsEndpoint: false
562 roles:
563 - autocomplete
564```