agentic-world-lab/kubecon-eu-2026-agentic-routing

Resources for talk at KubeCon + CloudNativeCon Europe 2026 Amsterdam: Intelligent Routing for Optimized Inference

Rust

4

31 commits

updated Mar 20, 2026

See the code

README

kubecon-eu-2026-agentic-routing

Resources for talk at KubeCon + CloudNativeCon Europe 2026 Amsterdam: Intelligent Routing for Optimized Inference

Intelligent Routing for Optimized Inference - Demo

Overview

This lab shows how the intelligent router classifies the domain of every LLM request and automatically selects the right model from the pool. The client sends a plain request with no routing hint; AgentGateway calls the intelligent router via ExtProc (pre-routing), which reads the body, detects the domain, and injects the x-router-selected-model header. AgentGateway then selects the HTTPRoute based on that header.

Client request  (no routing header)
        │
        ▼
AgentGateway  (port 80)
        │  gateway-level ExtProc (PreRouting) ──► Intelligent Router (:18080)
        │                                           reads body → classifies domain
        │                                           injects x-router-selected-model: gpt-4.1
        │  select_best_route() → HTTPRoute matches header
        ├─ gpt-4.1      → gpt-4-1      backend  (finance / health / legal)
        ├─ gpt-5-mini   → gpt-5-mini   backend  (science)
        └─ gpt-4.1-mini → gpt-4-1-mini backend  (technology / general)
        ▼
OpenAI API

The routing decision is proven two ways:

  1. Response model field — OpenAI echoes back the actual model used, confirming which backend served the request.
  2. Router logs[ext_proc] domain=finance selected_model=gpt-4.1 shows the intelligent router classified the prompt and injected the routing header.

Building the router image: see artifacts/intelligent-router/README.md. The lab uses the pre-built image antonioberben/intelligent-router:latest.

Prerequisites

ToolInstall
Docker Desktop (with buildx)docs.docker.com
kubectl ≥ 1.28brew install kubectl
helm ≥ 3.14brew install helm
jqbrew install jq
OpenAI API keyplatform.openai.com
Existing Kubernetes clusterMust be running and accessible via kubectl
kubectl version --client && helm version --short && jq --version

Steps

And yes, you can install the whole application by running:

export OPENAI_API_KEY="sk-…"
export HF_TOKEN="hf_…" 
curl -sL https://raw.githubusercontent.com/agentic-world-lab/kubecon-eu-2026-agentic-routing/main/install.sh | bash

If you want to go step by step, you can follow the guide here: Lab

Future Work: Advanced Hybrid LLM Routing Strategies

For a comprehensive deep-dive, see Hybrid LLM Routing Strategies.

The intelligent router demonstrated in this lab implements domain-aware quality/latency/cost scoring with dynamic budget pressure. This is one strategy among a rich and rapidly evolving taxonomy of hybrid routing techniques. Below is a curated summary of advanced strategies identified in contemporary research, grouped by category, that represent exciting future directions for this project.

Micro-Architectural & Token-Level Routing

StrategyDescription
Token-Level Collaborative Routing (CITER)A lightweight RL-trained router analyzes hidden states at every decode step, transferring execution to the cloud only when the local model's confidence collapses on a specific token. [44]
Adaptive Multi-Level Speculative Chain (SpecRouter)Dynamically constructs an optimal chain of draft/verifier models on the fly based on real-time latency and token distribution divergence. [49]
MoE Dynamic Expert Capacity BudgetingRestricts the number of active Mixture-of-Experts invoked during speculative decoding to prevent memory bandwidth starvation, increasing throughput by ~30%. [53]
Remaining-Token Orthogonality PruningPredicts sequence completion via token-to-sink attention analysis, pruning uninformative tokens to collapse complexity from quadratic to linear. [68]

Memory & Cache-Aware Routing

StrategyDescription
KV Cache-Affinity OptimizationRoutes queries to the node already holding the matching prompt prefix in its attention cache, achieving >87% cache hit rates. [9]
PCIe Overlap I/O Optimization (KVPR)Overlaps GPU recomputation with PCIe cache transfer to completely mask physical transfer latency. [36]
Dynamic VRAM Footprint ProjectionProjects the total memory requirement of the context window, preemptively offloading to the cloud if the local node lacks contiguous VRAM. [27]

