diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx index f5c2160daaf4..c85af3f9246b 100644 --- a/packages/web/src/content/docs/providers.mdx +++ b/packages/web/src/content/docs/providers.mdx @@ -1796,6 +1796,85 @@ OpenCode Zen is a list of tested and verified models provided by the OpenCode te --- +### QVAC + +You can configure opencode to use local models through [QVAC](https://qvac.com), an open-source runtime for local-first, peer-to-peer AI. QVAC exposes an OpenAI-compatible HTTP server via `qvac serve openai`, and the [`@qvac/ai-sdk-provider`](https://www.npmjs.com/package/@qvac/ai-sdk-provider) package wraps it as a branded provider. + +:::tip +Once QVAC lands in [models.dev](https://models.dev), it appears automatically in the `/connect` list — the manual config below is the explicit equivalent and is useful for pinning models and context limits. +::: + +First, install [`@qvac/cli`](https://www.npmjs.com/package/@qvac/cli) and start a server. Preload the model alias you reference in `opencode.json`; QVAC queues same-model completion requests, so opencode's background title, summary, and compaction calls can share the same local model instead of requiring a second model file. + +```json title="qvac.config.json" +{ + "serve": { + "models": { + "gpt-oss-20b": { + "model": "GPT_OSS_20B_INST_Q4_K_M", + "preload": true, + "config": { + "ctx_size": 32768 + } + } + } + } +} +``` + +```bash +npm i -g @qvac/cli +qvac serve openai +``` + +Then point opencode at it: + +```json title="opencode.json" "qvac" {5, 6, 8, 11-12, 18, 25-26} +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "qvac": { + "npm": "@qvac/ai-sdk-provider", + "name": "QVAC (local)", + "options": { + "baseURL": "http://127.0.0.1:11434/v1", + "apiKey": "qvac" + }, + "models": { + "gpt-oss-20b": { + "name": "GPT-OSS 20B (local)", + "limit": { + "context": 32768, + "output": 8192 + } + } + } + } + }, + "model": "qvac/gpt-oss-20b", + "small_model": "qvac/gpt-oss-20b" +} +``` + +In this example: + +- `qvac` is the custom provider ID. This can be any string you want. +- `npm` specifies the package to use for this provider — `@qvac/ai-sdk-provider`, the branded QVAC wrapper around `@ai-sdk/openai-compatible`. +- `options.baseURL` is the endpoint for your local `qvac serve` (set this to match your serve port). Note that `qvac serve openai` defaults to port `11434` — the same default as Ollama. If you run both, pass `--port` to one of them and update `baseURL` to match. +- `options.apiKey` can be any non-empty string — `qvac serve` does not validate it, but some clients refuse to send a request without an `Authorization` header. +- The model ID (`gpt-oss-20b`) must match the **serve alias** in `qvac.config.json` — that alias is what the provider sends as the OpenAI `model` field. +- `model` is the main chat model; `small_model` is the model opencode uses for titles, summarization, and compaction. Pointing both at the same QVAC alias is supported; if you want those utility calls to avoid waiting behind a long chat response, add a second lighter model alias and point `small_model` at it. + +:::note +QVAC's LLM `ctx_size` defaults to 1024 tokens — too small for an agent's tool definitions and system prompt. Set it explicitly in `qvac.config.json`, and set `reasoning_budget: 0` for reasoning-tuned models such as Qwen3 if you want to suppress `` blocks that opencode would otherwise render verbatim. +::: + +:::tip +Local tool-calling quality is bounded by the model. Small Qwen3 Instruct models are a fast, low-footprint starting point but won't reliably **invoke tools**; for real agent workflows, use a larger agent-tuned model such as `gpt-oss-20b`. +::: + +--- + ### SAP AI Core SAP AI Core provides access to 40+ models from OpenAI, Anthropic, Google, Amazon, Meta, Mistral, and AI21 through a unified platform.