Skip to content

Remote Ollama stopped working #2667

@HendrikSP

Description

@HendrikSP

I had runnig opencode with ollama on a second computer in the local network. It was working fine.

One of the recent updates broke my installation and I'm unable to get it running again. (Since I use opencode only sometimes I cannot pinpoint the exact version that broke for me).

My config to reproduce this:

{
  "$schema": "https://opencode.ai/config.json",
  "disabled_providers": [ "opencode" ],
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama",
      "options": {
        "baseURL": "http://192.168.1.26:11434/v1"
      },
      "models": {
        "qwen3:8b": {
          "name": "Qwen3"
        }
      }
    }
  }
}

Then opencode replies to any prompt with "Error: Was there a typo in the url or port?"

Running opencode with log level Debug writes

ERROR 2025-09-18T07:25:08 +2ms service=session.prompt session=ses_6a4498a9dffesactQKgvG248ok error=Was there a typo in the url or port? model=qwen3:8b failed to generate title
ERROR 2025-09-18T07:25:08 +0ms service=session.prompt session=ses_6a4498a9dffesactQKgvG248ok error={"error":{"code":"FailedToOpenSocket","path":"http://192.168.1.26:11434/v1/chat/completions","errno":0}} stream error
INFO  2025-09-18T07:25:08 +1ms service=session.prompt session=ses_6a4498a9dffesactQKgvG248ok type=error part
ERROR 2025-09-18T07:25:08 +0ms service=session.prompt session=ses_6a4498a9dffesactQKgvG248ok error=Was there a typo in the url or port? process

to the log file.

Observations:

  1. I can curl the URL
  2. Other programs on my local computer communicate well with the remote ollama server
  3. Using the hostname of the server results in the same error (I use the IP to report the bug to avoid any influence may caused by DNS issues)
  4. Replacing the IP with localhost or 127.0.0.1 and running ollama locally DOES work!
  5. I disabled the opencode providers to avoid any clutter in the ui or selecting the right model. Removing the line form the config does not solve or change the problem.

opencode v0.9.11

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