Uncertainty & Quality Assurance

StrategyDescription
Semantic Entropy Hallucination RoutingForces multiple quantized local drafts, clusters them by meaning; high semantic divergence triggers reroute to a more capable cloud model. [56]
Semantic Energy Boltzmann AnalysisApplies a Boltzmann-inspired energy distribution to detect subtle reasoning failures more accurately than raw entropy. [60]
Consensus-Based Hierarchical DeflectionDuplicates high-stakes queries across heterogeneous cloud providers; a local judge model enforces majority-vote factual alignment. [61]
Hard-Blocking Long-Tail FiltrationA lightweight firewall model blocks unsolvable "long-tail" queries from consuming cloud compute, returning curated fallbacks. [82]

Infrastructure & Hardware-Aware Routing

StrategyDescription
Thermal and Power-Aware Scheduling (TAPAS)Monitors die temperatures and fan telemetry, diverting prefill requests away from hardware approaching thermal throttling limits. [10]
Spot-Instance Volatility ArbitrageRoutes async bulk workloads to discounted, ephemeral cloud nodes; auto-fails back to local edge hardware on preemption events (~44% cost reduction). [11]
Network-Aware QoS Arbitration (SONAR)Analyzes real-time packet loss and WAN latency, confining latency-sensitive payloads to local edge when trans-oceanic links degrade. [70]
Energy-per-Token Ecological OptimizationCalculates fluctuating electrical costs of local vs. cloud, routing to the endpoint with the lowest carbon footprint per token. [8]

Security, Privacy & Compliance

StrategyDescription
PII Vaulting and Format-PreservationRoutes through a local NER model to mask sensitive data with reversible vault identifiers before sending sterilized payloads to cloud APIs. [74]
Adversarial-Aware Deflection SandboxScans prompts for jailbreak vectors via spatial-aware alignment, routing malicious payloads to isolated, read-only local logging models. [77]
Geo-Location Data Residency Constraints (GDPR)Interrogates origin IP metadata to confine EU citizen data to EU-certified cloud zones or local edge clusters. [12]

Economic & Operational Routing

StrategyDescription
Real-Time Token Budget DegradationTracks aggregate tenant expenditure, automatically degrading routing from premium to free local models when financial limits are breached. [87]
Circuit-Breaker Auto-EjectionTracks continuous failure latency of external APIs, temporarily ejecting degraded endpoints from the routing table. [5]
A/B Testing Silent Traffic MirroringDuplicates a percentage of live cloud-bound traffic, silently routing the copy to a new local SLM to evaluate quality harmlessly. [98]
Policy Hot-Reloading ConfigurationExtracts routing logic from external declarative configs, permitting live runtime updates without daemon restarts. [101]

Key References

#TitleLink
1Multi-LLM Routing Strategies for GenAI on AWSaws.amazon.com
5The Complete Guide to LLM Routing: 5 AI Gatewaysmedium.com
9KV Cache Aware Routing with llm-d (Red Hat)developers.redhat.com
10TAPAS: Thermal- and Power-Aware Schedulingarxiv.org
11SkyServe: Serving AI Models with Spot Instancesarxiv.org
12LLM-Driven Privacy-Aware Orchestration Across Cloud-Edgearxiv.org
44CITER: Token-Level Collaborative Routinggithub.com
49SpecRouter: Adaptive Multi-Level Speculative Decodingarxiv.org
53MoE-Spec: Expert Budgeting for Speculative Decodingarxiv.org
56Uncertainty-Based On-device LLM Routingarxiv.org
60Semantic Energy: Detecting Hallucination Beyond Entropyarxiv.org
74Privacy Gatekeepers for Cloud-Based AI Interactionsarxiv.org
82Firewall Routing: Blocking for Better Hybrid Inferenceaclanthology.org
101NVIDIA AI Blueprint for Cost-Efficient LLM Routingdeveloper.nvidia.com

Contributors

felipevicens

18 commits

antonioberben

13 commits

agentic-world-lab/kubecon-eu-2026-agentic-routing

