1#![cfg_attr(
6 target_arch = "aarch64",
7 feature(stdarch_aarch64_prefetch, stdarch_neon_i8mm)
8)]
9
10pub const VERSION: &str = env!("CARGO_PKG_VERSION");
15
16pub const GIT_SHA: &str = env!("CERA_GIT_SHA");
20
21pub fn build_info() -> String {
26 format!("{VERSION}+{GIT_SHA}")
27}
28
29pub mod audio_engine;
30pub mod backend;
31pub mod bundle;
32pub mod classifier;
33pub mod convert;
34pub mod engine;
35#[allow(warnings)]
38mod generated {
39 include!("generated/kv_cache_generated.rs");
40}
41pub mod gguf;
42pub mod grammar;
43pub mod kv_cache;
44pub mod lora;
45pub mod manifest;
46pub mod model;
47pub mod par;
48pub mod quant;
49pub mod sampler;
50pub mod session;
51pub mod spec;
52pub mod sysmem;
53pub mod tensor;
54pub mod time;
55pub mod tokenizer;
56pub mod tools;
57pub mod turboquant;
58pub mod vad;
59
60pub use backend::cpu_features::{CpuFeatures, CpuTier, cpu_features, cpu_tier};
64pub use classifier::{
65 BioesPrefix, EntitySpan, detect_pii, extract_spans, parse_bioes, viterbi_decode,
66};
67pub use engine::{
68 BackendPreference, CeraEngine, EngineConfig, ModelBytes, ModelFiles, ModelMetadata,
69};
70pub use model::whisper::{
71 Conv1dWeights, WHISPER_CATALOG, WhisperConfig, WhisperDecoderBlockWeights,
72 WhisperDecoderWeights, WhisperEncoderBlockWeights, WhisperEncoderWeights, WhisperModel,
73 WhisperModelCatalogEntry, WhisperSpecialTokens, WhisperTranscribeOpts, WhisperWeights,
74 find_whisper_catalog_entry, is_whisper_gguf, transcribe_pcm, transcribe_pcm_with_tokens,
75};
76pub use session::{
77 CeraError, FinishReason, GenerateOpts, GenerateSummary, ModalityCapabilities, ModalitySink,
78 Session, SessionConfig, SpecDecode,
79};
80pub use sysmem::{available_memory_bytes, fits_in_available_memory};
81pub use vad::{SileroVad, SpeechTimestamp, VadConfig, VadEvent, VadIterator, VadSampleRate};
82
83#[cfg(test)]
84mod build_info_tests {
85 use super::*;
86
87 #[test]
88 fn build_info_is_version_plus_sha() {
89 let info = build_info();
90 assert_eq!(info, format!("{VERSION}+{GIT_SHA}"));
91 let (ver, sha) = info.split_once('+').expect("build_info has a '+'");
93 assert_eq!(ver, VERSION);
94 assert!(!sha.is_empty());
95 }
96}