yaml reference cleanup and migration guide

This commit is contained in:
Dallin Romney 2025-01-08 13:44:38 +01:00
parent b16ea5c32c
commit e2df57d939
5 changed files with 389 additions and 387 deletions

View file

@ -421,6 +421,7 @@ Several experimental config parameters are available, as described below:
- `optimize`: Prompt for optimizing code.
- `fixGrammar`: Prompt for fixing grammar or spelling.
- `useChromiumForDocsCrawling`: Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`..
- `modelContextProtocolServers`: See [Model Context Protocol](/customize/context-providers#model-context-protocol)
Example
@ -442,7 +443,16 @@ Example
"fixGrammar": "Fix grammar in the above but allow for typos."
},
"readResponseTTS": false,
"useChromiumForDocsCrawling": true
"useChromiumForDocsCrawling": true,
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"]
}
}
]
}
}
```

264
docs/docs/yaml-migration.md Normal file
View file

@ -0,0 +1,264 @@
---
title: Config Migration to YAML
description: Reference for migrating from JSON to YAML Continue configuration.
keywords: [config, yaml, configuration, customize, customization, migration]
---
# Migrating Config to YAML
Continue's YAML configuration format provides more readable, maintainable, consistent configuration files, as well as new configuration options and removal of some old configuration options. YAML is the preferred format and will be used to integrate with future Continue products. Below is a brief guide for migration from `config.json` to `config.yaml`.
See also
- [Intro to YAML](https://yaml.org/)
- [JSON Continue Config Reference](/reference)
- [YAML Continue Config Reference](/yaml-reference)
### 1. Create YAML file
Create a `config.yaml` file in your Continue Global Directory (`~/.continue` on Mac, `%USERPROFILE%\.continue`) alongside your current `config.json` file. If a `config.yaml` file is present, it will be loaded instead of `config.json`.
Give your configuration a name using the `name` field:
```yaml title="config.yaml"
name: my-configuration
```
### 2. Map Models
Add all model configurations in `config.json`, including models in `models`, `tabAutocompleteModel`, `embeddingsProvider`, and `reranker`, to the `models` section of your new YAML config file. A new `roles` YAML field specifies which roles a model can be used for, with possible values `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`.
- `models` in config should have `roles: chat`
- `tabAutocompleteModel`(s) in config should have `roles: autocomplete`
- `embeddingsProvider` in config should have `roles: embed`
- `reranker` in config should have `roles: rerank`
- `experimental.modelRoles` is replaced by simply adding roles to the model
- `inlineEdit` -> e.g. `roles: [chat, edit]`
- `applyCodeBlock` -> e.g. `roles: [chat, apply]`
Model-level `requestOptions` remain, with minor changes. See [YAML Continue Config Reference](/yaml-reference#requestoptions)
Model-level `completionOptions` are replaced by `defaultCompletionOptions`, with minor changes. See [YAML Continue Config Reference](/yaml-reference#completionoptions)
<!-- TODO - API KEY -> apiKeySecret? -->
<!-- TODO - ollama autodetect supported? -->
**Before**
```json title="config.json"
{
"models": [
{
"title": "GPT-4",
"provider": "openai",
"model": "gpt-4",
"apiKey": "YOUR_API_KEY",
"completionOptions": {
"temperature": 0.5,
"maxTokens": 2000
}
},
{
"title": "Ollama",
"provider": "ollama",
"model": "AUTODETECT"
},
{
"title": "My Open AI Compatible Model",
"provider": "openai",
"apiBase": "http://3.3.3.3/v1",
"model": "my-openai-compatible-model",
"requestOptions": {
"headers": { "X-Auth-Token": "<API_KEY>" }
}
}
],
"tabAutocompleteModel": {
"title": "My Starcoder",
"provider": "ollama",
"model": "starcoder2:3b"
},
"embeddingsProvider": {
"provider": "openai",
"model": "text-embedding-ada-002",
"apiKey": "<API_KEY>",
"maxChunkSize": 256,
"maxBatchSize": 5
},
"reranker": {
"name": "voyage",
"params": {
"model": "rerank-2",
"apiKey": "<VOYAGE_API_KEY>"
}
}
}
```
**After**
```yaml title="config.yaml"
models:
- name: GPT-4
provider: openai
model: gpt-4
defaultCompletionOptions:
temperature: 0.5
maxTokens: 2000'
roles: [chat, edit]
apiKey: <API_KEY>
- name: My Voyage Reranker
provider: voyage
roles: rerank
apiKey: <API_KEY>
- name: My Starcoder
provider: ollama
model: starcoder2:3b
roles: autocomplete
- name: My Ada Embedder
provider: openai
roles: embed
apiKey: <API_KEY>
- name: Ollama Autodetect
provider: ollama
model: AUTODETECT
- name: My Open AI Compatible Model - Apply
provider: openai
apiBase: http://3.3.3.3/v1
model: my-openai-compatible-model
requestOptions:
headers:
X-Auth-Token: <API_KEY>
roles: [chat, apply]
```
Note that the `repoMapFileSelection` experimental model role has been deprecated.
### 3. Map Context Providers
The JSON `contextProviders` and `docs` fields are replaced by the YAML `context` array.
- JSON `name` maps to `uses`
- JSON `params` map to `with`
- Use multiple `docs` entries rather than the array of docs in the JSON format
<!-- TODO is this docs not correct ?^ -->
**Before**
```json title="config.json"
{
"contextProviders": [
{
"name": "docs",
"params": {
"startUrl": "https://docs.continue.dev/intro"
}
},
{
"name": "codebase",
"params": {
"nRetrieve": 30,
"nFinal": 3
}
},
{
"name": "diff",
"params": {}
}
],
"docs": [
{
"startUrl": "https://docs.nestjs.com/",
"title": "nest.js"
},
{
"startUrl": "https://mysite.com/docs/",
"title": "My site"
}
]
}
```
**After**
```yaml title="config.yaml"
context:
- uses: docs
with:
startUrl: https://docs.nestjs.com/
title: nest.js
- uses: docs
with:
startUrl: https://mysite.com/docs/
title: My Site
- uses: codebase
with:
nRetrieve: 30
nFinal: 3
- uses: diff
```
## Map MCP Servers
<!-- TODO this is definitely wrong -->
**Properties:**
- `name` (**required**): The name of the MCP server.
- `command` (**required**): The command used to start the server.
- `args`: An optional array of arguments for the command.
- `env`: An optional map of environment variables for the server process.
**Before**
```json title="config.json"
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"]
}
}
]
}
}
```
**After**
```yaml title="config.yaml"
mcpServers:
- name: My MCP Server
command: uvx
args:
- mcp-server-sqlite
- --db-path
- /Users/NAME/test.db
```
---
## Deprecated configuration options
The following top-level fields from `config.json` have been deprecated
- Slash commands (JSON `slashCommands`)
- top-level `requestOptions`
- top-level `completionOptions`
- `tabAutocompleteOptions`
- `analytics`
- `customCommands`
- `disableSessionTitles`
- `experimental`
- `allowAnonymousTelemetry` (moved to user/IDE level)
- `ui` (moved to user/IDE level)
- `userToken`
- `systemMessage`
- `disableIndexing` (moved to user/IDE level)
## New Configuration options
The YAML configuration format offers new configuration options not available in the JSON format. See the [YAML Config Reference](/yaml-reference) for more information.

View file

@ -1,24 +1,32 @@
---
title: Config YAML Reference
description: Reference for the Continue configuration YAML file (v2)
keywords: [config, yaml]
description: Reference for the Continue configuration YAML file
keywords: [config, yaml, configuration, customize, customization]
---
# Config YAML Reference (v2)
# Config YAML Reference
Below are details for each property that can be set in `continue.yaml`. This reference corresponds to the updated and simplified schemas for version 2 of the configuration file format.
<!-- TODO - data and packages sections -->
Continue can be configured using a YAML file `config.yaml` which for local configuration can be placed in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`)
Below are details for each property that can be set in `config.yaml`.
:::info
Config YAML does not work alongside `config.json` - it replaces it. View the **[Migration Guide](/yaml-migration)**
:::
**All properties at all levels are optional unless explicitly marked as required.**
## Top-Level Properties
## Properties
The top-level properties in the `continue.yaml` configuration file are:
The top-level properties in the `config.yaml` configuration file are:
- [`name`](#name) (**required**)
- [`packages`](#packages)
<!-- - [`packages`](#packages) -->
- [`models`](#models)
- [`context`](#context)
- [`data`](#data)
<!-- - [`data`](#data) -->
- [`tools`](#tools)
- [`mcpServers`](#mcpservers)
@ -28,241 +36,53 @@ The top-level properties in the `continue.yaml` configuration file are:
The `name` property specifies the name of your project or configuration.
```yaml
# continue.yaml
```yaml title="config.yaml"
name: MyProject
```
---
<!--
### `packages`
The `packages` section specifies the packages used in your configuration. Each package can include configuration options.
**Properties:**
- `uses` (**required**): The identifier or path of the package to use.
- `with`: Optional configuration options for the package.
**Example:**
```yaml
# continue.yaml
packages:
- uses: continue/llm-package
with:
model: gpt-4
```
--- -->
### `models`
The `models` section defines the language models used in your configuration. Each model can have specific roles and options.
The `models` section defines the language models used in your configuration. Models are used for functionalities such as chat, editing, and summarizing.
**Properties:**
- `name` (**required**): A unique name to identify the model within your configuration.
- `provider` (**required**): The provider of the model (e.g., `openai`, `ollama`).
- `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`).
- `roles`: An array specifying the roles this model can fulfill. Possible roles are `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`.
- `defaultCompletionOptions`: Default completion options for the model. See [`defaultCompletionOptions`](#defaultcompletionoptions) for more details.
- `requestOptions`: HTTP request options specific to the model. See [`requestOptions`](#requestoptions) for more details.
- `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`.
- `defaultCompletionOptions`: Default completion options for model settings.
#### `defaultCompletionOptions`
**Properties:**
Parameters that control the behavior of text generation and completion settings.
**Properties:**
- `contextLength`: Maximum context length of the model, typically in tokens.
- `maxTokens`: The maximum number of tokens to generate in a completion (default: `2048`).
- `temperature`: Controls the randomness of the completion. Higher values result in more diverse outputs.
- `topP`: The cumulative probability for nucleus sampling. Lower values limit responses to tokens within the top probability mass.
- `topK`: The maximum number of tokens considered at each step. Limits the generated text to tokens within this probability.
- `stop`: An array of stop tokens that, when encountered, will terminate the completion.
- `n`: Generates `n` completions.
#### `requestOptions`
Default HTTP request options that apply to the model.
**Properties:**
- `timeout`: Timeout for each request to the language model (default: `7200` seconds).
- `verifySsl`: Whether to verify SSL certificates for requests.
- `caBundlePath`: Path to a custom CA bundle for HTTP requests (path to `.pem` file or an array of paths).
- `proxy`: Proxy URL to use for HTTP requests.
- `headers`: Custom headers for HTTP requests.
- `extraBodyProperties`: Additional properties to merge with the HTTP request body.
- `noProxy`: List of hostnames that should bypass the specified proxy.
- `clientCertificate`: Client certificate for HTTP requests.
- `cert`: Path to the client certificate file.
- `key`: Path to the client certificate key file.
- `passphrase`: Optional passphrase for the client certificate key file.
#### Example:
```yaml
# continue.yaml
models:
- name: GPT-4
provider: openai
model: gpt-4
roles:
- chat
- edit
defaultCompletionOptions:
temperature: 0.5
maxTokens: 2000
requestOptions:
headers:
Authorization: Bearer YOUR_API_KEY
- name: Ollama Starcoder
provider: ollama
model: starcoder
roles:
- autocomplete
defaultCompletionOptions:
temperature: 0.3
stop:
- "\n"
```
---
### `context`
The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
**Properties:**
- `uses` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`).
- `with`: Optional parameters to configure the context provider's behavior.
**Example:**
```yaml
# continue.yaml
context:
- uses: code
with:
includePaths:
- src/
- lib/
excludePaths:
- tests/
- uses: docs
with:
startUrl: https://docs.continue.dev/intro
rootUrl: https://docs.continue.dev
maxDepth: 3
```
---
### `data`
The `data` section specifies data providers used in your configuration. Data providers supply data or resources for use in various operations.
**Properties:**
- `provider` (**required**): The name of the data provider.
**Example:**
```yaml
# continue.yaml
data:
- provider: embeddings
```
---
### `tools`
The `tools` section specifies external tools or APIs that can be used within your configuration.
**Properties:**
- `url` (**required**): The URL of the tool's API or endpoint.
- `apiKey`: An optional API key required by the tool.
**Example:**
```yaml
# continue.yaml
tools:
- url: https://api.exampletool.com
apiKey: YOUR_API_KEY
```
---
### `mcpServers`
The `mcpServers` section defines Multi-Client Process (MCP) servers used in your configuration. MCP servers can run background processes or services.
**Properties:**
- `name` (**required**): The name of the MCP server.
- `command` (**required**): The command used to start the server.
- `args`: An optional array of arguments for the command.
- `env`: An optional map of environment variables for the server process.
**Example:**
```yaml
# continue.yaml
mcpServers:
- name: DevelopmentServer
command: npm
args:
- run
- dev
env:
PORT: "3000"
```
---
## In-Depth Property Descriptions
Below are detailed descriptions of key properties, reusing definitions from version 1 where applicable.
### `models`
Your language models are defined in the `models` section. Models are used for various functionalities such as chat, editing, and actions.
#### **Properties:**
- `name` (**required**): A unique name to identify the model within your configuration.
- `provider` (**required**): The provider of the model, which determines the type and interaction method. Options include `openai`, `ollama`, etc.
- `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`).
- `roles`: An array specifying the roles this model can fulfill. Possible roles are:
- `chat`: Used for chat interactions.
- `autocomplete`: Used for tab autocompletion.
- `embed`: Used for generating embeddings.
- `rerank`: Used for reranking responses.
- `edit`: Used for code or text editing tasks.
- `apply`: Used for applying code changes.
- `summarize`: Used for summarizing content.
- `defaultCompletionOptions`: Default completion options for the model.
For properties and examples, see the [Default Completion Options](#defaultcompletionoptions) section.
- `contextLength`: Maximum context length of the model, typically in tokens.
- `maxTokens`: Maximum number of tokens to generate in a completion.
- `temperature`: Controls the randomness of the completion. Values range from `0.0` (deterministic) to `1.0` (random).
- `topP`: The cumulative probability for nucleus sampling.
- `topK`: Maximum number of tokens considered at each step.
- `stop`: An array of stop tokens that will terminate the completion.
- `n`: Number of completions to generate.
- `requestOptions`: HTTP request options specific to the model.
For properties and examples, see the [Request Options](#requestoptions) section.
**Properties:**
#### **Example:**
- `timeout`: Timeout for each request to the language model.
- `verifySsl`: Whether to verify SSL certificates for requests.
- `caBundlePath`: Path to a custom CA bundle for HTTP requests.
- `proxy`: Proxy URL for HTTP requests.
- `headers`: Custom headers for HTTP requests.
- `extraBodyProperties`: Additional properties to merge with the HTTP request body.
- `noProxy`: List of hostnames that should bypass the specified proxy.
- `clientCertificate`: Client certificate for HTTP requests.
- `cert`: Path to the client certificate file.
- `key`: Path to the client certificate key file.
- `passphrase`: Optional passphrase for the client certificate key file.
```yaml
# continue.yaml
#### Example:
```yaml title="config.yaml"
models:
- name: GPT-3.5 Turbo
provider: openai
@ -288,125 +108,22 @@ models:
---
### `defaultCompletionOptions`
Parameters that control the behavior of text generation and completion settings for models.
**Properties:**
- `contextLength`: Maximum context length of the model, typically in tokens.
- `maxTokens`: The maximum number of tokens to generate in a completion (default: `2048`).
- `temperature`: Controls the randomness of the completion. Higher values result in more diverse outputs.
- **Range:** `0.0` (deterministic) to `1.0` (more random)
- **Default:** `0.7`
- `topP`: The cumulative probability for nucleus sampling. Tokens are considered from the top until the cumulative probability exceeds this value.
- **Range:** `0.0` to `1.0`
- **Default:** `1.0`
- `topK`: The maximum number of tokens considered at each step.
- **Default:** model-specific
- `stop`: An array of stop tokens that, when encountered, will terminate the completion.
- `n`: Number of completions to generate.
#### **Example:**
```yaml
# continue.yaml
models:
- name: GPT-3.5 Turbo
provider: openai
model: gpt-3.5-turbo
defaultCompletionOptions:
temperature: 0.7
maxTokens: 1500
topP: 0.95
stop:
- "\n\n"
n: 1
```
---
### `requestOptions`
Default HTTP request options that apply to models and context providers.
**Properties:**
- `timeout`: Timeout in seconds for each request to the language model (default: `7200` seconds).
- `verifySsl`: Whether to verify SSL certificates for requests.
- **Default:** `true`
- `caBundlePath`: Path to a custom CA bundle for HTTP requests. Can be a string or an array of paths.
- `proxy`: Proxy URL to use for HTTP requests.
- `headers`: Custom headers for HTTP requests.
- **Example:**
```yaml
headers:
X-Custom-Header: "CustomValue"
```
- `extraBodyProperties`: Additional properties to merge with the HTTP request body.
- `noProxy`: List of hostnames that should bypass the specified proxy.
- `clientCertificate`: Client certificate for HTTP requests.
- **Properties:**
- `cert`: Path to the client certificate file.
- `key`: Path to the client certificate key file.
- `passphrase`: Optional passphrase for the client certificate key file.
#### **Example:**
```yaml
# continue.yaml
models:
- name: SecureModel
provider: secureapi
model: secure-model-v1
requestOptions:
timeout: 5000
verifySsl: true
caBundlePath: /path/to/ca_bundle.pem
proxy: http://proxy.example.com:8080
headers:
Authorization: Bearer YOUR_SECURE_API_KEY
clientCertificate:
cert: /path/to/client_cert.pem
key: /path/to/client_key.pem
passphrase: your_passphrase
```
---
### `context`
Your context providers are defined in the `context` section. They supply additional information or context to the language models.
The `context` section defines context providers, which supply additional information or context to the language models. Each context provider can be configured with specific parameters.
#### **Properties:**
More information about usage/params for each context provider can be found [here](/customize/context-providers)
- `uses` (**required**): The name of the context provider, e.g., `code`, `docs`, `web`.
- `with`: An optional map of parameters to configure the context provider's behavior.
**Properties:**
#### **Example:**
- `uses` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`).
- `with`: Optional parameters to configure the context provider's behavior.
```yaml
# continue.yaml
**Example:**
```yaml title="config.yaml"
context:
- uses: code
with:
includePaths:
- src/
- lib/
excludePaths:
- test/
- uses: diff
- uses: docs
with:
startUrl: https://docs.example.com/start
@ -416,38 +133,79 @@ context:
---
### `data`
### `tools`
Defines data providers used in your configuration.
<!-- TODO how does this actually work -->
The `tools` section specifies external tools or APIs that can be used within your configuration.
**Properties:**
- `url` (**required**): The URL of the tool's API or endpoint.
- `apiKey`: An optional API key required by the tool.
**Example:**
```yaml title="config.yaml"
tools:
- url: https://api.exampletool.com/tool1
apiKey: YOUR_API_KEY
```
---
### `mcpServers`
<!-- TODO is this correct? -->
The [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.
**Properties:**
- `name` (**required**): The name of the MCP server.
- `command` (**required**): The command used to start the server.
- `args`: An optional array of arguments for the command.
- `env`: An optional map of environment variables for the server process.
**Example:**
```yaml title="config.yaml"
mcpServers:
- name: DevelopmentServer
command: npm
args:
- run
- dev
env:
PORT: "3000"
```
<!-- ### `data`
The `data` section specifies data providers used in your configuration. Data providers supply data or resources for use in various operations.
**Properties:**
- `provider` (**required**): The name of the data provider.
#### **Example:**
**Example:**
```yaml
# continue.yaml
```yaml title="config.yaml"
data:
- provider: embeddings
- provider: other-data-source
```
--- -->
---
## Complete Configuration Example
## Complete YAML Config Example
Putting it all together, here's a complete example of a `continue.yaml` configuration file:
Putting it all together, here's a complete example of a `config.yaml` configuration file:
```yaml
# continue.yaml
```yaml title="config.yaml"
name: MyProject
packages:
- uses: continue/llm-package
with:
model: gpt-4
models:
- name: GPT-4
provider: openai
@ -472,22 +230,13 @@ models:
- "\n"
context:
- uses: code
with:
includePaths:
- src/
- lib/
excludePaths:
- test/
- uses: diff
- uses: docs
with:
startUrl: https://docs.example.com/introduction
rootUrl: https://docs.example.com
maxDepth: 3
data:
- provider: embeddings
tools:
- url: https://api.exampletool.com
apiKey: YOUR_TOOL_API_KEY
@ -501,22 +250,3 @@ mcpServers:
env:
PORT: "3000"
```
---
## Notes
- **Property Naming Conventions:** In YAML, properties use lowercase letters and hyphens (`-`) to separate words (e.g., `max-tokens`). However, in this configuration, we use camelCase to match the schemas (e.g., `maxTokens`).
- **Required Properties:** Properties marked as **required** must be provided in your configuration.
- **Optional Properties:** All properties not marked as required are optional.
- **Extensibility:** The configuration format is designed to be extensible, allowing for future additions and custom configurations.
---
## Conclusion
This reference provides an overview of the configuration options available in the version 2 YAML configuration file format. By structuring your `continue.yaml` file according to this reference, you can customize your environment to suit your specific needs.
For more examples and advanced configurations, please refer to the official Continue documentation and GitHub repository.

View file

@ -107,13 +107,6 @@ const config = {
label: "Reference",
href: "/reference",
},
{
type: "docSidebar",
sidebarId: "customizingSidebar",
position: "left",
label: "YAML Reference",
href: "/yaml-reference",
},
{
to: "https://github.com/continuedev/continue",
label: "GitHub",

View file

@ -143,6 +143,11 @@ const sidebars = {
label: "YAML Reference",
href: "/yaml-reference",
},
{
type: "link",
label: "YAML Migration",
href: "/yaml-migration",
},
],
};