- 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.
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
Create virtual model
Validation:
typemust be"combo"or"round_robin"- All
underlying_model_idsmust reference existing real models (non-deleted, non-virtual) - Name must be unique among virtual models
201 Created with full virtual model object.
Update virtual model
Delete virtual model
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’smodel field matches a virtual model name:
- The virtual model is loaded from the DB
underlying_model_idsare resolved to real model rows (active, non-deleted, non-virtual)- 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
502witherrorsarray andlast_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.Lockfor 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: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_idspointing 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.