Skip to content

how to use Other model? #135

Closed
Closed

Description

@morphishk

(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

Activity

  1. morphishk commented on Jun 16, 2025

    @morphishk
    Author

    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"
    }
    }
    }
    }
    }

  2. akuuly-7 commented on Jun 16, 2025

    @akuuly-7

    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...

  3. manuelmaceira commented on Jun 16, 2025

    @manuelmaceira

    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

  4. thdxr commented on Jun 16, 2025

    @thdxr
    Member

    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

  5. self-assigned this
    on Jun 16, 2025
  6. morphishk commented on Jun 16, 2025

    @morphishk
    Author

    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

  7. added a commit that references this issue on Dec 18, 2025
    a35ab92
  8. added a commit that references this issue on Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions