Elffuss BraidHub

kikocis/continue public

cd22093c507b · 17.6 KiBSourceRawPermalink

title: Config YAML Reference description: Reference for the Continue configuration YAML file keywords: [config, yaml, configuration, customize, customization]

config.yaml Reference

Introduction

Continue hub assistants are defined using the config.yaml specification. Assistants can be loaded from the Hub or locally

:::info Config YAML replaces config.json, which is deprecated. View the Migration Guide. :::

An assistant is made up of:

  1. Top level properties, which specify the name, version, and config.yaml schema for the assistant
  2. Block lists, which are composable arrays of coding assistant building blocks available to the assistant, such as models, docs, and context providers.

A 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.

Examples of blocks and assistants can be found on the Continue hub.

Assistants can either explicitly define blocks - see Properties below - or import and configure existing hub blocks.

Using Blocks

Hub 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, your slug would be openai/gpt-4o). These blocks are pulled from https://hub.continue.dev.

Blocks 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.

For example, the following assistant imports an Anthropic model and defines an Ollama DeepSeek one.

models:
  - uses: anthropic/claude-3.5-sonnet # an imported model block
  - model: deepseek-reasoner # an explicit model block
    provider: ollama

Local Blocks

It 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).

Place your YAML files in the following folders:

Assistants:

Blocks:

You can find many examples of each of these block types on the Continue Explore Page

:::info Local blocks utilizing mustache notation for secrets (${{ secrets.SECRET_NAME }}) can read secret values:

Inputs

Blocks 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:

name: myprofile/custom-model
models:
  - name: My Favorite Model
    provider: anthropic
    apiKey: ${{ inputs.ANTHROPIC_API_KEY }}
    defaultCompletionOptions:
      temperature: ${{ inputs.TEMP }}

Which can then be imported like

name: myprofile/custom-assistant
models:
  - uses: myprofile/custom-model
    with:
      ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }}
      TEMP: 0.9

Note that hub secrets can be passed as inputs, using a similar mustache format: secrets.SECRET_NAME.

Overrides

Block properties can be also be directly overriden using override. For example:

name: myprofile/custom-assistant
models:
  - uses: myprofile/custom-model
    with:
      ANTHROPIC_API_KEY: ${{ secrets.MY_ANTHROPIC_API_KEY }}
      TEMP: 0.9
    override:
      roles:
        - chat

Properties

Below are details for each property that can be set in config.yaml.

All properties at all levels are optional unless explicitly marked as required.

The top-level properties in the config.yaml configuration file are:


name

The name property specifies the name of your project or configuration.

name: MyProject

version

The version property specifies the version of your project or configuration.

schema

The schema property specifies the schema version used for the config.yaml, e.g. v1


models

The models section defines the language models used in your configuration. Models are used for functionalities such as chat, editing, and summarizing.

Properties:

Example

models:
  - name: GPT-4o
    provider: openai
    model: gpt-4o
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      temperature: 0.7
      maxTokens: 1500

  - name: Codestral
    provider: mistral
    model: codestral-latest
    roles:
      - autocomplete

  - name: My Model - OpenAI-Compatible
    provider: openai
    apiBase: http://my-endpoint/v1
    model: my-custom-model
    capabilities:
      - tool_use
      - image_input
    roles:
      - chat
      - edit

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.

More information about usage/params for each context provider can be found here

Properties:

Example:

context:
  - provider: file
  - provider: code
  - provider: codebase
    params:
      nFinal: 10
  - provider: docs
  - provider: diff
  - provider: http
    name: Context Server 1
    params:
      url: "https://api.example.com/server1"
  - provider: folder
  - provider: terminal

rules

List of rules that the LLM should follow. These are concatenated into the system message for all Chat, Edit, and Agent requests. See the rules deep dive for details.

Explicit rules can either be simple text or an object with the following properties:

