Skip to main content

cera/
lib.rs

1#![cfg_attr(
2    target_arch = "aarch64",
3    feature(stdarch_neon_dotprod, stdarch_aarch64_prefetch, stdarch_neon_i8mm)
4)]
5
6/// Crate version, sourced from `Cargo.toml` at compile time. Useful
7/// for FFI / wrapper crates that want to surface the core lib version
8/// to their consumers (e.g. `cera-wasm::ceraVersion()`) without
9/// re-reading the manifest themselves.
10pub const VERSION: &str = env!("CARGO_PKG_VERSION");
11
12pub mod audio_engine;
13pub mod backend;
14#[cfg(feature = "remote")]
15pub mod bundle;
16pub mod engine;
17/// Auto-generated FlatBuffers code for KV cache serialization.
18/// Regenerate with: `flatc --rust -o src/generated schema/kv_cache.fbs`
19#[allow(warnings)]
20mod generated {
21    include!("generated/kv_cache_generated.rs");
22}
23pub mod gguf;
24pub mod grammar;
25pub mod kv_cache;
26pub mod manifest;
27pub mod model;
28pub mod par;
29pub mod quant;
30pub mod sampler;
31pub mod session;
32pub mod tensor;
33pub mod time;
34pub mod tokenizer;
35pub mod turboquant;
36
37// Canonical public re-exports for the stateful API. Consumers should
38// `use cera::{Session, ModalitySink, ...}` rather than reaching into
39// `cera::session::*`.
40pub use backend::cpu_features::{CpuFeatures, CpuTier, cpu_features, cpu_tier};
41pub use engine::{BackendPreference, CeraEngine, EngineConfig, ModelFiles, ModelMetadata};
42pub use session::{
43    CeraError, FinishReason, GenerateOpts, GenerateSummary, ModalityCapabilities, ModalitySink,
44    Session, SessionConfig,
45};