anomalyco / anomalyco/opencode

opencode2: user-defined local provider models never enter the model catalog

Open
#42,856 0 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 16, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Summary

I downloaded opencode2 beta.

My user-defined local OpenAI-compatible provider (per the documented "Local models" config) is not visible, while it is working with opencode.

According to the model which investigated, it is parsed by the service but its model is never exposed in the catalog. opencode2 run -m <provider>/<model> fails with Model unavailable and the provider is absent from /api/provider.

Plugins

none

OpenCode version

opencode2 v0.0.0-next-17444 (channel: next)

Steps to reproduce

Steps to reproduce

  1. Create ~/.config/opencode/opencode.jsonc (also reproducible as a real file, non-symlink):
    {
      "$schema": "https://opencode.ai/config.json",
      "providers": {
        "local-llama-cpp": {
          "name": "Local llama.cpp",
          "package": "aisdk:@ai-sdk/openai-compatible",
          "settings": { "baseURL": "http://localhost:11434/v1" },
          "models": {
            "local-llm": {
              "modelID": "local-llm",
              "capabilities": { "tools": true, "input": ["text"], "output": ["text"] },
              "limit": { "context": 114588, "output": 32768 }
            }
          }
        }
      }
    }
    
  2. opencode2 service restart
  3. opencode2 api get /api/provider — only the built-in opencode provider is listed; local-llama-cpp is absent.
  4. opencode2 api get /api/model — only the 7 built-in opencode models are present.
  5. opencode2 run -m local-llama-cpp/local-llm "hi"Error: Model unavailable: local-llama-cpp/local-llm

Expected Behavior

Per the Local models documentation, the local-llama-cpp/local-llm model should appear in the model picker and be runnable.

Actual Behavior

The provider is parsed and held by the service (confirmed via /api/config), but it never enters the model catalog: absent from /api/provider and /api/model, and run reports Model unavailable.

Screenshot and/or share link

No response

Operating System

Linux z390v2 7.1.8-arch1-3 x86_64 GNU/Linux

Terminal

Konsole / tmux

Additional Context

  • Distinct from https://github.com/anomalyco/opencode/issues/36834 (closed):

    • There the model resolves but the request hangs / sends to undefined/chat/completions; here the model never enters the catalog, so the failure is earlier (catalog build / model resolution).
    • Also its repro used the V1 npm/options shape, whereas this report uses the documented native package: "aisdk:@ai-sdk/openai-compatible" + settings.baseURL shape.
  • The provider uses aisdk:@ai-sdk/openai-compatible — the exact package the built-in opencode provider uses, so the package resolves.

  • The config is confirmed loaded by the service: opencode2 api get /api/config returns the document with providers.local-llama-cpp and the model. No normalization warnings are emitted for the native V2 config.

  • Reproduced with:

    • Minimal native V2 config (above) as a symlink AND as a real file — identical failure, so the dotfiles symlink is not the cause.
    • V1 provider/npm/options syntax (converted per the migration guide) — same failure.
  • The OpenAI-compatible endpoint itself works: curl localhost:11434/v1/chat/completions returns a valid completion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.