All Questions
Llm Gateway Cost And Caching hard

During an outage at your primary provider, the gateway fails an agent feature over to a second provider using the same prompt. Plain chat works, but the agent emits malformed tool calls and loops. What is the root cause, and what does a working fallback require?

  1. A The secondary model has a smaller context window; truncating conversation history fixes it, because tool-calling behavior is portable across providers.
  2. B Fallback is transparent at the API layer, so the failures come from cold prompt caches on the second provider and will stop once those caches warm up.
  3. C Tool schemas and tool-use behavior differ per provider, so fallback needs translated schemas and a prompt evaluated on that model before an outage.
  4. D The gateway should retry the primary with backoff before failing over, since switching providers mid-conversation corrupts the stored session state.

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

Get the app

Related questions