Skip to main content

spec_stream_core/
lib.rs

1//! # spec-stream-core
2//!
3//! Core primitives, data structures, and mathematical verification algorithms for
4//! speculative decoding in high-throughput Large Language Model (LLM) inference.
5//!
6//! Designed to be model-agnostic, zero-allocation where possible, and strictly compliant
7//! with exact output probability distributions (Leviathan et al., 2023).
8
9pub mod error;
10pub mod logits;
11pub mod metrics;
12pub mod tokenizer;
13pub mod tree;
14pub mod types;
15pub mod verifier;
16
17pub use error::CoreError;
18pub use logits::{Logits, TokenId};
19pub use metrics::SpeculativeMetrics;
20pub use tokenizer::{ByteLevelTokenizer, Tokenizer};
21pub use tree::{SpeculativeTree, TreeNode, TreeVerificationResult};
22pub use types::{
23    DraftProposal, SamplingParams, TokenCandidate, VerificationResult, VerificationStrategy,
24};
25pub use verifier::SpeculativeVerifier;