Skip to content

Document reasoning_effort support in OpenAI-compatible /v1/chat/completions API #14820

Closed

Description

@flipbit03

Problem

The OpenAI-compatible /v1/chat/completions endpoint supports reasoning_effort and reasoning request fields for controlling thinking on thinking-capable models (e.g. qwen3.5), but this is not documented in the OpenAI compatibility docs.

Ollama auto-enables thinking for capable models when no reasoning_effort is provided. The only way to discover how to disable thinking via the OpenAI-compat API is to read the source code (openai/openai.go), where reasoning_effort is mapped to the internal Think field:

  • "high", "medium", "low" → thinking ON (with varying effort)
  • "none" → thinking OFF

This is especially important because many users connect to Ollama through OpenAI-compatible SDKs and frameworks (PydanticAI, LangChain, etc.) via /v1/chat/completions, and the native Ollama parameter think: true/false does not work on this endpoint. Without documentation, there is no discoverable way to control thinking through the OpenAI-compat API.

Suggested fix

Add reasoning_effort and reasoning to the "Supported request fields" list for /v1/chat/completions in docs/api/openai-compatibility.mdx, with accepted values ("high", "medium", "low", "none").

Example

# Thinking disabled
curl -X POST http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.5:9b",
    "messages": [{"role": "user", "content": "What is 2+2?"}],
    "reasoning_effort": "none"
  }'
# ~2-5 output tokens, no reasoning overhead

# Thinking enabled (default when omitted, or explicit)
curl -X POST http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.5:9b",
    "messages": [{"role": "user", "content": "What is 2+2?"}],
    "reasoning_effort": "high"
  }'
# ~200-400 output tokens, includes internal reasoning

Activity

  1. added 2 commits that reference this issue on Mar 13, 2026
    76793ec
    8a4661f
  2. NicoCampa commented on Apr 30, 2026

    @NicoCampa

    For thinking models such as Qwen 3.5, could you clarify what this means?

    "high", "medium", "low" → thinking ON, with varying effort

    I thought Qwen-style thinking was essentially binary: either thinking is enabled or disabled. Does Ollama actually pass different reasoning-effort levels to Qwen, or do low, medium, and high all just enable thinking?

    So the key question is: can Qwen produce controlled amounts of reasoning based on the effort level, or is it only an on/off switch? Thank you!!

  3. added a commit that references this issue on Jul 13, 2026
    d16f678
  4. added a commit that references this issue on Oct 12, 2026
    0fb00ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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