langchain · difficulty ◆◆
reasoning_effort: A Standard Chat Model Parameter
Dial reasoning depth without touching provider-specific params
You were hardcoding provider-specific thinking parameters that broke on every swap.
$ pip install -U langchain-core>=1.5.0What it does
reasoning_effort is a new standard parameter added across LangChain chat model implementations. Passing "low", "medium", or "high" to ChatOpenAI, ChatAnthropic, or any supporting model instructs the provider to allocate more or less compute to the internal reasoning chain. It maps to provider-specific knobs: OpenAI o-series thinking budget, Anthropic Claude extended thinking tokens, and Fireworks reasoning steps.
Why it matters
Different requests have different quality/latency trade-offs. A quick classification task does not need "high" reasoning; a complex multi-step planning task absolutely does. Before reasoning_effort, you had to know each provider\u2019s proprietary parameter name. Now LangChain abstracts it into one consistent interface so you can swap providers without rewriting your prompting strategy.
Example
$ Loop over low, medium, and high reasoning_effort for the same prompt.[LOW] The sky appears blue because of Rayleigh scattering, where shorter blue wavelengths scatter more than other colors...\n[MEDIUM] The sky is blue primarily due to a process called Rayleigh scattering - when sunlight...\n[HIGH] The blue color of the sky is a fascinating consequence of atmospheric physics. Sunlight appears white but is actually...Actual output varies by model version and provider.
Common flags
- init_chat_model
- Unified entry point to initialise any supported chat model
- model_kwargs
- Dict of provider-specific params passed through to the API
- retry_with_reasoning_effort
- Fallback handler retrying with a different effort on failure
- set_debug
- Enable debug logging to see parameters sent to the provider
History
Origin
Controlling reasoning depth meant provider-specific kwargs like max_tokens for thinking or thinking_depth, handled separately per integration.
The change
langchain-core 1.5.0 (PR #38887) promoted reasoning_effort to a standard parameter so providers map it to their own knobs transparently.
Fun facts
Pros & cons
pros
- + Provider-agnostic reasoning control
- + Cost and latency tuning
- + Swap providers without rewrites
cons
- − Not every model supports every level
- − Output verbosity varies by provider
Takeaways
- 1Scope reasoning effort to task complexity
- 2Measure the latency difference
- 3Keep provider names out of app code