liveBook · Manning

Dynamic routing

As explained in Generative AI in Action

Routing logic is the decision mechanism that selects a model for an input or determines how outputs from multiple models are combined.

Dynamic routing selects a model for each input or combines outputs from several models. In generative-AI applications, it lets specialized models handle the requests they serve best. section 10.5.1

An implementation typically considers:

  • Model-selection criteria such as performance, training-data diversity, and specialization. section 10.5.1
  • API integration across endpoints, including throttling, rate limits, error handling, and response caching. section 10.5.1
  • Scalability measures such as load balancing, API gateways, regional redundancy, queues, and stream processing. section 10.5.1

Intent-based model selection

A fast, locally running Phi-2 classifier checks whether a question concerns dogs. Relevant questions can continue through the local flow; irrelevant questions are routed to GPT-4. A separate classifier pattern maps enterprise questions to numbered approaches.

How Generative AI in Action covers it

How deep it goes
Explains selection criteria, classifier-driven routing, endpoint integration, and scaling concerns without deriving routing algorithms mathematically.
Examples
Uses a Phi-2 dog-topic classifier, GPT-4 fallback, and numbered enterprise intent classification.
What it assumes
Assumes multiple available models and API endpoints, while defining routing as model selection or output combination.
What you can do after
Apply it via a classifier that selects an appropriate model and integrate the resulting ensemble across managed endpoints.
How it connects
Connects model ensembles with model selection, API integration, load balancing, caching, queuing, and stream processing.

Also explained in

Compare how 3 books explain dynamic routing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.