RouterConfig
Defined in: packages/ai.matey.types/src/router.ts:94
Router configuration options.
Properties
Section titled “Properties”capabilityBasedRouting?
Section titled “capabilityBasedRouting?”
readonlyoptionalcapabilityBasedRouting:boolean
Defined in: packages/ai.matey.types/src/router.ts:155
Enable capability-based routing. When enabled, the router will select backends based on their model capabilities matching the request requirements.
Default
Section titled “Default”falsecapabilityCacheDuration?
Section titled “capabilityCacheDuration?”
readonlyoptionalcapabilityCacheDuration:number
Defined in: packages/ai.matey.types/src/router.ts:178
Cache duration for model capability data in milliseconds.
Default
Section titled “Default”3600000 (1 hour)circuitBreakerThreshold?
Section titled “circuitBreakerThreshold?”
readonlyoptionalcircuitBreakerThreshold:number
Defined in: packages/ai.matey.types/src/router.ts:129
Number of consecutive failures before circuit breaker opens.
Default
Section titled “Default”5circuitBreakerTimeout?
Section titled “circuitBreakerTimeout?”
readonlyoptionalcircuitBreakerTimeout:number
Defined in: packages/ai.matey.types/src/router.ts:135
Time to wait before attempting to close circuit breaker (milliseconds).
Default
Section titled “Default”60000customFallback?
Section titled “customFallback?”
readonlyoptionalcustomFallback:CustomFallbackFunction
Defined in: packages/ai.matey.types/src/router.ts:188
Custom fallback function.
customRouter?
Section titled “customRouter?”
readonlyoptionalcustomRouter:CustomRoutingFunction
Defined in: packages/ai.matey.types/src/router.ts:183
Custom routing function.
defaultBackend?
Section titled “defaultBackend?”
readonlyoptionaldefaultBackend:string
Defined in: packages/ai.matey.types/src/router.ts:110
Default backend to use if routing doesn’t select one.
enableCircuitBreaker?
Section titled “enableCircuitBreaker?”
readonlyoptionalenableCircuitBreaker:boolean
Defined in: packages/ai.matey.types/src/router.ts:123
Enable circuit breaker pattern.
Default
Section titled “Default”falsefallbackStrategy?
Section titled “fallbackStrategy?”
readonlyoptionalfallbackStrategy:FallbackStrategy
Defined in: packages/ai.matey.types/src/router.ts:105
Fallback strategy when primary backend fails.
Default
Section titled “Default”'sequential'healthCheckInterval?
Section titled “healthCheckInterval?”
readonlyoptionalhealthCheckInterval:number
Defined in: packages/ai.matey.types/src/router.ts:117
Interval for health checking backends (milliseconds). Set to 0 to disable health checks.
Default
Section titled “Default”0modelTranslation?
Section titled “modelTranslation?”
readonlyoptionalmodelTranslation:ModelTranslationConfig
Defined in: packages/ai.matey.types/src/router.ts:195
Model translation configuration for fallback scenarios. Controls how model names are translated when falling back to different backends.
Default
Section titled “Default”{ strategy: 'hybrid', warnOnDefault: true, strictMode: false }optimization?
Section titled “optimization?”
readonlyoptionaloptimization:"cost"|"speed"|"quality"|"balanced"
Defined in: packages/ai.matey.types/src/router.ts:162
Optimization strategy for capability-based routing. Determines how to weigh cost, speed, and quality when selecting models.
Default
Section titled “Default”'balanced'optimizationWeights?
Section titled “optimizationWeights?”
readonlyoptionaloptimizationWeights:object
Defined in: packages/ai.matey.types/src/router.ts:168
Custom optimization weights for capability-based routing. Must sum to 1.0. Overrides optimization preset.
cost:
number
quality
Section titled “quality”quality:
number
speed:
number
routingStrategy?
Section titled “routingStrategy?”
readonlyoptionalroutingStrategy:RoutingStrategy
Defined in: packages/ai.matey.types/src/router.ts:99
Primary routing strategy.
Default
Section titled “Default”'explicit'trackCost?
Section titled “trackCost?”
readonlyoptionaltrackCost:boolean
Defined in: packages/ai.matey.types/src/router.ts:147
Track cost per backend (requires backends to implement estimateCost).
Default
Section titled “Default”falsetrackLatency?
Section titled “trackLatency?”
readonlyoptionaltrackLatency:boolean
Defined in: packages/ai.matey.types/src/router.ts:141
Track latency statistics per backend.
Default
Section titled “Default”true