Guide05 / Models & keys
Topics
Models & keys
The native backend can talk to anything that speaks the common chat API — a hosted service, a gateway your team runs, or a model on your laptop.
See what is available
$ cachycli models # list everything, with a key indicator $ cachycli doctor # is the default model reachable?
A few common services work immediately once their key is present. Local servers, such as Ollama or LM Studio, need no key at all.
Store a key
$ cachycli login --api-key sk-… $ cachycli logout # remove it again
Keys are stored in a local file with owner-only permissions. If you prefer environment variables, set them instead — a key in the environment always works.
Add your own endpoint
Settings file
[models] default = "my-model" [model.my-model] model = "the-model-id" # what the service expects base_url = "https://api.example.com/v1" name = "My Model" # what you see in the picker env_key = "MY_API_KEY" # or api_key = "…" context_window = 128000 # optional, helps with long chats
| Field | What it does |
|---|---|
| model | The id sent to the service |
| base_url | Where to send requests |
| name | How it appears in /model |
| env_key / api_key | Where the credential comes from |
| context_window | Used to warn before a chat gets too long |
Switch models
Inside the interface
/model open the picker /model my-model use it straight away # for one run only $ cachycli -m my-model -p "explain this file"
Long conversations
- ▪
/contextshows how full the chat is. - ▪
/compactreplaces the older part with a short summary so you can keep going. - ▪Automatic compaction can be tuned in settings if it happens too often or too late.
Running out of room
If a session feels slow or vague, compact it first. Summaries keep decisions and file paths; they drop the scrollback you no longer need.