Expand description
2026-09-25: A greedy generate loop for one request over the Model
trait: prefill, then decode, taking each token with argmax_on_device.
Owner: metrale-model-engine. Invariants:
- The engine holds no state:
generateandgenerate_streamingallocate a fresh sequence per call and callfree_sequenceon it whether generation returnedOkorErr.
Structs§
- Generate
Result - 2026-09-25: Result of a generate call.
Functions§
- generate
- 2026-09-25: Generate response tokens from a prompt.
- generate_
speculative - 2026-09-25: Generate with MTP speculative decoding, delegated to
Model::generate_speculative. - generate_
streaming - 2026-09-25: Same as
generate, but callson_token(token_id)synchronously after each token, the prefill token included.