API Reference

On this page

This section documents every public class and function in router, organized by module. Private members (prefixed with _) are documented only where they materially affect the behavior of a public API (e.g. _LRUTTLCache underlying CacheManager, or _with_retry underlying ExecutionEngine).

Public API surface (router/__init__)

The top-level package re-exports the following symbols as router.__all__:

SymbolModuleCategory
HierarchicalRouterrouting.hierarchicalRouter
RouterConfig, EmbeddingConfig, ScoringConfig, ExecutionConfig, CacheConfig, FeedbackConfig, ObservabilityConfigconfigConfiguration
ConfidenceLevel, ExecutionMode, AggregationStrategy, SimilarityMetricconfigEnumerations
BaseHandler, HandlerRequest, HandlerResponse, CallableHandlercore.baseCore contracts
Route, RouteKeywordscore.routeCore
RouteGroup, make_rag_group, make_tools_group, make_chat_groupcore.route_groupCore
RoutingResult, RouteCandidate, RoutingTrace, MultiRoutingResultcore.resultResults
FeedbackEngine, CacheManagerfeedback.engine, cache.managerAdvanced components

Some classes are available in their respective submodules but not re-exported at the top-level router package (import from the submodule directly):

SymbolImport path
BaseRouterrouter.core.base
ExecutionEngine, FirstWinsAggregator, MergeAggregatorrouter.execution.executor (also router.execution)
RouterStreamExecutor, StreamingRouterAdapter, RouterStreamEvent, StreamEventTyperouter.execution.streaming_executor (also router.execution, guarded by a try/except ImportError)
RoutingPipeline, EmbeddingProvider, ConfidenceEvaluatorrouter.routing.pipeline (also router.routing)
SemanticScorer, KeywordScorer, LLMScorer, HybridScorer, BaseScorerrouter.routing.scorers (also router.routing, except BaseScorer which is not in routing/__init__.py's __all__)
FeedbackRecord, RouteFeedbackStaterouter.feedback.engine (also router.feedback)
RouterLogger, MetricsCollector, RouteStatsrouter.observability.observability (also router.observability)

Module index

Related pages