rules:
  - Always annotate Python functions with their parameter and return types

  - name: TypeScript best practices
    rule: Always use TypeScript interfaces to define shape of objects. Use type aliases sparingly.
    globs: "**/*.{ts,tsx}"

  - name: TypeScript test patterns
    rule: In TypeScript tests, use Jest's describe/it pattern and follow best practices for mocking.
    globs:
      - "src/**/*.test.ts"
      - "tests/**/*.ts"

  - uses: myprofile/my-mood-setter
    with:
      TONE: concise

prompts

A list of custom prompts that can be invoked from the chat window. Each prompt has a name, description, and the actual prompt text.

prompts:
  - name: check
    description: Check for mistakes in my code
    prompt: |
      Please read the highlighted code and check for any mistakes. You should look for the following, and be extremely vigilant:
        - Syntax errors
        - Logic errors
        - Security vulnerabilities

docs

List of documentation sites to index.

Properties:

Example

docs:
  - name: Continue
    startUrl: https://docs.continue.dev/intro
    favicon: https://docs.continue.dev/favicon.ico

mcpServers

The Model Context Protocol is a standard proposed by Anthropic to unify prompts, context, and tool use. Continue supports any MCP server with the MCP context provider.

Properties:

Example:

mcpServers:
  - name: My MCP Server
    command: uvx
    args:
      - mcp-server-sqlite
      - --db-path
      - /Users/NAME/test.db

data

Destinations to which development data will be sent.

Properties:

data:
  - name: Local Data Bank
    destination: file:///Users/dallin/Documents/code/continuedev/continue-extras/external-data
    schema: 0.2.0
    level: all
  - name: My Private Company
    destination: https://mycompany.com/ingest
    schema: 0.2.0
    level: noCode
    events:
      - autocomplete
      - chatInteraction

Complete YAML Config Example

Putting it all together, here's a complete example of a config.yaml configuration file:

name: MyProject
version: 0.0.1
schema: v1

models:
  - uses: anthropic/claude-3.5-sonnet
    with:
      ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    override:
      defaultCompletionOptions:
        temperature: 0.8
  - name: GPT-4
    provider: openai
    model: gpt-4
    roles:
      - chat
      - edit
    defaultCompletionOptions:
      temperature: 0.5
      maxTokens: 2000
    requestOptions:
      headers:
        Authorization: Bearer YOUR_OPENAI_API_KEY

  - name: Ollama Starcoder
    provider: ollama
    model: starcoder
    roles:
      - autocomplete
    defaultCompletionOptions:
      temperature: 0.3
      stop:
        - "\n"

rules:
  - Give concise responses
  - Always assume TypeScript rather than JavaScript

prompts:
  - name: test
    description: Unit test a function
    prompt: |
      Please write a complete suite of unit tests for this function. You should use the Jest testing framework.  The tests should cover all possible edge cases and should be as thorough as possible.  You should also include a description of each test case.
  - uses: myprofile/my-favorite-prompt

context:
  - provider: diff
  - provider: file
  - provider: codebase
  - provider: code
  - provider: docs
    params:
      startUrl: https://docs.example.com/introduction
      rootUrl: https://docs.example.com
      maxDepth: 3

mcpServers:
  - name: DevServer
    command: npm
    args:
      - run
      - dev
    env:
      PORT: "3000"

data:
  - name: My Private Company
    destination: https://mycompany.com/ingest
    schema: 0.2.0
    level: noCode
    events:
      - autocomplete
      - chatInteraction

Using YAML anchors to avoid config duplication

You 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:

%YAML 1.1
---
name: MyProject
version: 0.0.1
schema: v1

model_defaults: &model_defaults
  provider: openai
  apiKey: my-api-key
  apiBase: https://api.example.com/llm

models:
  - name: mistral
    <<: *model_defaults
    model: mistral-7b-instruct
    roles:
      - chat
      - edit

  - name: qwen2.5-coder-7b-instruct
    <<: *model_defaults
    model: qwen2.5-coder-7b-instruct
    roles:
      - chat
      - edit

  - name: qwen2.5-coder-7b
    <<: *model_defaults
    model: qwen2.5-coder-7b
    env:
      useLegacyCompletionsEndpoint: false
    roles:
      - autocomplete