Federation & Service
Routing
How Federation routes requests and handles failover
Routing
The Federation AIService handles request routing and failover across model providers and Services. This ensures Agents stay available even when individual backends are down.
Model routing
When an Agent sends a model request:
- The Federation AIService looks up the model ID
- It selects the provider with the best health and lowest latency
- It forwards the request
- If the provider fails, it retries with the next available provider
Service routing
When an Agent invokes an Action:
- City resolves the Action to the Service that owns it
- It checks the Service's health and load
- It routes the request to the best instance
- If the Service is unavailable, it returns an error or queues the request
Failover
- Provider health is monitored continuously
- Failed requests are retried with exponential backoff
- Circuit breakers prevent cascading failures
- Load balancing distributes traffic across healthy instances
Continue with: