All Questions
Llm Gateway Cost And Caching hard

A multi-tenant support assistant shares one semantic cache across all tenants, which raised the hit rate from 15% to 35%. A customer of tenant B asks 'What is your refund window?' and gets tenant A's 30-day policy. Which design is correct?

  1. A Keep the shared cache but raise the similarity threshold to 0.98 so only near-verbatim queries can match across tenant boundaries.
  2. B Keep the shared cache but scrub tenant names, emails, and account IDs from responses before storing them, so a shared answer reveals nothing private.
  3. C Replace semantic caching with prompt caching, since the provider's prefix cache returns stored answers and is already isolated per tenant.
  4. D Scope cache keys by tenant and by the version of the tenant's knowledge base, accepting a lower hit rate to eliminate cross-tenant answers.

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

Get the app

Related questions