summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrosmur <[email protected]>2025-11-26 11:10:15 -0800
committerGitHub <[email protected]>2025-11-26 13:10:15 -0600
commit1854245bd35901a91a243e8e0a07d8db961a7192 (patch)
tree862c35505db593c0ad4d582529e30cb2984ebaad
parent4d07034930a3ffed418b6b67e70469be2855af47 (diff)
downloadopencode-1854245bd35901a91a243e8e0a07d8db961a7192.tar.gz
opencode-1854245bd35901a91a243e8e0a07d8db961a7192.zip
docs: add llama.cpp provider for local LLM inference (#4769)
Co-authored-by: Aiden Cline <[email protected]>
-rw-r--r--packages/web/src/content/docs/providers.mdx38
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx
index 54a4f2397..716402b88 100644
--- a/packages/web/src/content/docs/providers.mdx
+++ b/packages/web/src/content/docs/providers.mdx
@@ -652,6 +652,44 @@ The `global` region improves availability and reduces errors at no extra cost. U
---
+### llama.cpp
+
+You can configure opencode to use local models through [llama.cpp's](https://github.com/ggml-org/llama.cpp) llama-server utility
+
+```json title="opencode.json" "llama.cpp" {5, 6, 8, 10-14}
+{
+ "$schema": "https://opencode.ai/config.json",
+ "provider": {
+ "llama.cpp": {
+ "npm": "@ai-sdk/openai-compatible",
+ "name": "llama-server (local)",
+ "options": {
+ "baseURL": "http://127.0.0.1:8080/v1"
+ },
+ "models": {
+ "qwen3-coder:a3b": {
+ "name": "Qwen3-Coder: a3b-30b (local)"
+ }
+ },
+ "limit": {
+ "context": 128000,
+ "output": 65536
+ }
+ }
+ }
+}
+```
+
+In this example:
+
+- `llama.cpp` is the custom provider ID. This can be any string you want.
+- `npm` specifies the package to use for this provider. Here, `@ai-sdk/openai-compatible` is used for any OpenAI-compatible API.
+- `name` is the display name for the provider in the UI.
+- `options.baseURL` is the endpoint for the local server.
+- `models` is a map of model IDs to their configurations. The model name will be displayed in the model selection list.
+
+---
+
### IO.NET
IO.NET offers 17 models optimized for various use cases: