Skip to content

ollama-cloud: reasoning variants not passing parameter to Ollama API #36638

Closed as not planned

Description

@zxp09

Problem

The built-in ollama-cloud provider's reasoning variants for thinking models do not correctly control the thinking effort level. When switching between high and max variants, the Ollama Chat API request does not include the think parameter, which is how the Ollama API controls reasoning intensity per the spec.

Steps to Reproduce

  1. Connect to Ollama Cloud via /connect
  2. Select a thinking model, e.g. glm-5.2 (has the thinking tag on ollama.com)
  3. Switch between high and max variants
  4. The thinking content in the response shows no meaningful difference in reasoning depth between variants
  5. The think parameter is absent from the API request sent to Ollama

Workaround

Manually override variants in opencode.json:

{
  "provider": {
    "ollama-cloud": {
      "models": {
        "glm-5.2": {
          "id": "glm-5.2:cloud",
          "reasoning": true,
          "variants": {
            "high": { "think": "high" },
            "max":  { "think": "max" }
          }
        }
      }
    }
  }
}

Expected Behavior

The built-in reasoning variants for ollama-cloud should correctly pass the think parameter as a top-level field in the Ollama Chat API request, matching the Ollama API spec.

References

  • Ollama Chat API: POST /api/chat — think is a top-level parameter accepting "high", "medium", "low", "max" or boolean
  • GLM 5.2 on Ollama: https://ollama.com/library/glm-5.2 (supports effort level control: High and Max)

Activity

  1. zxp09 commented on Jul 13, 2026

    @zxp09
    Author

    Confirmed via MITM proxy: The built-in max variant for ollama-cloud sends reasoning_effort: max (OpenAI-style parameter) instead of think: max (Ollama API parameter).

    Captured request (built-in max variant, no custom model config):

    {
      "model": "glm-5.2",
      "max_tokens": 32000,
      "reasoning_effort": "max",
      "messages": [...],
      "stream": true
    }

    Expected (per Ollama API spec at https://github.com/ollama/ollama/blob/main/docs/api.md):

    {
      "model": "glm-5.2",
      "max_tokens": 32000,
      "think": "max",
      "messages": [...],
      "stream": true
    }

    Root cause

    The ollama-cloud provider on models.dev uses @ai-sdk/openai-compatible which maps reasoning variants to reasoning_effort (OpenAI parameter). However the Ollama Cloud API uses Ollama's native think parameter, not reasoning_effort. The reasoning_effort is silently ignored by the API.

  2. github-actions commented on Sep 12, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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