OpenCode on your own models
OpenCode speaks chat completions, which every runtime Corewire supports does — so any model on any of your machines will do.
Before you start
- Corewire running on this computer — the app, or
corewire agent. - OpenCode installed: the
opencodecommand. - Any model on any of your machines: OpenCode speaks chat completions, and so does every runtime Corewire supports. Sharing Ollama takes a minute.
Pick a model
corewire modelsNAME RUNTIME STATE WORKS WITHmac-studio/qwen3-coder:30b ollama serving claude-code, codex, opencodegaming-pc/openai/gpt-oss-20b lmstudio serving claude-code, codex, opencode
A name splits on its first slash: gaming-pc/openai/gpt-oss-20b is LM Studio’s openai/gpt-oss-20b on the gaming PC.
Launch
corewire launch opencode -model gaming-pc/openai/gpt-oss-20bstarting OpenCode on gaming-pc/openai/gpt-oss-20b through this device's gateway (key 71d3a9c05be28f4e)
OpenCode gets its configuration for this run in OPENCODE_CONFIG_CONTENT, merged over your own with the highest precedence: a provider called corewire at the gateway’s /v1 address, with the model selected as corewire/gaming-pc/openai/gpt-oss-20b — OpenCode splits on the first slash too, so the name survives whole. Your own configuration files are not touched. The key is minted for this launch, limited to models, and retired after thirty days unused.
-print starts nothing and prints the export line and the command instead; in the desktop app, Agents › OpenCode › Launch shows the same.
Set it up for good
Make OpenCode a key of its own, and export it as COREWIRE_GATEWAY_KEY:
corewire keys new -label "OpenCode" -scopes modelsThen add Corewire as a provider — in opencode.json at a project’s root, or in your global OpenCode configuration — listing the models you want to pick from:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"corewire": {
"npm": "@ai-sdk/openai-compatible",
"name": "Corewire",
"options": {
"baseURL": "http://127.0.0.1:36121/v1",
"apiKey": "{env:COREWIRE_GATEWAY_KEY}"
},
"models": {
"gaming-pc/openai/gpt-oss-20b": { "name": "gpt-oss-20b on gaming-pc" },
"mac-studio/qwen3-coder:30b": { "name": "qwen3-coder on mac-studio" }
}
}
},
"model": "corewire/gaming-pc/openai/gpt-oss-20b"
}
On another machine
OpenCode is a good fit for a session: start it on the Mac Studio from your laptop, detach, and come back to it later.
corewire sessions open -node mac-studio -agent opencode -workspace '~/code/app'