mirror of
https://github.com/sst/opencode.git
synced 2025-07-08 00:25:00 +00:00
docs: use ollama example
This commit is contained in:
parent
fa1266263d
commit
2ea0399aa7
2 changed files with 12 additions and 15 deletions
17
README.md
17
README.md
|
@ -82,17 +82,16 @@ You can use opencode with any provider listed at [here](https://ai-sdk.dev/provi
|
||||||
|
|
||||||
```json title="opencode.json"
|
```json title="opencode.json"
|
||||||
{
|
{
|
||||||
"$schema": "http://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"provider": {
|
"provider": {
|
||||||
"@ai-sdk/openai-compatible": {
|
"@ai-sdk/openai-compatible": {
|
||||||
"name": "MySpecialProvider",
|
"name": "ollama",
|
||||||
"options": {
|
"options": {
|
||||||
"apiKey": "xxx",
|
"baseURL": "http://localhost:11434/v1"
|
||||||
"baseURL": "https://api.provider.com/v1"
|
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
"my-model-name": {
|
"llama2": {
|
||||||
"name": "My Model Name"
|
"name": "llama2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,9 +116,9 @@ $ bun run src/index.ts
|
||||||
|
|
||||||
### FAQ
|
### FAQ
|
||||||
|
|
||||||
#### How do I use this with OpenRouter
|
#### How do I use this with OpenRou?ter
|
||||||
|
|
||||||
Theoretically you can use this with OpenRouter with config like this
|
OpenRouter is not yet in the models.dev database but you can configure it manually.
|
||||||
|
|
||||||
```json title="opencode.json"
|
```json title="opencode.json"
|
||||||
{
|
{
|
||||||
|
@ -139,5 +138,3 @@ Theoretically you can use this with OpenRouter with config like this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
However we are using [ai-sdk v5](https://ai-sdk.dev) which OpenRouter does not support yet. The moment they do this will work
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"provider": {
|
"provider": {
|
||||||
"@openrouter/ai-sdk-provider": {
|
"@ai-sdk/openai-compatible": {
|
||||||
"name": "OpenRouter",
|
"name": "ollama",
|
||||||
"options": {
|
"options": {
|
||||||
"apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
"baseURL": "http://localhost:11434/v1"
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
"anthropic/claude-3.5-sonnet": {
|
"llama2": {
|
||||||
"name": "claude-3.5-sonnet"
|
"name": "llama2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue