# Continue

Continue is an open-source AI coding assistant for VS Code and JetBrains. The Grid plugs in as a standard OpenAI-compatible provider through `config.yaml`. Continue's role-based model assignment (chat, edit, apply, autocomplete, summarize, subagent) maps cleanly onto Grid instrument tiers.

## Prerequisites

* Continue installed (VS Code extension or JetBrains plugin, latest version).
* A Grid account at [app.thegrid.ai](https://app.thegrid.ai).
* Credits in your account. The Grid is prepaid; zero credits returns 402.
* A Grid consumption API key from **Settings → API Keys → Create Consumption Key**.

## Setup

### 1. Store the key in Continue's local `.env`

Continue reads secrets from `~/.continue/.env` (or the directory set by `CONTINUE_GLOBAL_DIR`). Add:

```bash
THEGRID_API_KEY=your-consumption-api-key-here
```

No quotes, no `export`, no spaces around `=`.

### 2. Add Grid instruments to `config.yaml`

Open `~/.continue/config.yaml`. Continue creates this file the first time you open the side panel. Add Grid instruments under `models:`, each with the roles it's best suited for. Use instrument IDs from the [current instruments list](/docs/instrument-specifications/current-instruments.md):

```yaml
name: My Continue Config
version: 1.0.0
schema: v1

models:
  - name: Grid Code Prime
    provider: openai
    model: code-prime
    apiKey: ${{ secrets.THEGRID_API_KEY }}
    apiBase: https://api.thegrid.ai/v1
    roles:
      - chat
      - edit

  - name: Grid Code Standard
    provider: openai
    model: code-standard
    apiKey: ${{ secrets.THEGRID_API_KEY }}
    apiBase: https://api.thegrid.ai/v1
    roles:
      - apply
      - autocomplete

  - name: Grid Agent Prime
    provider: openai
    model: agent-prime
    apiKey: ${{ secrets.THEGRID_API_KEY }}
    apiBase: https://api.thegrid.ai/v1
    roles:
      - subagent

  - name: Grid Text Standard
    provider: openai
    model: text-standard
    apiKey: ${{ secrets.THEGRID_API_KEY }}
    apiBase: https://api.thegrid.ai/v1
    roles:
      - summarize
```

A few field-name details that catch people: `provider: openai` is Continue's generic OpenAI-compatible provider (there's no Grid-specific provider name). `apiBase` and `apiKey` are camelCase; `base_url` and `api_key` are silently ignored.

### 3. Add an embeddings provider

The Grid does not yet expose embedding instruments. Continue needs one for `@codebase` and `@folder` indexing. Pair The Grid with Voyage or a local Ollama embedding model:

```yaml
  - name: Voyage Embeddings
    provider: voyage
    model: voyage-code-3
    apiKey: ${{ secrets.VOYAGE_API_KEY }}
    roles:
      - embed
```

Chat and edit work without this; only codebase indexing degrades.

### 4. Reload Continue

Continue watches `config.yaml` and reloads on save. If a change does not stick, run **Developer: Reload Window** from the command palette.

## Verification

Open the Continue side panel, pick **Grid Code Prime** from the model dropdown, and try: "Refactor this function to use async/await instead of callbacks." Then test autocomplete by typing in a code file (`code-standard` should serve), and test inline edit with `Cmd/Ctrl+I`. If all three paths work, the integration is live.

## Troubleshooting

{% hint style="warning" %}
**401 or 402.** 401 means you used a Grid trading key (or the env var didn't resolve). Generate a fresh consumption key and update `~/.continue/.env`. 402 means your credits are at zero. Top up at [app.thegrid.ai](https://app.thegrid.ai).
{% endhint %}

{% hint style="warning" %}
**400 model not found.** The `model:` field must be a valid Grid instrument ID. See the [current instruments list](/docs/instrument-specifications/current-instruments.md). Typos like `text_prime` or `code-pro` fail.
{% endhint %}

{% hint style="info" %}
**Continue can't connect.** Check `provider: openai` (not `provider: thegrid`), `apiBase: https://api.thegrid.ai/v1` (camelCase, includes `/v1`), and that `~/.continue/.env` has `THEGRID_API_KEY=...` with no quotes.
{% endhint %}

{% hint style="info" %}
**Some roles work, others fail silently.** Every role you use must be in a model's `roles:` array. If `chat` works but `apply` fails, no model is mapped to `apply`. Add `code-standard` (or another instrument) under that role.
{% endhint %}

{% hint style="info" %}
**Embeddings or reranking on The Grid?** Not yet. Pair The Grid with Voyage (`voyage-code-3`) or Ollama (`nomic-embed-text`) for the `embed` and `rerank` roles.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thegrid.ai/docs/integrations-and-best-practices/integrations/continue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
