o1, o3, o4, gpt-5.x) accept a different set of parameters — PraisonAI detects them automatically and normalises your Agent(...) config so the same code just works.
Quick Start
1
Use a reasoning model
2
Cap the response length
max_tokens=... — on reasoning models it is rewritten to max_completion_tokens before the request.How It Works
PraisonAI checks the model before every call and rewrites parameters only when the model is a reasoning model.Recognised Models
Detection uses two paths, in order:- Primary:
litellm.supports_reasoning(model=model_name)when litellm is installed and exposes the helper. - Fallback: strip the provider prefix (e.g.
openai/,azure/) and match the lowercase prefix —o1,o3,o4, orgpt-5.
functools.lru_cache(maxsize=256).
Provider prefixes are stripped before matching:
openai/o3-mini → o3-mini.Parameter Behaviour
On a reasoning model, PraisonAI rewrites and drops parameters as follows.Which Parameters Should I Set?
Pick your parameters based on the model you chose.Common Patterns
Mix reasoning and chat models in one team — each agent normalizes independently based on its own model.max_completion_tokens when you want it to win over max_tokens.
Best Practices
Don't set temperature or top_p on reasoning models
Don't set temperature or top_p on reasoning models
They are silently dropped. If you rely on determinism or creative sampling, prefer a chat model such as
gpt-4o.Prefer max_completion_tokens when you want to be explicit
Prefer max_completion_tokens when you want to be explicit
It always wins over
max_tokens on reasoning models, so there is no ambiguity about which limit applies.Test model swaps before deploying
Test model swaps before deploying
Swapping
gpt-4o → gpt-5 silently drops your sampling params. Behaviour differs even though no error is raised — verify output quality first.Use LiteLLM's latest release when possible
Use LiteLLM's latest release when possible
Detection prefers
litellm.supports_reasoning(). The prefix fallback only covers the o1/o3/o4/gpt-5 families, so newer models are recognised sooner with an up-to-date litellm.Related
Reasoning
Step-by-step reasoning as a technique.
Model Capabilities
Capability detection helpers, including
is_reasoning_model().Thinking Budgets
Budget reasoning tokens for controllable cost.
OpenAI Quickstart
First-time setup with OpenAI models.

