← All articles

How Meshwork built a customer-facing model router on the gateway

Jonas Vehko · 1 min read

Meshwork lets its customers bring their own models. Behind the scenes a router picks, per request, the cheapest model that clears a quality threshold.

The routing rule

const model = candidates
  .filter((m) => m.score(task) >= task.minQuality)
  .sort((a, b) => a.costPer1k - b.costPer1k)[0];

The result: a 38% lower bill with no measurable change in user ratings.

0 comments

  • Be the first to comment.