Agent(llm=None) path — construct an Agent with no llm= and it picks from your credentials too.
PR #5412 made the credential default capability-ranked best-available per provider; PR #5750 hardened the ranking to exclude Responses-API-only models (like
gpt-5-pro) and rank dated snapshots below stable ids (e.g. gpt-5 beats gpt-5-2025-08-07). A run with only OPENAI_API_KEY now lands on the best stable, Chat-Completions-callable model your catalogue advertises. The provider/ prefix is preserved so routing is unchanged.--model; the CLI picks the best credential-backed model and prints what it chose.
How It Works
Resolution Order
How the ranking works
When only a credential is set, the CLI ranks every model that credential unlocks by capability (tool-use, context, reasoning, vision) and uses the best-available one — not a fixed cheap default.- Prefers tool-use (essential for agentic work).
- Excludes models whose LiteLLM
modeis notchat(e.g. OpenAI Responses-API-only ids likegpt-5-proare filtered out — the Chat Completions path can’t call them). Entries with nomodeare kept, so older cached catalogues still work. - De-prioritises unstable preview / experimental /
-autoids. - De-prioritises dated snapshot ids matching
-YYYY-MM-DDor-YYYYMMDD(e.g.gpt-5-2025-08-07,claude-3-5-haiku-20241022) so the stable alias wins. - De-prioritises
-mini/nano/small/lite/haiku/flash/3.5-turboclass ids. - Then larger
max_context, then reasoning, then vision. - Non-chat ids by name (embeddings, rerankers, speech, image, moderation, vision-encoder, clip) are also excluded from the chat default.
- Google/Gemini aliasing: a
GEMINI_API_KEY-only run still ranks litellm’sgoogle-labelled Gemini models (and vice-versa).
anthropic/<id>, gemini/<id>, cohere/<id>, openrouter/openai/<id>, etc. keep their prefix so runtime routing is unchanged. If ranking yields nothing — including when every candidate was filtered out by the mode or name gates — best_available() returns None and selection degrades to the historical fixed representative (gpt-4o-mini for OpenAI).
Quick Start
1
Auto-pick model from credentials
Set your API key and run any command — no The one-line notice only appears when a provider-inferred default is used (not when using the MRU or an explicit override).
--model needed:2
Override for a single run
3
Pin the model for the project
Add a Every
.praison.json to your project root:praisonai command in this directory now uses this model.4
Check with praisonai doctor
Resolution Order
Provider-inferred defaults (priority 4) and the
gpt-4o-mini fallback (priority 5) are intentionally not persisted as MRU. Persisting them would let a stale default win over fresh credential-based inference on a later run when your available providers have changed.
MRU State
The most-recently-used model is stored at:PRAISONAI_HOME ($PRAISONAI_HOME/state/model.json when set). The legacy ~/.praison/state/model.json is still read as a fallback.
Content:
--model — that overwrites the MRU automatically.
Best Practices
Pin the model in CI
Pin the model in CI
Don’t rely on auto-selection in automated pipelines. CI environments often have credentials for multiple providers, and the selected model can change if you add or remove a key.
Watch the transparency notice in development
Watch the transparency notice in development
The transparency notice (
No model set; using X because Y is present.) only fires for provider-inferred defaults. If you see it unexpectedly in a staging environment, your .praison.json or MODEL_NAME env var may not be set.OPENAI_MODEL_NAME is still honoured
OPENAI_MODEL_NAME is still honoured
For backward compatibility, the
OPENAI_MODEL_NAME environment variable still overrides credential-based inference. If you have a legacy .env with this variable, it takes priority over the credential probe.Why your zero-config default isn't the newest flagship
Why your zero-config default isn't the newest flagship
Two safety filters keep the default stable and callable:
- LiteLLM
modefilter. Ids the catalogue marksmode: "responses"(Responses API only) are excluded, e.g.gpt-5-pro/gpt-5-pro-2025-10-06. PR #5750. - Dated snapshot filter.
gpt-5-2025-08-07andclaude-3-5-haiku-20241022style ids rank below their stable aliases.
Agent(llm="…"), --model, or MODEL_NAME / OPENAI_MODEL_NAME.Related
CLI OAuth Login
Sign in to providers using browser-based OAuth
Models CLI
List, compare, and switch between available models

