Skip to main content

Module llm

Module llm 

Source
Expand description

Optional: let a model phrase the reply.

Off unless serve --llm is asked for and a key is in the environment. The board itself never goes near the model — ids, counts and state transitions are computed in crate::agent and the model is handed the finished sentence to rewrite. That is deliberate: a dogfood app whose assertions depend on a model is a dogfood app that cannot be tested.

Same wire format and the same environment variables as e2e/src/llm.rs, and the same point: an OpenAI-compatible /chat/completions endpoint reached with reqwest and two serde structs. There is no LLM crate here either.

Structs§

MissingApiKey
Voice::from_env found no API key, and the endpoint needs one.
Voice
A model that rephrases the agent’s replies.

Constants§

API_KEY_ENV
The environment variable holding the API key.
BASE_URL_ENV
The environment variable holding the base URL.
DEFAULT_BASE_URL
Where requests go unless BASE_URL_ENV says otherwise.
DEFAULT_MODEL
The model this talks to by default. Pinned, never a *-latest alias.
FALLBACK_API_KEY_ENV
Read when API_KEY_ENV is unset — the default endpoint is Gemini’s.
MODEL_ENV
The environment variable holding the model id.
QWEN_API_KEY_ENV
The key that goes with QWEN_BASE_URL_ENV.
QWEN_BASE_URL_ENV
Qwen Cloud’s OpenAI-compatible mode, read when BASE_URL_ENV is unset: the base URL, its key, and its model, in that order.
QWEN_DEFAULT_MODEL
The Qwen model used when QWEN_MODEL_ENV is unset. Pinned, like the default.
QWEN_MODEL_ENV
The model that goes with QWEN_BASE_URL_ENV, when MODEL_ENV is unset.