Use Savant in a coding agent
Any coding agent with an OpenAI-compatible (Chat Completions) provider setting can run on SubQ Savant Preview using these three values:
| Setting | Value |
|---|---|
| Base URL | https://api.subq.ai/v1 |
| API key | Your SubQ API key |
| Model | subq-savant-latest |
OpenCode
-
Save your API key as
SUBQ_API_KEY. -
Add SubQ as a provider in
opencode.jsoncat the root of your project. To use it in every project, put it in~/.config/opencode/opencode.jsoncinstead. This uses the OpenCode 2 config format.opencode.jsonc { "$schema": "https://opencode.ai/config.json", "model": "subq/subq-savant-latest", "providers": { "subq": { "name": "SubQ", "env": ["SUBQ_API_KEY"], "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://api.subq.ai/v1", }, "models": { "subq-savant-latest": { "name": "SubQ Savant", // OpenCode assumes 200K tokens for models it doesn't know. "limit": { "context": 4000000 }, }, }, }, }, } -
Give the key to OpenCode's background server, which doesn't see your shell's variables. Without this, requests fail with a missing-authentication error.
opencode service set env SUBQ_API_KEY "$SUBQ_API_KEY" -
Run a quick check from your project root to verify end-to-end setup:
opencode run "Review this repository for error-handling gaps, edge cases, and maintainability issues, and list the highest-impact fixes."
VS Code
These steps use the chat built into VS Code (GitHub Copilot) and require VS Code 1.142 or newer. On Copilot Business or Enterprise, an admin must first allow Bring Your Own Language Model Key in VS Code.
-
Open Chat: Chat Settings from the Command Palette and check
chat.agentHost.byokModels.enabled. If it isn't already enabled, turn it on and restart VS Code. -
Open Chat: Manage Language Models from the Command Palette, select Add Models, and choose Custom Endpoint.
-
Enter
SubQas the group name, add a display name, enter your SubQ API key, and select Chat Completions as the API type. -
VS Code opens
chatLanguageModels.json. In theSubQgroup, set themodelsarray to this; leave the rest of the file as is:"models": [ { "id": "subq-savant-latest", "name": "SubQ Savant", "url": "https://api.subq.ai/v1/chat/completions", "toolCalling": true, "vision": true, "thinking": true, "maxInputTokens": 3872000, "maxOutputTokens": 128000 } ]maxInputTokensandmaxOutputTokensadd up to Savant's 4M context.thinkingstops VS Code from sending atemperature, which Savant rejects unless it's1.- Don't add a key here. The file's own
apiKeyline already points to the key from step 3.
-
Confirm the session target below the chat input is set to Copilot. Open the model picker in the chat input (for example, from Copilot Fusion), switch to the SubQ tab at the top, and select SubQ Savant.
-
Run a quick check in chat to verify end-to-end setup:
Review this repository for error-handling gaps, edge cases, and maintainability issues, and list the highest-impact fixes.