CachyCLI
Guide05 / Models & keys
Guide · 05

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
FieldWhat it does
modelThe id sent to the service
base_urlWhere to send requests
nameHow it appears in /model
env_key / api_keyWhere the credential comes from
context_windowUsed 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

  • ▪/context shows how full the chat is.
  • ▪/compact replaces 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.