Skip to content
pi-c Artifact [8b2842e8a4]
Login

Artifact [8b2842e8a4]

Artifact 8b2842e8a42ebbdecd4a34dc56bd005724a8515958704ace94c00051c7ae873e:


# 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](../reference/env.md)) or the credential store; OpenAI and OpenRouter can instead be
signed in to with a subscription ([sign-in](sign-in.md)). 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,
`/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. 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.

## Profiles

A profile is a name for a model, one of its provider's keys and a thinking level, so one word
switches all three:

```sh
pic profiles set work --model openai/o4-mini --key work --thinking high
pic --model work -p 'read the diff'
```

`--model NAME`, `/model NAME` in the terminal interface, RPC's `set_model` with `profile` and a
phone take a profile's name wherever they take a model. `--key` and `--thinking` given with it
win; a level the model does not take becomes the nearest one it does. A profile's name may not be a
provider's. `pic profiles` lists them, and `pic profiles remove NAME` forgets one.

## A conversation keeps its own

Going on with a conversation (`pic -p -c`, `--session`, `--session-id`, `pic ask --session`,
`pic tui -c`, `/resume`, and `--session` or `switch_session` over RPC) uses the model, key and
thinking level its last request ran with, not the saved default, and says so: `model
openrouter/deepseek/deepseek-v4.1-flash (this conversation's own; --model to change)`, naming the
key when it is not the provider's active one. A fork goes on with the conversation it came from.
`--model` and `--key` still win for one run, and that run becomes the conversation's own.

When its model or key cannot be had now (the provider has no key, the named key was removed, or pic
no longer knows the model), pic never moves it to another model in silence. `-p` and `ask` stop
with one line that names it and the way on, and send nothing:

```
pic: this conversation ran on openai/o4-mini, and openai has no key now; pic auth login adds
one, or --model NAME goes on with another
```

The terminal interface says the same in one line, with the model the next message goes to and
`/model` to pick another; RPC says it on stderr and keeps its model until `set_model`. `pic sessions
--json` gives each conversation's own as `model`, `credential` (`provider:label`) and `thinking`.

## With no saved default

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

The picker opens in the same place as [the settings panel](settings-panel.md): a box over the
conversation in fullscreen, the rows above the footer otherwise. It opens at any time, while a reply
streams too. The reply keeps arriving and keeps its model; a model you choose then is used from the
next message, and the picker says so before you press Enter. While it is open your keys go to it
alone, never to the editor or the reply; Esc or Ctrl+C closes it without stopping anything. Where
fullscreen has the mouse, the wheel moves the selection and a click selects a model.

With nothing typed, the picker shows a short list of suggestions (below), the model in use ticked
and selected, and ends with "type to search all N models". Each row has the model's id, its name,
its price per million tokens (input/output) and a mark: default, no key, key refused, out of credit,
rate-limited, ChatGPT plan, or the endpoint it came from. Under the list are the selected model's
context size and what Enter will do. Typing searches every model, those with no key too, after the
ones you can use; exact and prefix matches come first. When nothing matches the picker says so and
stays open. Enter uses the selected model; 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`.

### Which models the picker suggests

1. The model in use and your default, then the models you sent to lately, newest first, from this
   workspace's conversations and those of the workspaces you used last ("In use and recent").
2. Then, for each provider whose key works, the newest model of each family, a few per provider:
   dated snapshots and "latest" names count as one model, and an older generation gives way to the
   newer one (Claude Opus 4.6, not 4.5).
3. A provider that offers other labs' models, as OpenRouter does, shows only its well-known
   flagships (Claude Opus and Sonnet, GPT, Gemini Pro, DeepSeek Flash, Grok, Kimi and GLM, each at
   its newest) and the ones you used.

Models whose key was refused, is out of credit or is rate-limited show only when you type, unless
one is the model in use.

`/model NAME` switches at once when one model clearly matches: the only one named exactly, or the
only one with a key whose name has NAME in it (`/model haiku-5-5`). With several it opens the picker
on them; with none it opens the picker saying so. In the slash menu, Enter on the only model it
offers, or on one chosen with the arrows, switches to it.

## Saved endpoints

An OpenAI-compatible server you run or reach, such as a local proxy, can be saved by its address
instead of written into `models.json`: `pic endpoints add proxy http://127.0.0.1:8317/v1`, or "Add
an endpoint" in `/model`. pic fetches the server's model list (`URL/models`) then, and again only
when you ask, with `pic endpoints refresh [NAME]` or "Refresh endpoint models" in the picker. Its
models join the picker, `pic models` and RPC as `NAME/MODEL`, marked "from NAME", and requests to
them go to the server's chat completions. A key, if the server needs one, is typed with `--key`
(echo off, or a line of stdin) and sealed in the credential store under the endpoint's name.

An endpoint never replaces a provider: its name cannot be one pic already has, and adding one
changes no other model, key or your default. Choosing one of its models is like choosing any
other: with `rememberModel` on, new conversations start on it. A failed refresh keeps the list
it had and `pic endpoints list` says why. pic lists what the server says it has and does not
check that each model answers; one it cannot serve fails when you send to it. `pic endpoints
remove NAME` forgets the endpoint and its 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, and neither does the setting `offline` (`pic settings
offline true`), which also stops the free checks of keys. 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](credentials.md)).

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