OpenCode Workflow
OpenCode is the lightweight control plane for this inference project.
The target surface is local llama.cpp inference:
llama-serveris the preferred runtime.- The benchmark endpoint is OpenAI-compatible chat completions.
.agents/skills/huggingface-local-models/defines the GGUF discovery and launch workflow.research/results.tsvis the append-only local benchmark ledger.
Setup
Install project tooling:
bash
uv syncInstall or confirm llama.cpp:
bash
llama-server --version
llama-cli --versionOn macOS, Homebrew is the simplest path:
bash
brew install llama.cppAuthenticate if the target model is gated:
bash
hf auth loginParent Session Workflow
- Inspect local hardware and tools:
bash
uv run scripts/inspect_llama_toolchain.py- Resolve a target GGUF:
bash
uv run scripts/resolve_hf_gguf.py --repo <owner/repo> --quant Q4_K_M- Start OpenCode in
inference/:
bash
opencode- Use the
inference-labprimary agent.
Delegate to:
optimizerfor the next one-variable speed candidatebenchmarkerfor baseline and candidate measurements
Benchmarking
Benchmark an existing endpoint:
bash
uv run scripts/benchmark_llama.py \
--base-url http://127.0.0.1:8080/v1 \
--runs 3 \
--append-tsv research/results.tsvLaunch a server for one benchmark and stop it afterward:
bash
uv run scripts/benchmark_llama.py \
--server-cmd "llama-server --hf-repo <owner/repo> --hf-file <file.gguf> -c 4096 --port 8080" \
--base-url http://127.0.0.1:8080/v1 \
--runs 3 \
--append-tsv research/results.tsv