Module engine

Module engine 

Source
Expand description

Inference engine — generate loop for a single request.

Orchestrates prefill → decode → sample loop using the Model trait. The engine is stateless — each call to generate creates a fresh sequence, runs inference, and returns output tokens.

Structs§

GenerateResult
Result of a generate call.

Functions§

generate
Generate response tokens from a prompt.
generate_speculative
Generate with speculative decoding (MTP).
generate_streaming
Generate response tokens with per-token callback.