Artifact 62bbc8131d79aab8c19e9338395bccd64eadb1a1782c84fe14ab6ba2a04b3d71:
- File
docs/manual/models.md
— part of check-in
[a49aa20f3e]
at
2026-11-23 15:38:55
on branch last-model
— Start new conversations on the model last chosen
A model picked in the terminal interface (picker, /model NAME, Ctrl+P) is saved as the default, so the next conversation, pic ask and pic -p start on it and the first line says "your last choice". --model, RPC set_model without persist and a phone save nothing; rememberModel false restores a fixed default. Ctrl+S in the picker says it is already saved. (user: dmestas, size: 3721) [annotate] [blame] [check-ins using] [more...]
Models
pic talks to Anthropic, OpenAI (Chat Completions and Responses), OpenRouter, Google and any OpenAI-compatible server, with Pi's thinking levels. One conversation can move between providers.
Providers
Built in, by the name --model takes before the slash: anthropic, openai, openrouter, google
(Gemini), xai, groq, cerebras, deepseek, together, fireworks, huggingface, nvidia,
moonshotai and zai. Each reads its key from its variable (environment
variables) or the credential store; OpenAI and OpenRouter can instead be
signed in to with a subscription (sign-in). Other providers go in models.json.
Choosing a model
--model provider/id picks the model for one command and saves nothing. In the terminal interface,
Alt+P or /model opens the picker, /model NAME switches, and Ctrl+P cycles models; whichever you
choose, the next new conversation, pic ask and pic -p start on it, and the first line says so
(your last choice). pic says this once, not at every Ctrl+P step. Resuming a conversation keeps
that conversation's own model. A model changed by a client of pic --mode rpc, or from a phone
through pic remote, saves nothing. To keep a fixed default instead, set rememberModel to false
and save the default yourself with pic models --default NAME, or with Ctrl+S in the picker (which
with rememberModel on only says it is already saved). pic models lists the models whose
provider has a key, --all every one, and --refresh fetches Pi's catalog now;
/scoped-models (or pic scoped-models --set PATTERN...) chooses the models Ctrl+P cycles.
With no saved default (or one whose provider has no key), pic starts on a provider's own default
model, going down Pi's list of providers: the first whose key worked last time, else the first whose
key has not failed, else any with a key. A key that was refused, is out of credit or is rate-limited
is passed over. The terminal interface says which model and why on its first screen, ask and -p
on stderr: model openrouter/deepseek/deepseek-v4.1-flash (OPENROUTER_API_KEY is set; anthropic's
key was refused). A saved default or last choice is always kept; when its key failed last time the line says so.
The picker shows each model's price per million tokens, input/output, and marks a provider with no
key, a refused key, no credit left, a rate limit or a ChatGPT plan. Models with no key appear once
you type, after the ones you can use; exact and prefix matches come first. Choosing one with no key
opens its login when you send. If the new model does not offer the
thinking level you had, the line names the level it uses instead. pic models --json carries the
same mark as key.
Thinking
--thinking LEVEL takes off, minimal, low, medium, high, xhigh or max, as the model supports them.
Without it pic uses the level saved for the model (thinkingLevel:MODEL), then
defaultThinkingLevel, else medium. pic models --thinking-default LEVEL saves the default;
Shift+Tab cycles levels in the terminal interface.
The catalog and models.json
The model list is Pi's catalog: a snapshot built into pic, refreshed from pi.dev when it is newer.
PIC_MODEL_CATALOG=offline never fetches it. Models and providers of your own go in
~/.pic/models.json (Pi's ~/.pi/agent/models.json is read when pic has none), in Pi's format;
PIC_MODELS_FILE names another file. A key written there comes before the provider's variable and
the credential store (credentials).
Prompt caching
The cacheRetention setting is short (the default), long (1 hour; OpenAI 24 hours) or none, as
Pi's; PI_CACHE_RETENTION=long works too.