llama2 example doesn't work AI_APICallError: registry.ollama.ai/library/llama2:latest does not support tools #219

Closed
opened 2026-02-16 17:25:49 -05:00 by yindo · 1 comment
Owner

Originally created by @kevincobain2000 on GitHub (Jun 22, 2025).

Setup

Doc link: https://opencode.ai/docs/models/#local

╰─$ cat opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "llama2": {}
      }
    }
  }
}
╰─$ ollama ls
NAME               ID              SIZE      MODIFIED
llama2:latest      78e26419b446    3.8 GB    12 minutes ago

╰─$ curl http://localhost:11434/v1  
404 page not found

╰─$ curl http://localhost:11434
Ollama is running

Image

Image

Originally created by @kevincobain2000 on GitHub (Jun 22, 2025). **Setup** Doc link: https://opencode.ai/docs/models/#local ``` ╰─$ cat opencode.json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "llama2": {} } } } } ``` ``` ╰─$ ollama ls NAME ID SIZE MODIFIED llama2:latest 78e26419b446 3.8 GB 12 minutes ago ╰─$ curl http://localhost:11434/v1 404 page not found ╰─$ curl http://localhost:11434 Ollama is running ``` ![Image](https://github.com/user-attachments/assets/bb520bbf-ed04-426c-9945-13accd9c8bb5) ![Image](https://github.com/user-attachments/assets/a77cf886-9c2c-423b-950e-19ed79850289)
yindo closed this issue 2026-02-16 17:25:49 -05:00
Author
Owner

@kevincobain2000 commented on GitHub (Jun 22, 2025):

Nevermind, made it work by following this guideline https://zenn.dev/chronos_pokkuru/articles/b6341f54663da0

@kevincobain2000 commented on GitHub (Jun 22, 2025): Nevermind, made it work by following this guideline https://zenn.dev/chronos_pokkuru/articles/b6341f54663da0
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#219