Resources for talk at KubeCon + CloudNativeCon Europe 2026 Amsterdam: Intelligent Routing for Optimized Inference

Rust

4

31 commits

updated Mar 20, 2026

See the code

README

kubecon-eu-2026-agentic-routing

Resources for talk at KubeCon + CloudNativeCon Europe 2026 Amsterdam: Intelligent Routing for Optimized Inference

Intelligent Routing for Optimized Inference - Demo

Overview

This lab shows how the intelligent router classifies the domain of every LLM request and automatically selects the right model from the pool. The client sends a plain request with no routing hint; AgentGateway calls the intelligent router via ExtProc (pre-routing), which reads the body, detects the domain, and injects the x-router-selected-model header. AgentGateway then selects the HTTPRoute based on that header.

Client request  (no routing header)
        │
        ▼
AgentGateway  (port 80)
        │  gateway-level ExtProc (PreRouting) ──► Intelligent Router (:18080)
        │                                           reads body → classifies domain
        │                                           injects x-router-selected-model: gpt-4.1
        │  select_best_route() → HTTPRoute matches header
        ├─ gpt-4.1      → gpt-4-1      backend  (finance / health / legal)
        ├─ gpt-5-mini   → gpt-5-mini   backend  (science)
        └─ gpt-4.1-mini → gpt-4-1-mini backend  (technology / general)
        ▼
OpenAI API

The routing decision is proven two ways:

  1. Response model field — OpenAI echoes back the actual model used, confirming which backend served the request.
  2. Router logs[ext_proc] domain=finance selected_model=gpt-4.1 shows the intelligent router classified the prompt and injected the routing header.

Building the router image: see artifacts/intelligent-router/README.md. The lab uses the pre-built image antonioberben/intelligent-router:latest.

Prerequisites

ToolInstall
Docker Desktop (with buildx)docs.docker.com
kubectl ≥ 1.28brew install kubectl
helm ≥ 3.14brew install helm
jqbrew install jq
OpenAI API keyplatform.openai.com
Existing Kubernetes clusterMust be running and accessible via kubectl
kubectl version --client && helm version --short && jq --version

Steps

And yes, you can install the whole application by running:

export OPENAI_API_KEY="sk-…"
export HF_TOKEN="hf_…" 
curl -sL https://raw.githubusercontent.com/agentic-world-lab/kubecon-eu-2026-agentic-routing/main/install.sh | bash

If you want to go step by step, you can follow the guide here: Lab

Future Work: Advanced Hybrid LLM Routing Strategies

For a comprehensive deep-dive, see Hybrid LLM Routing Strategies.

The intelligent router demonstrated in this lab implements domain-aware quality/latency/cost scoring with dynamic budget pressure. This is one strategy among a rich and rapidly evolving taxonomy of hybrid routing techniques. Below is a curated summary of advanced strategies identified in contemporary research, grouped by category, that represent exciting future directions for this project.

Micro-Architectural & Token-Level Routing

StrategyDescription
Token-Level Collaborative Routing (CITER)A lightweight RL-trained router analyzes hidden states at every decode step, transferring execution to the cloud only when the local model's confidence collapses on a specific token. [44]
Adaptive Multi-Level Speculative Chain (SpecRouter)Dynamically constructs an optimal chain of draft/verifier models on the fly based on real-time latency and token distribution divergence. [49]
MoE Dynamic Expert Capacity BudgetingRestricts the number of active Mixture-of-Experts invoked during speculative decoding to prevent memory bandwidth starvation, increasing throughput by ~30%. [53]
Remaining-Token Orthogonality PruningPredicts sequence completion via token-to-sink attention analysis, pruning uninformative tokens to collapse complexity from quadratic to linear. [68]

Memory & Cache-Aware Routing

StrategyDescription
KV Cache-Affinity OptimizationRoutes queries to the node already holding the matching prompt prefix in its attention cache, achieving >87% cache hit rates. [9]
PCIe Overlap I/O Optimization (KVPR)Overlaps GPU recomputation with PCIe cache transfer to completely mask physical transfer latency. [36]
Dynamic VRAM Footprint ProjectionProjects the total memory requirement of the context window, preemptively offloading to the cloud if the local node lacks contiguous VRAM. [27]

Uncertainty & Quality Assurance

StrategyDescription
Semantic Entropy Hallucination RoutingForces multiple quantized local drafts, clusters them by meaning; high semantic divergence triggers reroute to a more capable cloud model. [56]
Semantic Energy Boltzmann AnalysisApplies a Boltzmann-inspired energy distribution to detect subtle reasoning failures more accurately than raw entropy. [60]
Consensus-Based Hierarchical DeflectionDuplicates high-stakes queries across heterogeneous cloud providers; a local judge model enforces majority-vote factual alignment. [61]
Hard-Blocking Long-Tail FiltrationA lightweight firewall model blocks unsolvable "long-tail" queries from consuming cloud compute, returning curated fallbacks. [82]

Infrastructure & Hardware-Aware Routing

StrategyDescription
Thermal and Power-Aware Scheduling (TAPAS)Monitors die temperatures and fan telemetry, diverting prefill requests away from hardware approaching thermal throttling limits. [10]
Spot-Instance Volatility ArbitrageRoutes async bulk workloads to discounted, ephemeral cloud nodes; auto-fails back to local edge hardware on preemption events (~44% cost reduction). [11]
Network-Aware QoS Arbitration (SONAR)Analyzes real-time packet loss and WAN latency, confining latency-sensitive payloads to local edge when trans-oceanic links degrade. [70]
Energy-per-Token Ecological OptimizationCalculates fluctuating electrical costs of local vs. cloud, routing to the endpoint with the lowest carbon footprint per token. [8]

Security, Privacy & Compliance

StrategyDescription
PII Vaulting and Format-PreservationRoutes through a local NER model to mask sensitive data with reversible vault identifiers before sending sterilized payloads to cloud APIs. [74]
Adversarial-Aware Deflection SandboxScans prompts for jailbreak vectors via spatial-aware alignment, routing malicious payloads to isolated, read-only local logging models. [77]
Geo-Location Data Residency Constraints (GDPR)Interrogates origin IP metadata to confine EU citizen data to EU-certified cloud zones or local edge clusters. [12]

Economic & Operational Routing

StrategyDescription
Real-Time Token Budget DegradationTracks aggregate tenant expenditure, automatically degrading routing from premium to free local models when financial limits are breached. [87]
Circuit-Breaker Auto-EjectionTracks continuous failure latency of external APIs, temporarily ejecting degraded endpoints from the routing table. [5]
A/B Testing Silent Traffic MirroringDuplicates a percentage of live cloud-bound traffic, silently routing the copy to a new local SLM to evaluate quality harmlessly. [98]
Policy Hot-Reloading ConfigurationExtracts routing logic from external declarative configs, permitting live runtime updates without daemon restarts. [101]

Key References

#TitleLink
1Multi-LLM Routing Strategies for GenAI on AWSaws.amazon.com
5The Complete Guide to LLM Routing: 5 AI Gatewaysmedium.com
9KV Cache Aware Routing with llm-d (Red Hat)developers.redhat.com
10TAPAS: Thermal- and Power-Aware Schedulingarxiv.org
11SkyServe: Serving AI Models with Spot Instancesarxiv.org
12LLM-Driven Privacy-Aware Orchestration Across Cloud-Edgearxiv.org
44CITER: Token-Level Collaborative Routinggithub.com
49SpecRouter: Adaptive Multi-Level Speculative Decodingarxiv.org
53MoE-Spec: Expert Budgeting for Speculative Decodingarxiv.org
56Uncertainty-Based On-device LLM Routingarxiv.org
60Semantic Energy: Detecting Hallucination Beyond Entropyarxiv.org
74Privacy Gatekeepers for Cloud-Based AI Interactionsarxiv.org
82Firewall Routing: Blocking for Better Hybrid Inferenceaclanthology.org
101NVIDIA AI Blueprint for Cost-Efficient LLM Routingdeveloper.nvidia.com

Contributors

felipevicens

18 commits

antonioberben

13 commits

Languages

Rust

75.5%

Go

15.6%

Python

7.2%