Skip to main content
When you don’t specify a model, the CLI picks the best one automatically based on which API keys you have. A one-line notice tells you what was chosen and why.
The user omits --model; the CLI picks the best credential-backed model and prints what it chose.

How It Works

Resolution Order

Quick Start

1

Auto-pick model from credentials

Set your API key and run any command — no --model needed:
The one-line notice only appears when a provider-inferred default is used (not when using the MRU or an explicit override).
2

Override for a single run

This model is saved as the most-recently-used and will be the default for the next run.
3

Pin the model for the project

Add a .praison.json to your project root:
Every praisonai command in this directory now uses this model.
4

Check with praisonai doctor

Shows which credentials are present and which model would be selected on the next zero-config run.

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:
This honours PRAISONAI_HOME ($PRAISONAI_HOME/state/model.json when set). The legacy ~/.praison/state/model.json is still read as a fallback. Content:
To reset it (force credential-based re-inference):
Or simply run with an explicit --model — that overwrites the MRU automatically.

Best Practices

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.
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.
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.

CLI OAuth Login

Sign in to providers using browser-based OAuth

Models CLI

List, compare, and switch between available models