Expand description
LLM stream-function seam + default rig (OpenAI-compatible) adapter.
This module is the only place rig types appear in the kernel. A
StreamFn turns harness conversation context into a LlmStream of
LlmStreamEvents; rig_stream_fn is the default implementation built
on rig’s Chat Completions API client.
Structs§
- LlmOpts
- LlmProfile
- A per-model provider profile: how to reach the model when it differs from
the launch provider. Every field is optional —
Nonemeans “leave the launch provider’s value”, so an empty profile is a no-op and a profile may override onlybase_urlwithout resetting the endpoint. - LlmProvider
- The provider a session starts on — what a model switch falls back to when the
model has no
[models.<id>]entry. Captured at boot AFTER env/flag overrides, so flags/env/config globals define the DEFAULT provider. - Model
Profiles id → provider profileresolved once at boot from[models.<id>], plus the launch provider (base) an unmapped model falls back to. TheDefault(no base) does NOT manage providers: every operation is a no-op, so a bare kernel embedder’sLlmOpts::default()is never touched. ABTreeMap(notHashMap) keeps debug/--dump-*output deterministic.- Retry
Policy - Retry policy for a stream call: the transient-connect retries plus the stall (idle / time-to-first-token) timeouts.
Enums§
- Endpoint
Pref - Whether the wire endpoint is FIXED (
Pinned) or DERIVED from the model catalog (Auto). Carried byLlmProvider(below) sosettlecan resolve it against the SETTLED base_url + model — the fix for a mid-session switch.LlmOpts.endpointstays a concreteLlmEndpoint: it is the RESOLVED value, written bysettle/to_llm_opts, soopen_streamis untouched. - LlmEndpoint
Functions§
- list_
models - List models via
GET {base_url}/modelsusing the same client config as streaming. Ids are sorted for stable display. The endpoint only returns id/name metadata — no capability flags — so effort support stays user-managed. - probe_
endpoint - Probe
base_urlfor a live OpenAI-compatible endpoint:GET {base_url}/modelsunder a hardtimeout.trueiff the endpoint answered with a model list (an empty list still counts — the endpoint is up). Any error (refused, DNS, non-2xx, timeout) isfalse; the caller treatsfalseas “not this endpoint” and moves on. - rig_
stream_ fn - Default adapter: OpenAI-compatible Chat Completions endpoint via rig.