#66535·ray

[RFC][Serve][LLM] Pluggable Model-Level Routing for Multi-Model Applications

Author: suppagoddoCreated Sep 28, 2026Updated Sep 29, 2026
Labelsenhancementtriageserveusabilityperformancellmcommunity-backlog

Summary

Ray Serve LLM supports serving multiple models behind one OpenAI-compatible endpoint, but the client currently needs to choose a concrete model.

There is increasing demand for the serving layer to make that choice automatically. For example, an application may want to send simple requests to a smaller model and harder requests to a larger model without putting another gateway in front of Ray. NVIDIA NeMo Switchyard implements this pattern externally.

This RFC proposes a small, pluggable model-routing layer:

request model="auto"
        |
        v
ModelRoutingPolicy
        |
        | selects concrete model
        v
existing model resolution
        |
        v
DeploymentHandle
        |
        v
RequestRouter
        |
        | selects replica
        v
Replica

The important distinction is:

  • Model routing: which concrete model/deployment should handle the request?
  • Replica routing: which replica of that deployment should handle it?

The existing RequestRouter remains responsible for replica routing.

Use case

Consider an application serving:

qwen-8b
qwen-70b

Today the client chooses: model="qwen-8b"or: model="qwen-70b"

Instead, the application may want to expose: model="auto" and apply an application-defined policy:

auto
 |
 +-- simple request ---> qwen-8b
 |
 +-- complex request --> qwen-70b

Users can implement this today with a custom ingress deployment or an external router such as Switchyard, but that creates a second routing layer outside the standard Serve LLM path.

The proposal is to make this decision a first-class Serve LLM primitive while continuing to use existing deployment and replica-routing mechanisms after the model is selected.

Relationship to Serve model multiplexing

Ray already has an important model-routing primitive: @serve.multiplexed.

Multiplexing solves a different problem. With multiplexing, many model variants share the same Serve deployment and replica pool:

Deployment
   |
   +-- replica 1: model-A loaded
   +-- replica 2: model-B loaded
   +-- replica 3: model-A loaded

A request contains a multiplexed_model_id, and MultiplexMixin prefers replicas that already have that model loaded.

Serve LLM uses this mechanism for dynamically loaded LoRA adapters. OpenAiIngress resolves a LoRA model to its base-model deployment and sets:

handle.options(
    multiplexed_model_id=lora_model_id,
)

The proposed model router operates one layer above this:

                 ModelRoutingPolicy
                         |
             choose concrete model/deployment
                         |
                         v
                 DeploymentHandle
                         |
              existing multiplexing
                when applicable
                         |
                         v
                   RequestRouter
                         |
                         v
                      Replica

So these abstractions are complementary:

ModelRoutingPolicy
    chooses across model deployments

Multiplexing
    chooses/loads a model variant within one deployment's replica pool

RequestRouter
    chooses the replica

V1 would route among configured top-level Serve LLM models. Dynamic LoRA selection continues through the existing multiplexing path and is not replaced by this RFC. Also, if the client specifies a concrete model ID, the existing resolution path is unchanged, model routing runs only for explicitly configured logical routes.

Questions for discussion

  1. Does this abstraction makes sense, given generic cost of SOTA models is increasing and smaller models can handle small task faster and cheaper.
  2. Does a model-selection abstraction above RequestRouter make sense, or is there an existing Serve primitive this should build on instead?
  3. Should this live in Serve LLM rather than generic Serve?