Skip to main content

Module model

Module model 

Source
Expand description

Runtime model handles for the concrete agent facade.

Provider authors implement CompletionModel as usual. ModelHandle erases that implementation once, when it enters the high-level agent runtime, so an Agent can replace or route models without changing its Rust type. Because completion responses are already normalized at the provider boundary, the erasure is lossless: a handle is itself a CompletionModel with the same unary and streaming behavior.

CompletionModel::capabilities is captured by value at erasure time; the handle never calls back into the provider for capability checks.

Structsยง

ModelHandle
A cloneable, opaque handle to live completion-model behavior.