Provider ollama,   AI_APICallError: json: cannot unmarshal array into Go struct field #68

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

Originally created by @mikaelwills on GitHub (Jun 15, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Really excited for this to be a thing, having claude code style editing with a local model is a dream.

Im running into this issue though

Image

This is my opencode.json in the folder

Image
Originally created by @mikaelwills on GitHub (Jun 15, 2025). Originally assigned to: @adamdotdevin on GitHub. Really excited for this to be a thing, having claude code style editing with a local model is a dream. Im running into this issue though <img width="741" alt="Image" src="https://github.com/user-attachments/assets/b711aaaa-c512-4b48-b1d3-fb0e0a2095ac" /> This is my opencode.json in the folder <img width="591" alt="Image" src="https://github.com/user-attachments/assets/be70d1ef-a867-4c9e-bc0c-f66cb4df587d" />
yindo closed this issue 2026-02-16 17:25:04 -05:00
Author
Owner

@adamdotdevin commented on GitHub (Jun 15, 2025):

i'll get a local model setup and repro this week

@adamdotdevin commented on GitHub (Jun 15, 2025): i'll get a local model setup and repro this week
Author
Owner

@mikaelwills commented on GitHub (Jun 18, 2025):

Just pulled the latest and had a go again on 0.1.76 but im seeing this now

Image

opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "codellama:7b": {}
      }
    }
  }
}
@mikaelwills commented on GitHub (Jun 18, 2025): Just pulled the latest and had a go again on 0.1.76 but im seeing this now <img width="762" alt="Image" src="https://github.com/user-attachments/assets/3448d8c1-6964-49d2-870a-7bc22fd08248" /> opencode.json: ``` { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "codellama:7b": {} } } } } ```
Author
Owner

@Dark-Kernel commented on GitHub (Sep 18, 2025):

well, same issue faced, it's like that the model doesn't support tools, you can try models that have tools tag like:
https://ollama.com/library/qwen2.5:0.5b

@Dark-Kernel commented on GitHub (Sep 18, 2025): well, same issue faced, it's like that the model doesn't support tools, you can try models that have tools tag like: https://ollama.com/library/qwen2.5:0.5b
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#68