Skip to main content

Module router

Module router 

Source
Expand description
Unstable (feature: router) — may change or be removed
Model auto-routing for oxicode.

Provides intelligent model selection based on conversation structure and behavioral signals. This is an opt-in feature — the user must explicitly select router/auto or another profile in model selection.

Modules§

classifier
Classifiers for routing decisions.
fallback
Fallback chain for sequential model failover.
profiles
Profile management for the router.
scoring
Scoring functions for routing decisions.
signals
Signal extraction for routing decisions. Four signal types are extracted from the conversation context:
types
Router type definitions — tiers, phases, decisions, and configuration.

Structs§

BehavioralSignal
Signals derived from recent conversation behavior.
ContextBudgetSignal
Signals derived from token budget and cost constraints.
FallbackChain
Ordered fallback chain that tries models sequentially.
MessageContentSignal
Signal derived from the structural properties of the last user message.
ProviderModel
Parsed "provider/model-id" pair.
RoutedTierConfig
Configuration for a single tier within a profile.
RouterConfig
Top-level router configuration.
RouterPipeline
Routing pipeline state for a session.
RouterProfile
A named routing profile mapping tiers to model configs.
RouterProfiles
Indexed collection of routing profiles loaded from config.
RouterProvider
Router provider implementing the Provider trait.
RouterSnapshot
Snapshot of the current router state for UI display.
RouterState
Session-scoped router state (for persistence across restarts).
RoutingDecision
A single routing decision recording what was chosen and why.
RoutingScore
Score produced by signal aggregation, mapped to a RouterTier.
ScoringWeights
Weights for combining routing signals into a composite score.
StructuralSignal
Signals derived from the structure of the conversation.
VisionSignal
Signal derived from image content in the conversation.

Enums§

DecisionMethod
How the routing decision was made.
RouterPhase
Phase of the conversation influencing routing decisions.
RouterTier
Routing tier representing model capability level.

Functions§

compute_score
Compute a composite routing score from all signals.
get_router_pin
Get the current global router pin tier.
lerp
Linear interpolation between a and b.
parse_tier_model
Parse the model field from a RoutedTierConfig.
register_router
Register the router provider and its profile models.
set_router_pin
Set the global router pin tier. Used by /router pin <tier>.