Skip to main content

kopitiam_core/
lib.rs

1//! Core primitives for the **Kopitiam Runtime** — KOPITIAM's CPU-first,
2//! local-first, Rust-native inference engine.
3//!
4//! This crate is to the runtime what `kopitiam-ontology` is to the Semantic
5//! Runtime: shared vocabulary, no logic, no allocation strategy, no I/O.
6//! Every runtime crate (`kopitiam-tensor`, `kopitiam-loader`,
7//! `kopitiam-runtime`, and the kernel/graph/scheduler crates that follow)
8//! agrees on the types here, so none of them has to depend on each other
9//! merely to name a dtype.
10//!
11//! What lives here:
12//!
13//! * [`DType`] — element types, including the block-quantized GGUF formats.
14//! * [`Shape`] — dimensions, strides, reshape and broadcast rules.
15//! * [`Device`] — where tensors live (CPU, and only CPU, by design).
16//! * [`Error`] / [`Result`] — the runtime's single shared error type.
17//!
18//! # Relationship to `kopitiam-ai`
19//!
20//! `kopitiam-ai` owns the [`ModelAdapter`] boundary that the Semantic Runtime
21//! talks to; this crate is far below that line. `kopitiam-workflow` should
22//! never see a `DType`. The layering is:
23//!
24//! ```text
25//! kopitiam-workflow  ->  kopitiam-ai (ModelAdapter)  ->  Kopitiam Runtime  ->  this crate
26//! ```
27//!
28//! [`ModelAdapter`]: https://docs.rs/kopitiam-ai
29
30mod device;
31mod dtype;
32mod error;
33mod shape;
34
35pub use device::Device;
36pub use dtype::DType;
37pub use error::{Error, Result};
38pub use shape::Shape;