Engineering · AI · Product

Choosing Your AI Model in Cereby: Why We Went Multi-Provider

4 min read

From two fixed defaults to a curated catalog, with tiers that put the trade-off in the student's hands.


A student has two things to do before a seminar: check what one term in the reading means, and rewrite three pages of an essay. (The student is hypothetical.) When Cereby's first AI features shipped, both went through the same two default models at the same latency and cost. The one-line question paid premium prices; the rewrite sometimes landed on the wrong capability tier. Most traffic ran through one vendor, so its rate limits and outages were ours. And the student could not see which model had answered, or why its behavior changed without warning:

Adding a provider, meanwhile, meant touching client code in more than one place.

A tier, chosen in the open

By March, the student chose. The model selector grouped models into three tiers, low, medium and high, with copy on the rough performance and cost of each. Premium tiers depended on the student's plan, so an upgrade was explicit, never an accident. Coins still tracked tokens; a tier oriented the choice without changing what a token cost.

Behind the selector, a gateway took all model traffic through one contract, whichever provider served it, and routed only to a curated allowlist of models from several providers. The allowlist and tiers lived in one place that operations could change without touching client code:

The decision underneath was to separate which model family answers from how the app talks to models. Everything provider-specific stayed behind the gateway.

Not every feature floats

Background pipelines, and paths that need determinism, guaranteed throughput or quality in one domain, stayed pinned to a model and never showed the selector. When a pinned model is deprecated, the fix is an infrastructure change, not a request for students to switch tiers, so someone had to own each pinned path, in writing.

Allowlist updates became a routine lever. A bad entry showed up as clusters of hard 4xx or 5xx errors rather than silent drift in quality, and we monitored per model, because entries fail in different ways. Spreading load across providers also eased the pressure on any single API key: with traffic no longer concentrated, one provider's trouble reached fewer students.

Before and after

AreaTwo default modelsSeveral providers, with tiers
Vendor riskConcentrated on one providerSpread across the allowlist
Task fitOne latency and cost profileAn explicit choice of tier
Student trustOpaque defaultsVisible trade-offs, premium tiers by plan
OperationsA model swap meant a code changeAn allowlist update, no core rewrite

The selector's copy turned out to matter as much as the tiers. Without it, students cannot reason about cost, and they stop trusting the system the first time it surprises them.

All engineering posts