Skip to content

Integration with Ollama Local #19948

@TheTwinEsper

Description

@TheTwinEsper

Description

Bug Report: Ollama local model not working in OpenCode Desktop

Description

When using OpenCode Desktop application (Windows), after configuring a local Ollama model, the model appears in the list but returns invalid JSON responses ({ "name": "skill", "arguments": { "name": "build" } }) instead of actual text responses.

Environment

  • OpenCode version: 1.2.27
  • Operating System: Windows
  • Ollama version: Running locally on port 11434
  • Model: DanyaVoredom/DanyAI-qwen2.5-coder-3b-instruct:latest

Steps to Reproduce

  1. Install OpenCode Desktop for Windows
  2. Download a model in Ollama (e.g., ollama run DanyaVoredom/DanyAI-qwen2.5-coder-3b-instruct)
  3. Configure opencode.json with Ollama provider:
    {
      "provider": {
        "ollama": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Ollama (local)",
          "options": {
            "baseURL": "http://localhost:11434/v1"
          },
          "models": {
            "DanyaVoredom/DanyAI-qwen2.5-coder-3b-instruct:latest": {
              "name": "DanyAI Coder 3B",
              "_launch": true
            }
          }
        }
      }
    }
  4. Open OpenCode Desktop
  5. Select the Ollama model from the model list
  6. Send a prompt

Expected Behavior

The model should return a normal text response.

Actual Behavior

The model returns invalid JSON: { "name": "skill", "arguments": { "name": "build" } }

Verification

  • Ollama API works correctly (tested via curl)
  • The same configuration works with OpenCode CLI (terminal version)
  • This appears to be a bug specific to the OpenCode Desktop application

Additional Information

Screenshots

N/A

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktopwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions