Skip to main content

qualia_core_db/inference/runtime/
mod.rs

1//! Prepared native inference runtime.
2//!
3//! This library is the plan/run boundary for production inference. Model discovery,
4//! compilation, immutable upload, receipts, and artifact management are cold control-plane
5//! work. A prepared backend's decode step is the Tier-1 zero-heap data plane.
6
7pub mod artifacts;
8pub mod budget;
9pub mod graph_assist;
10pub mod kv;
11pub mod memory_guard;
12#[cfg(target_os = "windows")]
13pub mod memory_windows;
14pub mod prepared;
15pub mod receipt;
16pub mod scheduler;
17pub mod stage;
18
19pub use budget::{
20    BlockGeometry, BudgetError, MemoryPoolBudget, ModelMemoryProfile, RequestReservation,
21};
22pub use memory_guard::{
23    HostMemorySample, MemoryPolicyError, MemoryPressureAction, MemoryPressureGuard,
24    MemoryPressurePolicy,
25};
26#[cfg(target_os = "windows")]
27pub use memory_windows::{
28    apply_windows_memory_pressure, sample_current_process, WindowsLowMemoryNotification,
29    WindowsMemoryError,
30};
31
32pub use artifacts::{
33    cleanup_stale_runs, ArtifactError, ArtifactFinish, ArtifactRetention, ArtifactStats,
34    RunArtifactDir, StaleCleanupReport,
35};
36pub use prepared::{
37    DecodeStepError, DecodeStepInput, DecodeStepOutput, PreparedBackend, PreparedDecodePlan,
38    PreparedPlanState,
39};
40pub use receipt::{
41    capture_source_provenance, sha256_file, sha256_token_ids, ArtifactCleanupCounters, BackendKind,
42    BenchmarkManifest, ExecutionCounters, ExecutionReceipt, SourceProvenance,
43    MANIFEST_SCHEMA_VERSION, RAW_GREEDY_DECODE_POLICY, RECEIPT_SCHEMA_VERSION,
44};
45pub use scheduler::{Admission, RequestScheduler, RequestState, RequestView, SchedulerError};
46pub use stage::{
47    last_stage_trace, set_last_stage_trace, take_last_stage_trace, InferenceStageKind, StageStatus,
48    StageTimingReceipt, StageTrace, ThinkingEvent, ThinkingTracker, STAGE_TRACE_CAPACITY,
49};
50
51#[cfg(test)]
52mod migration_contract_tests;