Virtual models are logical groupings of real LLM models that enable high availability and load distribution without client-side logic. Two types:
  • Combo (Fallback Chain) — Models tried sequentially. If one fails, the next in order is used.
  • Round-Robin — Models selected in rotating order across requests. No fallback.
Frontend route:
Backend routes:

Management UI

Manage virtual models from Admin → Virtual Models.

List

Table view of all virtual models with type badges (Combo / Round-Robin) and resolved underlying model names.

Create

Click New Virtual Model. Fields:

Edit

Click the menu on any row. Update name, type, underlying models, or active status.

Delete

Click … → Delete. Soft-delete; reversible via API only.

CRUD API

All endpoints require admin authentication.

List virtual models

Returns all non-deleted virtual models. Resolves underlying model IDs to names. Response:

Create virtual model

Request body:
Validation:
  • type must be "combo" or "round_robin"
  • All underlying_model_ids must reference existing real models (non-deleted, non-virtual)
  • Name must be unique among virtual models
Response: 201 Created with full virtual model object.

Update virtual model

Request body (all fields optional):

Delete virtual model

Soft-delete: sets is_deleted = TRUE. Response:

Exclusion from real model APIs

Virtual models are excluded from regular model endpoints and cannot be modified through them.

Runtime behavior via OpenAI proxy

Virtual models are invoked through the OpenAI-compatible proxy at /api/v2/openai/v1.

Model resolution

When a request’s model field matches a virtual model name:
  1. The virtual model is loaded from the DB
  2. underlying_model_ids are resolved to real model rows (active, non-deleted, non-virtual)
  3. Order is preserved from the stored array

Combo (fallback chain)

  • Each model in order is attempted
  • On failure, log the error and proceed to next
  • If all models fail, returns 502 with errors array and last_error
  • Same behavior for both streaming and non-streaming requests

Round-robin

  • In-memory rotating index per virtual model ID (not persisted across restarts)
  • Protected by asyncio.Lock for thread safety
  • No fallback — if the selected model fails, the request fails
  • Round-robin virtual models with a single underlying model are functionally equivalent to a direct model reference

OpenAI format

Virtual models appear in the model list:
Each virtual model is returned as an OpenAI model object:
Streaming responses include X-Pinter-Routed-Model header indicating which real model handled the request.

Constraints and limitations

  • No nesting: Virtual models cannot reference other virtual models. Validation rejects underlying_model_ids pointing to combo or round-robin models.
  • No pricing fields: Virtual models inherit no pricing from underlying models. Cost is tracked per real model at runtime.
  • Round-robin index is in-memory: Resets on server restart. Stateless and ephemeral.
  • All requests must be authenticated: Virtual models are not available via unauthenticated endpoints.
  • Streaming fallback sequential: Each candidate’s stream is tried in order; the first to produce a stream wins. No model-parallel fan-out.

Use cases

Virtual models are a zero-cost abstraction. They add no latency beyond the underlying API calls and require no additional infrastructure.