This commit is contained in:
John Saigle 2025-07-07 14:43:14 +09:00 committed by GitHub
commit 68002b135a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,6 +58,30 @@ To configure a local model, specify the npm package to use and the `baseURL`.
}
```
#### Example: Ollama
Requirements:
- You must set-up an API key for Ollama to appear as a provider.
- The model name must include the 'variant', e.g. "latest", "7b", etc.
- The JSON value must be empty.
```json title="opencode.json" {5,7}
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"llama3.2:latest": {}
}
}
}
}
```
---
## Select a model