[Feature] Support llama.cpp as a local inference backend
Summary
Allow users to run quantised open-weight models (Llama 3, Mistral, Qwen, Phi) entirely on-device via llama.cpp, with no API key or internet connection required.
Problem / goal
There is currently no way to run models locally. All inference requires an external API key and internet connection, which blocks offline, air-gapped, and privacy-sensitive use cases.
Primary user(s)
- [x] Bob (IT / power user)
- [ ] Susan (non-technical)
- [ ] Other team roles
OpenCode primitive alignment
session.* (model provider config), mcp (tool calls routed to local model), skills/plugins (could wrap llama-server as an OpenAI-compatible provider)
Alignment with VISION/PRINCIPLES/PRODUCT
Local-first and privacy-respecting inference aligns with giving teams full control over their data and infrastructure. llama.cpp is the de-facto standard for on-device LLM inference and has wide community adoption.
Testability
pnpm dev + start llama-server locally with a quantised model + configure openwork to point at localhost endpoint + run a task and verify it completes using the local model
Ready to build it yourself?
Yes
Additional context
Two integration paths:
- llama-server: llama.cpp ships a built-in HTTP server exposing an OpenAI-compatible API. Minimal integration work since the API shape is already familiar.
- llama-cpp-python: Python bindings for direct in-process inference without a separate server.
Related: https://github.com/ggerganov/llama.cpp
@mbhassan you should be able to run local models: https://openworklabs.com/docs/how-to-connect-a-custom-provider
Let me know if this doesn't work or how you'd expect it to be surfaced within the app.
@mbhassan we support local providers, please check the docs linked above and opencode docs for specific providers 🫡
ahh thanks @src-opn @jcllobet