how to use Other model? #81

Closed
opened 2026-02-16 17:25:06 -05:00 by yindo · 5 comments
Owner

Originally created by @morphishk on GitHub (Jun 16, 2025).

Originally assigned to: @thdxr on GitHub.

(base) /mnt/d/ubuntu$ opencode

█▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀
█░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀
▀▀▀▀ █▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀

┌ Add credential

◇ Select provider
│ Other

◇ Enter provider - must match @ai-sdk/
http://127.0.0.1:8888/v1

◇ Enter your API key
│ ▪▪▪▪▪▪

└ Done

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x883cc1]

goroutine 1 [running]:
github.com/sst/opencode/internal/app.New({0xfe49a8, 0xc000173bd0}, {0xc000013de0, 0x7}, 0xc000502d90)
/home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:64 +0x2a1
main.main()
/home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:59 +0x5b5

Originally created by @morphishk on GitHub (Jun 16, 2025). Originally assigned to: @thdxr on GitHub. (base) /mnt/d/ubuntu$ opencode █▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀ █░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀ ┌ Add credential │ ◇ Select provider │ Other │ ◇ Enter provider - must match @ai-sdk/<provider> │ http://127.0.0.1:8888/v1 │ ◇ Enter your API key │ ▪▪▪▪▪▪ │ └ Done panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x883cc1] goroutine 1 [running]: github.com/sst/opencode/internal/app.New({0xfe49a8, 0xc000173bd0}, {0xc000013de0, 0x7}, 0xc000502d90) /home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:64 +0x2a1 main.main() /home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:59 +0x5b5
yindo closed this issue 2026-02-16 17:25:06 -05:00
Author
Owner

@morphishk commented on GitHub (Jun 16, 2025):

I just write ~/.local/share/opencode/auth.json

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"@ai-sdk/openai-compatible": {
"name": "Qwen3",
"options": {
"baseURL": "http://localhost:8888/v1"
},
"models": {
"Qwen3": {
"name": "Qwen3"
}
}
}
}
}

@morphishk commented on GitHub (Jun 16, 2025): I just write ~/.local/share/opencode/auth.json { "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } }
Author
Owner

@luuk00101 commented on GitHub (Jun 16, 2025):

I just write ~/.local/share/opencode/auth.json

{ "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } }

@thdxr @adamdottv

Shouldn't these kind of config files be rather put into ~/.config/opencode/ instead of ~/.local/share/opencode/? Seems a bit confusing to me and off-spec based on https://specifications.freedesktop.org/basedir-spec/latest/

Maybe even separate logs into ~/.local/state/opencode/, but that's not really that important...

@luuk00101 commented on GitHub (Jun 16, 2025): > I just write ~/.local/share/opencode/auth.json > > { "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } } @thdxr @adamdottv Shouldn't these kind of config files be rather put into ~/.config/opencode/ instead of ~/.local/share/opencode/? Seems a bit confusing to me and off-spec based on https://specifications.freedesktop.org/basedir-spec/latest/ Maybe even separate logs into ~/.local/state/opencode/, but that's not really that important...
Author
Owner

@manuelmaceira commented on GitHub (Jun 16, 2025):

I just write ~/.local/share/opencode/auth.json

{ "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } }

did that work for you? im having the same errors when trying to use opencode with llama.cpp

@manuelmaceira commented on GitHub (Jun 16, 2025): > I just write ~/.local/share/opencode/auth.json > > { "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } } did that work for you? im having the same errors when trying to use opencode with llama.cpp
Author
Owner

@thdxr commented on GitHub (Jun 16, 2025):

I just write ~/.local/share/opencode/auth.json
{ "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } }

@thdxr @adamdottv

Shouldn't these kind of config files be rather put into ~/.config/opencode/ instead of ~/.local/share/opencode/? Seems a bit confusing to me and off-spec based on https://specifications.freedesktop.org/basedir-spec/latest/

Maybe even separate logs into ~/.local/state/opencode/, but that's not really that important...

so i think the commenter made a mistake - that format is for opencode.json which right now sits inside your repo and is meant to be checked in. the readme has info on how to configure additional providers

i'm going to add better validation to the auth flow so you don't end up with an invalid config

@thdxr commented on GitHub (Jun 16, 2025): > > I just write ~/.local/share/opencode/auth.json > > { "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } } > > [@thdxr](https://github.com/thdxr) [@adamdottv](https://github.com/adamdottv) > > Shouldn't these kind of config files be rather put into ~/.config/opencode/ instead of ~/.local/share/opencode/? Seems a bit confusing to me and off-spec based on https://specifications.freedesktop.org/basedir-spec/latest/ > > Maybe even separate logs into ~/.local/state/opencode/, but that's not really that important... so i think the commenter made a mistake - that format is for `opencode.json` which right now sits inside your repo and is meant to be checked in. the readme has info on how to configure additional providers i'm going to add better validation to the auth flow so you don't end up with an invalid config
Author
Owner

@morphishk commented on GitHub (Jun 16, 2025):

I has re-write to ~/cache/opencode/opencode.json

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"@ai-sdk/openai-compatible": {
"name": "Qwen3",
"options": {
"baseURL": "http://localhost:8888/v1"
},
"models": {
"Qwen3": {
"name": "Qwen3"
}
}
}
}
}

that opencode can talk to model(Qwen3),
but it also have some problem : I can't save api-key in ~/local/share/opencode/auth.json,It will lead to the emergence of the first problem
I will close this Issues
Thank you for your assistance
@thdxr @manuelmaceira @luuk00101

@morphishk commented on GitHub (Jun 16, 2025): I has re-write to ~/cache/opencode/opencode.json { "$schema": "https://opencode.ai/config.json", "provider": { "@ai-sdk/openai-compatible": { "name": "Qwen3", "options": { "baseURL": "http://localhost:8888/v1" }, "models": { "Qwen3": { "name": "Qwen3" } } } } } that opencode can talk to model(Qwen3), but it also have some problem : I can't save api-key in ~/local/share/opencode/auth.json,It will lead to the emergence of the first problem I will close this Issues Thank you for your assistance @thdxr @manuelmaceira @luuk00101
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#81