[GH-ISSUE #14820] Document reasoning_effort support in OpenAI-compatible /v1/chat/completions API #35329

Closed
opened 2026-04-22 19:46:03 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @flipbit03 on GitHub (Mar 13, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14820

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
Originally created by @flipbit03 on GitHub (Mar 13, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14820 ## 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](https://docs.ollama.com/api/openai-compatibility). 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 ```shell # 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 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35329