Skip to main content

Module traits

Module traits 

Source
Expand description

The Model Runtime boundary: Model and Backend.

Everything above this line (crate::generate, and eventually kopitiam-ai’s real ModelAdapter — see this crate’s parent epic) is written against these two traits, not against crate::model::QwenModel directly, the same way kopitiam-workflow is written against kopitiam_ai::ModelAdapter rather than any one concrete adapter. That mirroring is deliberate: it is the same “own the boundary, not the implementation” shape CLAUDE.md’s Architecture section asks every layer of this platform to follow.

Structs§

CpuBackend
The only Backend the Kopitiam Runtime implements: plain CPU execution via kopitiam-tensor’s f32 kernels. See Backend’s docs for why this is a real (if minimal) type rather than a bare Device literal.

Traits§

Backend
The execution backend a Model runs its tensor ops on.
Model
A causal (decoder-only) language model that can run a forward pass and produce next-token logits.