Skip to content

LLM

cratis llm configures the language model that Cratis tools use. The CLI does not talk to a language model itself — it stores the provider settings in ~/.cratis/config.json, where tools such as Prologue pick them up, for example when interpreting a captured system.

Terminal window
cratis llm use <KIND>
cratis llm show
cratis llm clear
KindDescriptionDefault model hint
anthropicAnthropic’s hosted APIclaude-opus-4-6
openaiOpenAI’s hosted APIgpt-4o-mini
localAny OpenAI-compatible endpoint running on your own machine (e.g. Ollama, LM Studio)none

Configures the provider and saves it to the configuration file. Values not passed as options are prompted for interactively when running in a terminal — the API key with hidden input, the endpoint only for local (where it is required), and the model with the provider’s default pre-filled.

OptionDescription
--api-key <KEY>API key for the provider. Required for anthropic and openai; optional for local.
--endpoint <URL>Endpoint URL. Required for local (e.g. http://localhost:11434/v1); the hosted providers use their own default endpoints.
--model <NAME>Model to use. Optional — each hosted provider has a sensible default.
Terminal window
cratis llm use anthropic
cratis llm use openai --api-key sk-... --model gpt-4o-mini
cratis llm use local --endpoint http://localhost:11434/v1 --model llama3

When the terminal is not interactive (CI, piped input), all required values must be passed as options — a missing required value fails with a validation error and a non-zero exit code.

Displays the configured provider. The API key is always masked — only the first and last four characters are shown, and keys too short to mask partially are hidden entirely. Global options such as -o/--output select the output format — see Global Options.

Removes the language model configuration, including the stored API key. Prompts for confirmation; pass -y/--yes to skip the prompt.

The settings live in the llm section of ~/.cratis/config.json:

{
"llm": {
"kind": "anthropic",
"apiKey": "sk-ant-...",
"model": "claude-opus-4-6"
}
}
ConditionResult
Unknown <KIND>Validation error listing the valid kinds.
Missing API key for anthropic/openai in a non-interactive terminalValidation error.
Missing --endpoint for local in a non-interactive terminalValidation error.