Elffuss BraidHub

kikocis/continue public

99fe51849b68 · 17.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
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- `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
365config.yaml
366
367```yaml
368docs:
369 - name: Continue
370 startUrl: https://docs.continue.dev/intro
371 favicon: https://docs.continue.dev/favicon.ico
372```
373
374---
375
376### `mcpServers`
377
378The [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.
379
380**Properties:**
381
382- `name` (**required**): The name of the MCP server.
383- `command` (**required**): The command used to start the server.
384- `args`: An optional array of arguments for the command.
385- `env`: An optional map of environment variables for the server process.
386- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
387- `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
388
389**Example:**
390
391config.yaml
392
393```yaml
394mcpServers:
395 - name: My MCP Server
396 command: uvx
397 args:
398 - mcp-server-sqlite
399 - --db-path
400 - ./test.db
401 cwd: /Users/NAME/project
402 env:
403 NODE_ENV: production
404```
405
406### `data`
407
408Destinations to which [development data](/customize/overview#development-data) will be sent.
409
410**Properties:**
411
412- `name` (**required**): The display name of the data destination
413
414- `destination` (**required**): The destination/endpoint that will receive the data. Can be:
415
416 - an HTTP endpoint that will receive a POST request with a JSON blob
417 - a file URL to a directory in which events will be dumpted to `.jsonl` files
418
419- `schema` (**required**): the schema version of the JSON blobs to be sent. Options include `0.1.0` and `0.2.0`
420
421- `events`: an array of event names to include. Defaults to all events if not specified.
422
423- `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`
424
425- `apiKey`: api key to be sent with request (Bearer header)
426
427- `requestOptions`: Options for event POST requests. Same format as [model requestOptions](#models).
428
429 **Example:**
430
431config.yaml
432
433```yaml
434data:
435 - name: Local Data Bank
436 destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
437 schema: 0.2.0
438 level: all
439 - name: My Private Company
440 destination: https://mycompany.com/ingest
441 schema: 0.2.0
442 level: noCode
443 events:
444 - autocomplete
445 - chatInteraction
446```
447
448---
449
450## Complete YAML Config Example
451
452Putting it all together, here's a complete example of a `config.yaml` configuration file:
453
454config.yaml
455
456```yaml
457name: MyProject
458version: 0.0.1
459schema: v1
460models:
461 - uses: anthropic/claude-3.5-sonnet
462 with:
463 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
464 override:
465 defaultCompletionOptions:
466 temperature: 0.8
467 - name: GPT-4
468 provider: openai
469 model: gpt-4
470 roles:
471 - chat
472 - edit
473 defaultCompletionOptions:
474 temperature: 0.5
475 maxTokens: 2000
476 requestOptions:
477 headers:
478 Authorization: Bearer YOUR_OPENAI_API_KEY
479 - name: Ollama Starcoder
480 provider: ollama
481 model: starcoder
482 roles:
483 - autocomplete
484 defaultCompletionOptions:
485 temperature: 0.3
486 stop:
487 - "\n"
488rules:
489 - Give concise responses
490 - Always assume TypeScript rather than JavaScript
491prompts:
492 - name: test
493 description: Unit test a function
494 prompt: |
495 Please write a complete suite of unit tests for this function. You should use the Jest testing framework.
496 The tests should cover all possible edge cases and should be as thorough as possible.
497 You should also include a description of each test case.
498 - uses: myprofile/my-favorite-prompt
499context:
500 - provider: diff
501 - provider: file
502 - provider: codebase
503 - provider: code
504 - provider: docs
505 params:
506 startUrl: https://docs.example.com/introduction
507 rootUrl: https://docs.example.com
508mcpServers:
509 - name: DevServer
510 command: npm
511 args:
512 - run
513 - dev
514 env:
515 PORT: "3000"
516data:
517 - name: My Private Company
518 destination: https://mycompany.com/ingest
519 schema: 0.2.0
520 level: noCode
521 events:
522 - autocomplete
523 - chatInteraction
524```
525
526## Using YAML anchors to avoid config duplication
527
528You 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:
529
530config.yaml
531
532```yaml
533%YAML 1.1
534---
535name: MyProject
536version: 0.0.1
537schema: v1
538model_defaults: &model_defaults
539 provider: openai
540 apiKey: my-api-key
541 apiBase: https://api.example.com/llm
542models:
543 - name: mistral
544 <<: *model_defaults
545 model: mistral-7b-instruct
546 roles:
547 - chat
548 - edit
549 - name: qwen2.5-coder-7b-instruct
550 <<: *model_defaults
551 model: qwen2.5-coder-7b-instruct
552 roles:
553 - chat
554 - edit
555 - name: qwen2.5-coder-7b
556 <<: *model_defaults
557 model: qwen2.5-coder-7b
558 useLegacyCompletionsEndpoint: false
559 roles:
560 - autocomplete
561```