-
-
Notifications
You must be signed in to change notification settings - Fork 6
Routing and aliases
For a discovered model, MultiVibe:
- Builds the enabled account/provider candidate pool.
- Excludes active account/model blocks and unsupported model mappings.
- Avoids a five-hour window near its configured threshold while another eligible candidate remains.
- Normally prefers the lowest known weekly usage; equal quota tiers alternate across requests.
- Only when every effective candidate is near its five-hour limit, prefers the greatest known remaining five-hour headroom.
- Uses weekly reset timing and configured priority as secondary ordering signals.
- Rotates on quota-like failures and retries bounded transient upstream errors.
Optional CODEX_SESSION_AFFINITY keeps a session on the same eligible account
per application and provider. Affinity never bypasses quota or policy filters.
Aliases are schema-v2 policies. The first matching rule can inspect:
- application and priority;
- reasoning effort and input size;
- text/image/audio/video modalities;
- tool requirements and execution mode;
- day/time windows.
Constraints filter candidates by local/cloud location, predicted wait, context window, and quality. Remaining candidates are scored for latency, cost, quality, and locality. Capacity comes from configured profiles, requests in flight, quota blocks, health/metrics probes, and learned throughput.
Rules can continue to the next rule, queue work, or reject when no destination has capacity. Optional cloud budgets emit application-scoped warnings.
The dashboard includes guided redirect, ordered fallback, and local-to-cloud
presets, plus an advanced editor and a no-inference policy simulator. Legacy
targets payloads are migrated to schema v2 when accepted.
imageRequestModelOverride can redirect image-bearing requests to a currently
exposed model or enabled alias. MultiVibe preserves image parts while bridging
Chat Completions image_url and Responses input_image payloads.
Inference routes accept these optional headers:
| Header | Values / meaning |
|---|---|
X-MultiVibe-Priority |
critical, interactive, standard, or batch
|
X-MultiVibe-Execution |
sync, auto, or defer
|
X-MultiVibe-Max-Wait-Ms |
Maximum admission wait |
X-MultiVibe-Deadline |
RFC 3339 completion deadline with timezone, for example 2026-09-01T18:00:00Z
|
X-MultiVibe-Idempotency-Key |
Stable application idempotency key |
X-MultiVibe-Webhook |
Registered application webhook ID |
Without opt-in headers, requests retain synchronous behavior unless the selected
alias defines defaults. Streaming, WebSocket, and Realtime requests cannot be
deferred. A deferred request returns 202 Accepted and a multivibe.job.
For an authenticated, synchronous JSON inference, the same idempotency header
also enables a short in-memory single-flight and replay window. The key is
isolated by application and inference route. Reusing it with a different JSON
payload returns 409; concurrent duplicates share one execution. Responses
include X-MultiVibe-Idempotency-Status with created, coalesced, replayed,
or bypass.
Direct inference replay is intentionally limited to text-only, non-streaming, stateless requests without tools. Streaming, tool, multimodal, stored, background, and conversation-linked requests bypass this layer. Errors, partial results, tool-call responses, and responses over the configured byte limit are shared only with already waiting followers and are not retained.
curl -X POST http://localhost:1455/v1/responses \
-H "Authorization: Bearer $MULTIVIBE_API_KEY" \
-H "content-type: application/json" \
-H "X-MultiVibe-Priority: batch" \
-H "X-MultiVibe-Execution: defer" \
-H "X-MultiVibe-Idempotency-Key: nightly-translation-42" \
-d '{"model": "gpt-5.3-codex", "input": "..."}'Job endpoints are application-isolated:
-
GET /v1/jobsandGET /v1/jobs/:id GET /v1/jobs/:id/result-
GET /v1/jobs/:id/eventswithLast-Event-IDreplay DELETE /v1/jobs/:id
Inference responses may include X-MultiVibe-Decision,
X-MultiVibe-Priority, X-MultiVibe-Resolved-Model, and
X-MultiVibe-Idempotency-Status. Deferred submissions also return a
Location header.
For retention, retries, event types, HMAC signatures, polling, and application-side idempotency, read the deferred batch integration guide. The repository also contains a reusable implementation prompt.