After sending query, there is no error message and no output #725

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

Originally created by @MyGodOnLoad on GitHub (Jul 15, 2025).

Originally assigned to: @thdxr on GitHub.

After sending query, there is no error message and no output, then "TimeoutError: The opeation time out".
ollama is ok.

opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://127.0.0.1:11434/v1"
      },
      "models": {
        "qwen3:8b": {
        "name": "qwen3 8B",
        "limit": {
        "context": 200000,
        "output": 32000
        }
        }
      }
    }
  }
}
Originally created by @MyGodOnLoad on GitHub (Jul 15, 2025). Originally assigned to: @thdxr on GitHub. After sending query, there is no error message and no output, then "TimeoutError: The opeation time out". ollama is ok. opencode.json ``` { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://127.0.0.1:11434/v1" }, "models": { "qwen3:8b": { "name": "qwen3 8B", "limit": { "context": 200000, "output": 32000 } } } } } } ```
yindo closed this issue 2026-02-16 17:28:02 -05:00
Author
Owner

@renich commented on GitHub (Jul 18, 2025):

OK. ollama user here in Fedora 42.

I was looking for this solution for a while. This is why I'm posting it here (and all issues) for all to know:

@p-lemonish discovered why and the fix is easy: https://github.com/p-lemonish/ollama-x-opencode

In short, download a model that has tool capabilities:

$ ollama show granite3.3:8b
  Model
    architecture        granite    
    parameters          8.2B       
    context length      131072     
    embedding length    4096       
    quantization        Q4_K_M     

  Capabilities
    completion    
    tools         

  License
    Apache License               
    Version 2.0, January 2004    
    ...                          

And edit it so that it has a fixed num_ctx:

```terminal
$ ollama run qwen3:latest
>>> /set parameter num_ctx 16384
Set parameter 'num_ctx' to '16384'
>>> /save qwen3:latest
Created new model 'qwen3:latest'
>>> /bye

After that, you're good to go. Just try it out:

opencode run "generate a todo.md file with the contents 'hello world, from me' in it" --model ollama/qwen3:latest

With a bit of luck, your file will be there.

Credits:

Pre-requisites

  • Your model must be downloaded and functional in ollama.
  • You need to configure your model in opencode.json

My configuration looks like this:

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "ollama": {
            "npm": "@ai-sdk/openai-compatible",
            "options": {
                "baseURL": "http://localhost:11434/v1"
            },
            "models": {
                "granite3.3:8b": {
                    "tools": true
                },
                "mistral-small3.2:24b": {
                    "tools": true
                },
                "qwen3:latest": {
                    "tools": true,
                    "reasoning": true
                }
            }
        }
    }
}

Notes

  • granite3.3 still doesn't work.
@renich commented on GitHub (Jul 18, 2025): OK. ollama user here in Fedora 42. I was looking for this solution for a while. This is why I'm posting it here (and all issues) for all to know: @p-lemonish discovered why and the fix is easy: https://github.com/p-lemonish/ollama-x-opencode In short, download a model that has tool capabilities: ```terminal $ ollama show granite3.3:8b Model architecture granite parameters 8.2B context length 131072 embedding length 4096 quantization Q4_K_M Capabilities completion tools License Apache License Version 2.0, January 2004 ... And edit it so that it has a fixed num_ctx: ```terminal $ ollama run qwen3:latest >>> /set parameter num_ctx 16384 Set parameter 'num_ctx' to '16384' >>> /save qwen3:latest Created new model 'qwen3:latest' >>> /bye ``` After that, you're good to go. Just try it out: ``` opencode run "generate a todo.md file with the contents 'hello world, from me' in it" --model ollama/qwen3:latest ``` With a bit of luck, your file will be there. ## Credits: * https://github.com/p-lemonish/ollama-x-opencode ## Pre-requisites * Your model must be downloaded and functional in ollama. * You need to configure your model in opencode.json My configuration looks like this: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "granite3.3:8b": { "tools": true }, "mistral-small3.2:24b": { "tools": true }, "qwen3:latest": { "tools": true, "reasoning": true } } } } } ``` ## Notes * granite3.3 still doesn't work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#725