Skip to main content

Module presets

Module presets 

Source
Expand description

Named LLM providers for drep init.

A preset stops a user having to know the OpenAI-compatible protocol - they pick “OpenRouter”, not “openai-compatible with base URL https://openrouter.ai/api/v1”. Every cloud option here speaks that protocol; the difference between them is an endpoint, a model, and which environment variable holds the key.

Model defaults are the one thing here that goes stale, which is why the wizard no longer relies on them: it asks the endpoint what it serves and uses the default only to preselect an entry (see crate::llm::models). A default the endpoint no longer offers is called out at the prompt rather than silently replaced, so a stale one here is visible instead of inherited. They remain the answer for --provider runs, which have no prompt.

max_tokens is deliberately absent. No cap is sent unless the user sets one - see the max_tokens note in crate::config. The one exception is an endpoint that refuses a request without the field, where the preset records that requirement and a value to fall back on.

temperature and max_tokens are properties of a model, not a provider, so what a preset holds for them is a starting point rather than an answer. LlmPreset::quirks turns the pair into a Quirks, which quirks::resolve then narrows against the model the user actually chose. The preset’s values are what a run falls back to whenever the registry cannot name that model - which is every offline run, every --provider run, and every model released since the cache was written.

Structs§

CodexPreset
Codex-specific preset fields.
HttpPreset
HTTP-specific preset fields.
LlmPreset
One named way to reach a model.

Enums§

PresetBackend
Backend-specific fields that cannot be combined across execution paths.

Statics§

CODEX
The installed Codex CLI using the user’s ChatGPT/Codex subscription.
CUSTOM
Any other OpenAI-compatible endpoint.
KIMI
Moonshot’s Kimi for Coding plan. Anthropic protocol, and no temperature.
LOCAL
LM Studio, Ollama or llama.cpp on this machine. No key, no cost.
MINIMAX
MiniMax’s Token Plan, over its Anthropic-compatible endpoint.
OPENAI
Directly against the OpenAI API.
OPENROUTER
One key for many providers. Good default for cloud analysis.
PRESETS
Every preset, in the order the wizard should offer them.
ZAI
z.ai’s GLM Coding Plan. OpenAI-compatible, and accepts a temperature.

Functions§

preset
Look up a preset by its key.
preset_keys
Every preset key, in PRESETS order.