Dynamic Capacity Routing
Defines a multidimensional model-selection and routing mechanism based on static and dynamic Capacity Vectors.
1. Purpose
Hardcoding a specific model name is brittle against model evolution and availability changes. AIKernel abstracts models as bundles of reasoning capability and compute characteristics, and provides:
- Model-agnostic abstraction: define required capabilities (logic, creativity, latency, rigidity) and dynamically resolve best-fit models.
- Runtime-context adaptation: select execution lanes using dynamic constraints such as budget state, hardware load, and latency conditions.
- Cost/quality optimization: automatically route routine tasks to lighter models when high-cost models are unnecessary.
2. Capacity Vector Model
AIKernel treats model capability as coordinates in a multidimensional vector space.
2.1 Static Capacity
Relatively stable, model-intrinsic indicators.
Logic_Depth: reasoning, coding, and mathematical depth.Creative_Fluency: expressive diversity and language naturalness.Constraint_Rigidity: compliance with system constraints and structured output formats.Knowledge_Cutoff: recency of learned knowledge.
2.2 Dynamic Capacity
Indicators that vary by runtime and contract conditions.
Token_Economic_Efficiency: cost fitness against remaining budget.Latency_Score: current response speed and throughput stability.Hardware_Locality: suitability for edge vs cloud execution locality.
3. Core Contracts
3.1 ModelCapacityVector and ICapacityAxis
- Responsibility: immutable container for static capability values.
- Definition: each axis is normalized to
0.0..1.0for comparable scoring.
3.2 IDynamicCapacityProvider
- Responsibility: observe runtime conditions (rate limits, budget burn, system load) and supply
IDynamicCapacityVector.
3.3 IVectorMatcher
- Responsibility: compare required vectors (task needs) against candidate vectors (providers/models) and compute fit scores.
- Note: supports weighted scoring and hard-gate filters, not only naive distance.
3.4 IModelVectorRouter
- Responsibility: choose the final
IModelProviderfrom matcher results and establish the execution path.
4. Routing Rules
- Intent-based requirement build: before execution,
IKernelderives minimum logic depth, maximum cost, and other constraints from task metadata. - Dynamic override: when security constraints or severe budget pressure occur, dynamic axes may override static capability preference.
- Fallback strategy: if the best-fit model is unavailable (for example rate limited),
IModelVectorRouterretries with the next viable candidate or degrades gracefully.
5. Fail-Closed Rule
AIKernel does not continue with underqualified models.
- Requirement miss stop: if no candidate meets mandatory-axis thresholds, execution is denied.
- Explicit routing failure: return which axes were insufficient (for example required
Logic_Depth >= 0.8, best available0.6). - Budget hard-stop: when
IDynamicCapacityProviderdetects budget hard limit, all downstream routing is blocked.
6. Mathematical Concept (Intuition)
$$Score = \sum_{i \in Axes} (Requirement_i \times Capability_i \times Weight_i)$$
Note: in practice, AIKernel combines linear scoring with blocking filters that force score to zero when critical axes (for example Security_Level) are below required thresholds.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/10.DYNAMIC_CAPACITY_ROUTING.md