[PR #14821] [MERGED] docs: document reasoning_effort support in OpenAI-compatible API #14855

Closed
opened 2026-04-13 01:04:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14821
Author: @flipbit03
Created: 3/13/2026
Status: Merged
Merged: 3/13/2026
Merged by: @drifkin

Base: mainHead: docs/reasoning-effort-openai-compat


📝 Commits (1)

  • 8a4661f docs: document reasoning_effort support in OpenAI-compatible API

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 docs/api/openai-compatibility.mdx (+4 -0)

📄 Description

Closes #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 one can verify that reasoning_effort or reasoning.effort are 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.

Changes

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

Verification

  • Verified reasoning_effort values ("high", "medium", "low", "none") work against /v1/chat/completions with qwen3.5:9b
  • Verified nested reasoning.effort form works identically
  • Confirmed these fields are implemented in openai/openai.go but missing from docs

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14821 **Author:** [@flipbit03](https://github.com/flipbit03) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `docs/reasoning-effort-openai-compat` --- ### 📝 Commits (1) - [`8a4661f`](https://github.com/ollama/ollama/commit/8a4661f027877bc4cc0bfe527c662fbc5f8088ed) docs: document reasoning_effort support in OpenAI-compatible API ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/api/openai-compatibility.mdx` (+4 -0) </details> ### 📄 Description Closes #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 one can verify that `reasoning_effort` or `reasoning.effort` are 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. ## Changes - Add `reasoning_effort` and `reasoning` to the supported features and request fields for `/v1/chat/completions` in `docs/api/openai-compatibility.mdx` - Document accepted values (`"high"`, `"medium"`, `"low"`, `"none"`) ## Verification - [x] Verified `reasoning_effort` values (`"high"`, `"medium"`, `"low"`, `"none"`) work against `/v1/chat/completions` with `qwen3.5:9b` - [x] Verified nested `reasoning.effort` form works identically - [x] Confirmed these fields are implemented in `openai/openai.go` but missing from docs --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 01:04:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14855