Skip to content

vox-orchestrator-models API Reference (generated)

Crate: vox-orchestrator-models · Version: 0.6.0 · Target: Library (lib.rs)

Model selection, calibration, usage accounting, and provider catalogs for vox-orchestrator.

Model calibration, usage accounting, and budget policy types for the Vox orchestrator.

FeatureDefault / Enables
dbdep:vox-db
defaultdb
DependencyKind
vox-bounded-fsNormal
vox-configNormal
vox-dbNormal
vox-orchestrator-typesNormal
vox-secretsNormal
vox-telemetryNormal
ModuleDescription
calibration—
routing_task—
usage—
usage_policy—
vram_probe—
Dependency Topology, diagram 18 nodes, 7 edges: vox-orchestrator-models → vox-bounded-fs; vox-orchestrator-models → vox-config; vox-orchestrator-models → vox-db; vox-orchestrator-models → vox-orchestrator-types; vox-orchestrator-models → vox-secrets; vox-orchestrator-models → vox-telemetry; vox-orchestrator → vox-orchestrator-m…vox-orchestrator-modelsvox-bounded-fsvox-configvox-dbvox-orchestrator-typesvox-secretsvox-telemetryvox-orchestrator
Diagram source
graph {
direction: right
node vox_orchestrator_models: "vox-orchestrator-models"
node vox_bounded_fs: "vox-bounded-fs"
vox_orchestrator_models -> vox_bounded_fs
node vox_config: "vox-config"
vox_orchestrator_models -> vox_config
node vox_db: "vox-db"
vox_orchestrator_models -> vox_db
node vox_orchestrator_types: "vox-orchestrator-types"
vox_orchestrator_models -> vox_orchestrator_types
node vox_secrets: "vox-secrets"
vox_orchestrator_models -> vox_secrets
node vox_telemetry: "vox-telemetry"
vox_orchestrator_models -> vox_telemetry
node vox_orchestrator: "vox-orchestrator"
vox_orchestrator -> vox_orchestrator_models
}
Consumer CrateRole
vox-orchestratorDirect workspace dependent
KindSymbolSignatureSourceDescription
structcalibration::RunningStatspub struct RunningStatscrates/vox-orchestrator-models/src/calibration.rs#L17-L21Running mean and variance via Welford’s online algorithm.
fncalibration::updatepub fn update(&mut self, x: f64)crates/vox-orchestrator-models/src/calibration.rs#L26-L32Update with a new observation.
fncalibration::variancepub fn variance(&self) -> f64crates/vox-orchestrator-models/src/calibration.rs#L37-L43Sample variance (unbiased). Returns 0.0 when count < 2.
fncalibration::std_devpub fn std_dev(&self) -> f64crates/vox-orchestrator-models/src/calibration.rs#L48-L50Sample standard deviation. Returns 0.0 when count < 2.
fncalibration::z_scorepub fn z_score(&self, x: f64) -> f64crates/vox-orchestrator-models/src/calibration.rs#L56-L63Z-score of a new observation against the current baseline. Returns 0.0 when std_dev is zero.
structcalibration::CalibrationConfigpub struct CalibrationConfigcrates/vox-orchestrator-models/src/calibration.rs#L70-L75Configuration for the calibration loop.
structcalibration::CalibrationOutcomepub struct CalibrationOutcomecrates/vox-orchestrator-models/src/calibration.rs#L88-L92Outcome of a calibration check.
structcalibration::CalibrationLooppub struct CalibrationLoopcrates/vox-orchestrator-models/src/calibration.rs#L95-L98Online calibration loop wrapping [RunningStats].
fncalibration::newpub fn new(config: CalibrationConfig) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L101-L106—
fncalibration::observepub fn observe(&mut self, value: f64) -> CalibrationOutcomecrates/vox-orchestrator-models/src/calibration.rs#L110-L124Record a new observation and check for drift.
fncalibration::statspub fn stats(&self) -> &RunningStatscrates/vox-orchestrator-models/src/calibration.rs#L126-L128—
structcalibration::BanditArmpub struct BanditArmcrates/vox-orchestrator-models/src/calibration.rs#L135-L139A single bandit arm tracking a Beta posterior.
fncalibration::newpub fn new(model_id: impl Into<String>) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L142-L148—
fncalibration::expected_rewardpub fn expected_reward(&self) -> f64crates/vox-orchestrator-models/src/calibration.rs#L153-L157Expected reward under Beta(α=successes+1, β=failures+1): mean = α/(α+β).
fncalibration::recordpub fn record(&mut self, success: bool)crates/vox-orchestrator-models/src/calibration.rs#L159-L165—
structcalibration::ContextualBanditpub struct ContextualBanditcrates/vox-orchestrator-models/src/calibration.rs#L172-L174Greedy contextual bandit over a set of model arms. Picks the arm with the highest expected reward under its Beta posterior. Stochastic exploration is delegated to routing::engine (Thompson draws) so this module stays pure and deterministic — no RNG required, no I/O.
fncalibration::newpub fn new(arms: Vec<BanditArm>) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L177-L179—
fncalibration::selectpub fn select(&self) -> Option<&BanditArm>crates/vox-orchestrator-models/src/calibration.rs#L183-L189Select the arm with highest expected reward. Returns None if no arms.
fncalibration::record_outcomepub fn record_outcome(&mut self, model_id: &str, success: bool)crates/vox-orchestrator-models/src/calibration.rs#L192-L196Record an outcome for the arm identified by model_id.
fncalibration::armspub fn arms(&self) -> &[BanditArm]crates/vox-orchestrator-models/src/calibration.rs#L198-L200—
fncalibration::arm_stats_from_banditpub fn arm_stats_from_bandit(bandit: &ContextualBandit) -> HashMap<String, (u32, u32)>crates/vox-orchestrator-models/src/calibration.rs#L204-L210—
structcalibration::CalibrationRunEventpub struct CalibrationRunEventcrates/vox-orchestrator-models/src/calibration.rs#L216-L221Serialize-only — &'static str is incompatible with Deserialize and round-tripping isn’t needed.
fncalibration::newpub fn new(outcome: &CalibrationOutcome, session_id: Option<String>) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L224-L231—
structcalibration::DriftAlertEventpub struct DriftAlertEventcrates/vox-orchestrator-models/src/calibration.rs#L236-L240Serialize-only — see CalibrationRunEvent for rationale.
fncalibration::newpub fn new(z_score: f64, session_id: Option<String>) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L243-L249—
structcalibration::BanditUpdateEventpub struct BanditUpdateEventcrates/vox-orchestrator-models/src/calibration.rs#L254-L260Serialize-only — see CalibrationRunEvent for rationale.
fncalibration::newpub fn new(arm: &BanditArm, success: bool, session_id: Option<String>) -> Selfcrates/vox-orchestrator-models/src/calibration.rs#L263-L271—
structrouting_task::RoutingTaskpub struct RoutingTaskcrates/vox-orchestrator-models/src/routing_task.rs#L5-L12Narrow view of a task used for model routing and selection.
fnrouting_task::estimated_token_countpub fn estimated_token_count(&self) -> u64crates/vox-orchestrator-models/src/routing_task.rs#L17-L26Predict the number of tokens this task will consume based on its complexity and category.
structusage::LlmUsageKeypub struct LlmUsageKeycrates/vox-orchestrator-models/src/usage.rs#L19-L24Keys rows in provider_usage / LIMITS for gating and accounting (not the API model slug).
structusage::UsageRecordpub struct UsageRecordcrates/vox-orchestrator-models/src/usage.rs#L28-L64A single day’s usage record for a provider+model pair.
structusage::RemainingBudgetpub struct RemainingBudgetcrates/vox-orchestrator-models/src/usage.rs#L68-L83Remaining budget for a provider.
structusage::ProviderRecommendationpub struct ProviderRecommendationcrates/vox-orchestrator-models/src/usage.rs#L87-L96Provider recommendation with reasoning.
structusage::CostSummarypub struct CostSummarycrates/vox-orchestrator-models/src/usage.rs#L100-L107Cost summary over a time period.
structusage::ProviderCostpub struct ProviderCostcrates/vox-orchestrator-models/src/usage.rs#L111-L118One row in [CostSummary::by_provider].
structusage::ModelCostpub struct ModelCostcrates/vox-orchestrator-models/src/usage.rs#L122-L133Per-model cost breakdown row.
structusage::CategoryCostpub struct CategoryCostcrates/vox-orchestrator-models/src/usage.rs#L137-L144Per-task-category cost breakdown row.
structusage::UnifiedCostSummarypub struct UnifiedCostSummarycrates/vox-orchestrator-models/src/usage.rs#L148-L159Unified cost summary merging cloud and local inference spend.
structusage::UsageTrackerpub struct UsageTracker<'a>crates/vox-orchestrator-models/src/usage.rs#L163-L167Tracks API usage per provider in VoxDB.
fnusage::new_refpub fn new_ref(db: &'a vox_db::VoxDb) -> Selfcrates/vox-orchestrator-models/src/usage.rs#L172-L177Create a new tracker backed by a borrowed VoxDB instance.
fnusage::with_userpub fn with_user(db: &'a vox_db::VoxDb, user_id: &str) -> Selfcrates/vox-orchestrator-models/src/usage.rs#L180-L185Same as [Self::new_ref] but scopes persisted rows to user_id.
fnusage::record_callpub async fn record_call(crates/vox-orchestrator-models/src/usage.rs#L207Record a successful API call.
fnusage::record_call_detailedpub async fn record_call_detailed(crates/vox-orchestrator-models/src/usage.rs#L234Record a successful API call with detailed reconciliation metadata.
fnusage::mark_rate_limitedpub async fn mark_rate_limited(crates/vox-orchestrator-models/src/usage.rs#L314Mark a provider as rate-limited right now.
fnusage::get_calls_todaypub async fn get_calls_today(crates/vox-orchestrator-models/src/usage.rs#L358Get calls made today for a specific provider.