Launch OpenCode with a local model served by
llama.cpp. The launcher starts
llama-server, wires OpenCode to it, and cleans up when your session ends.
The launcher finds llama-server on PATH, or you can set llama_server in
your config.
Install OpenCode using its GitHub installation instructions. Install llama.cpp using its installation guide.
For most users, install with pipx:
pipx install opencode-llama-cpp-launcherOr install with pip:
python -m pip install opencode-llama-cpp-launcherCheck that the required external binaries are available:
opencode-llama doctorCreate opencode-llama.yaml in the project where you want OpenCode to run, or
create ~/.config/opencode-llama.yaml for a user-wide default:
model: /absolute/path/to/model.gguf
ctx_size: 8192
# Optional
port: 8080
llama_server: /optional/path/to/llama-serverConfig lookup order:
- The path passed with
--config opencode-llama.yamloropencode-llama.ymlin the project directory~/.config/opencode-llama.yaml
Run with an explicit config file:
opencode-llama --config opencode-llama.yamlOr pass the model directly:
opencode-llama --model /absolute/path/to/model.ggufUseful options:
opencode-llama --help
opencode-llama --dry-run
opencode-llama --config opencode-llama.yaml
opencode-llama --port 9001
opencode-llama --ctx-size 8192
opencode-llama --llama-server /absolute/path/to/llama-serverIf llama-server fails before becoming healthy, the launcher includes a bounded
tail of the server's startup output in the error message. Successful runs stay
quiet.
Install dependencies from this repository:
uv sync --devRun the test suite:
uv run pytestBefore publishing, check for local files:
git status --short --ignoredDo not commit local launcher configs, virtual environments, caches, build artifacts, or model paths.
MIT
