All Questions
Llm Gateway Cost And Caching hard

For a code-generation feature, your gateway sends every request to a small model that costs about 1/10 as much as the large model, and escalates to the large model when the output fails tests. The small model fails 70% of the time. How should you evaluate this policy?

  1. A Small-first is still the clear win, since each small call costs a tenth as much as a large call, so the average cost per request drops by roughly 90 percent.
  2. B Drop escalation and serve only the small model's output, accepting lower quality, since escalation retries are what make cascades expensive.
  3. C Expected cost is about 0.8x large-only, and 70% of requests pay two calls of latency; routing hard requests straight to the large model is better.
  4. D Send every request to both models in parallel and keep the better result, which cuts latency and costs the same as escalation on average.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions