Skip to main content

inference_core/
lib.rs

1//! # inference-core
2//!
3//! Foundation types for the rakka-inference workspace. Per architecture
4//! doc v4 §10.4 this crate has no actor-system dependencies — only
5//! serde / thiserror / bytes / secrecy (plus the documented `async-trait`
6//! exception for the `ModelRunner` trait).
7//!
8//! Everything in here is consumed by `inference-runtime` (actor
9//! implementations) and the per-runtime crates. Authors of new runtime
10//! backends only need to depend on this crate to satisfy the
11//! [`ModelRunner`] contract.
12
13#![forbid(unsafe_code)]
14#![deny(rust_2018_idioms)]
15
16pub mod batch;
17pub mod cost;
18pub mod deployment;
19pub mod error;
20pub mod registry;
21pub mod runner;
22pub mod runtime;
23pub mod tokens;
24
25pub use batch::{ExecuteBatch, Message, MessageContent, Role, SamplingParams};
26pub use cost::{CostEstimate, EstimateCost};
27pub use deployment::{
28    Budget, BudgetAction, CapacityPolicy, Deployment, RateLimits, Replica, RetryPolicy, Serving, Timeouts,
29};
30pub use error::{InferenceError, InferenceResult};
31pub use registry::infer_runtime;
32pub use runner::{ModelRunner, RunHandle, SessionRebuildCause, WeightSource};
33pub use runtime::{
34    CircuitBreakerConfig, JitterKind, ProviderKind, RuntimeConfig, RuntimeKind, TransportKind,
35};
36pub use tokens::{FinishReason, TokenChunk, TokenUsage, Tokens};
37
38/// Re-export of [`secrecy::SecretString`] so consumer crates do not need
39/// to take a direct dependency on `secrecy`. Architecturally significant:
40/// credentials are part of the type system from the bottom up (doc §12.5).
41pub type SecretString = secrecy::SecretString;
42pub use secrecy::{ExposeSecret, SecretBox};