Start with the job you need to implement. Public headers define the exact API; these guides explain integration, ownership and numerical contracts.
| Job | Guide | Main components |
|---|---|---|
| Register a model and load weights | Model loading | Spec-backed model, TensorSource, BackendWeightStore |
| Prepare, cache and release graphs | Graph lifecycle | ExecutionContext, PreparedGraph, GraphWorkspace, ConstantTensorCache |
| Compose neural blocks | Neural modules | Attention, FFN, convolution, transformer blocks |
| Execute a causal transformer | Causal decoder | CausalDecoderRuntime |
| Execute a DiT or iterative sampler | DiT and sampling | DitRuntime, DeviceDenoiserRuntime, FlowSamplerRuntime |
| Execute routed experts | MoE engine | MoeEngine, MoePreparedGraph, placement/eviction policies |
| Assemble streaming audio | Streaming audio | StreamingAudioController, session bases, chunkers |
| Prepare waveform features | Audio frontends | Mel frontends, resampling, reference preprocessing |
| Process images/video or reuse portrait architecture | Vision | Media helpers, graph modules, vision runtimes |
| Select component execution implementations | Execution plans | ComponentExecSpec, parse_exec_plan |
| Select a model variant/task implementation | Internal routing | ModelRouteTable |
| Reuse an encoder, conditioner or codec runtime | Reusable runtimes | T5, Qwen audio, RoPE encoder, CLAP, Vocos, Mimi |
| Resample, chunk, merge or retain cached objects | Shared helpers | SOXR/sinc, text/audio chunkers, overlap-add, CacheSlots |
| Persist reusable bytes | Disk cache | DiskCache |
Every component guide follows the same sections:
- Purpose and boundary
- Public API
- Integration example
- Ownership and lifecycle
- Data and mathematical contracts
- Configuration and backends
- Errors and limitations
- Callers and validation
Examples are small integration functions with explicit external inputs, not standalone model implementations. They demonstrate API use; source links and linked tests provide the implementation and validation context. A guide does not claim a model/backend combination passed merely because a shared API exists.
Document important reused components here rather than listing every module. Keep API details beside public declarations; use this template to explain how components work together. Link to real callers and independent tests. Preserve model-specific preprocessing, state and precision boundaries in the model guide.