1mod kv;
9mod llama;
10mod matmul;
11mod norm;
12mod quant_linear;
13mod registry;
14mod rope;
15mod smolvlm;
16mod traits;
17
18pub use kv::{CacheConfig, CacheKind, ContiguousKVCache, KVCache, PagedKVCache};
19pub use llama::LlamaModel;
20pub use norm::rms_norm;
21pub use quant_linear::QuantizedLinear;
22pub use registry::ModelRegistry;
23pub use rope::RotaryEmbedding;
24pub use smolvlm::{SmolVlmModel, image_prompt_expansion, pixels_to_tensor};
25pub use traits::GenerativeModel;
26
27#[derive(Debug, thiserror::Error)]
29pub enum ModelError {
30 #[error(transparent)]
32 Format(#[from] combs_formats::FormatError),
33
34 #[error("unsupported architecture: {0}")]
36 UnsupportedArchitecture(String),
37
38 #[error("unsupported media input: {0}")]
40 UnsupportedMedia(String),
41
42 #[error("missing weight tensor: {0}")]
44 MissingTensor(String),
45
46 #[error("bad shape for {tensor}: expected {expected:?}, got {got:?}")]
48 BadShape {
49 tensor: String,
51 expected: Vec<usize>,
53 got: Vec<usize>,
55 },
56}
57
58pub type Result<T> = std::result::Result<T, ModelError>;