Optimization

How does Cognocient load-balance across models and providers?

Define one model name that spreads requests across several models or providers by weight, in rotation, or to the cheapest option, and skips deployments that are failing.

A load-balanced group is one model name that fans out to several real models. Use it to split traffic between providers, rotate across equivalent models, or always take the cheapest option. Configure groups in Load Balancer (sidebar → Control).

Set it up

  1. Open Load Balancer and click New group.
  2. Choose the name callers will send, a strategy, and 2 to 10 deployments (each a model name, with a weight for the weighted strategy).
  3. Send the group name as model:
from openai import OpenAI
 
client = OpenAI(base_url="https://api.cognocient.com/v1", api_key="<your proxy key>")
 
resp = client.chat.completions.create(
    model="gpt-pool",
    messages=[{"role": "user", "content": "Summarise this ticket."}],
)

Deployments can mix providers, including Azure deployments, Bedrock and Vertex model IDs, and custom/<name> endpoints, as long as each model has a provider key in Settings. The group works on /v1/chat/completions and /v1/responses.

Strategies

StrategyBehaviourGood for
WeightedRandom, in proportion to each weightSplitting traffic, gradual migrations (90/10 → 50/50)
Round robinStrict rotation across healthy deployments; weights ignoredSpreading load evenly across equivalent models
Lowest costCheapest deployment for this request, from list price × estimated tokensCost-first routing between comparable models

Health and cooldown

Cognocient watches the real outcome of real traffic; there are no synthetic probes. A deployment that returns 429, 408, 500, 502, 503 or 504 three times within 60 seconds is skipped for 30 seconds, then tried again. The Load Balancer page shows a cooling down badge while it is skipped. If every deployment is failing, none are skipped.

State is shared across proxy workers. If it is ever unreachable, load balancing keeps working and treats every deployment as healthy.

What you can see

Every balanced response carries headers:

HeaderMeaning
x-cog-lb-groupThe group name you sent
x-cog-lb-modelThe deployment that served the request
x-cog-lb-strategyThe strategy used
x-cog-lb-reasonWhy it was chosen, including any deployments skipped

The Load Balancer page shows calls, cost, average latency and errors per deployment over the last 24 hours. Those numbers count all calls to each model, including any made directly rather than through the group.

Combining with other features

  • Auto Router: an Auto Router tier can point at a group, so "complex" requests are themselves balanced.
  • Budgets, guardrails, caching, the Emergency Freeze: apply as normal, evaluated against the chosen model.
  • Provider Failover: independent and complementary. Failover retries one request on a backup provider; load balancing steers later requests away from a sick one.

Limits

  • 2 to 10 deployments per group; a group cannot contain another group.
  • A group name must not collide with a real model name or your Auto Router name.
  • Groups span models and providers, not multiple API keys for the same provider (one key per provider per account today).
  • Weights are integers from 1 to 1000.

On this page