Research OpenCode CLI installation and local-endpoint setup #7
Notifications
Due Date
No due date set.
Blocks
Reference: haylan/LLM-Server#7
Reference in New Issue
Block a user
Part of #1
Question
How is OpenCode CLI (sst/opencode) installed, and how is it correctly configured to point at this stack's local llama.cpp server instead of a hosted provider? Specifically: install method (npm/curl script/binary), config file location/format, which provider type to declare (OpenAI-compatible custom endpoint vs. a dedicated "local"/"openai-compatible" provider block), the exact base_url/model/api_key fields needed to hit llama.cpp's /v1/chat/completions on http://localhost:8080, and whether OpenCode's tool-calling/agentic loop has any documented compatibility requirements or known issues with self-hosted OpenAI-compatible servers (especially llama.cpp) that would matter for Qwen3.8-27B specifically. Compare against how Kimi CLI's config.toml was already set up (see #6) so the docs stay consistent.
Resolved. Full findings:
docs/research/opencode-cli-setup.mdon branchresearch/opencode-cli-setup.Project confirmed: sst/opencode moved orgs — now github.com/anomalyco/opencode (docs at opencode.ai/docs). Not to be confused with the unrelated opencode-ai/opencode (Go TUI project).
Install:
curl -fsSL https://opencode.ai/install | bash(ornpm i -g opencode-ai@latest, orbrew install anomalyco/tap/opencode).Config: JSON/JSONC at
~/.config/opencode/opencode.json(global) oropencode.jsonin project root. Local provider block:Select with
llamacpp/qwen3.8-27b.Caveats (both documented, primary-source):
tools/Jinja scaffolding unconditionally — llama.cpp needs--jinjaor it 500s; some model templates crash llama.cpp's Jinja renderer even with--jinjaon.descriptionfield; some local backends returnfinish_reason: tool_callswith an emptytool_calls: [], causing loop/hang.docs/research/qwen3.8-27b-tool-calling.mdindependently found open llama.cpp upstream tool-call parser bugs for the Qwen3.5/Qwen3.8 lineage — expect unreliable tool-calling regardless of OpenCode config correctness.<think>tags) handling in OpenCode against llama.cpp is undocumented — flagged low-confidence/open question, recommend empirical testing once tool-calling is unblocked.Full citations and confidence levels for every claim are in the doc.