Skip to main content

Module model

Module model 

Source
Expand description

Model trait — protocol-agnostic LLM backend interface.

Modules§

call_purpose
Conventional values for CallKind::Auxiliary::purpose.
input_source
Values for InputSpan::source.

Structs§

CallOrigin
Which session issued a call, and what the call is doing there.
InputMap
The composition of the user message a turn was started by.
InputSpan
ModelError
A failed model call, as the protocol client classified it.
ModelMessage
A message in the model’s conversation history.
ProviderSearch
A web search the provider runs itself, inside the call.
SearchHit
One page a provider’s own web search found.
StreamParams
Parameters for a streaming LLM call.
ToolDef
Tool definition sent to the model.
Usage
UsageTap
Usage a client has learned of a call so far — the input side, which an Anthropic stream reports when it opens — and the node the call is charged to. ModelEvent::EndTurn’s usage supersedes what was reported. Reporting to a tap nobody made does nothing.

Enums§

CallKind
Effort
How much work the model puts into a reply. DeepSeek accepts low, high and max, folding medium and xhigh into high.
MessageRole
ModelContentBlock
ModelErrorKind
What kind of failure a model call had. Assigned once, by the protocol client that saw it; everything above reads it.
ModelEvent
ThinkingMode
Model thinking/reasoning mode.

Constants§

IMAGE_TOKEN_ESTIMATE
Token cost to charge a ModelContentBlock::Image in context-budget estimates.

Traits§

Model
Protocol-agnostic LLM client trait.

Functions§

document_token_estimate
Token cost to charge a ModelContentBlock::Document: a PDF is billed as its text plus a picture per page, roughly 3000 tokens per ~50 KB page, so the estimate follows the decoded size and never drops below an image’s.

Type Aliases§

ModelStream
OnSpent
Told what a metered call used, once.