Design an Enterprise LLM Gateway Routing Across Model Providers
Last updated: November 29, 2026
Quick Overview
Design a platform that lets thousands of employees and internal apps at a large enterprise use several LLM providers (hosted and self-hosted) through one API, with per-team quotas, cost tracking, data protection, model routing and fallback, and retrieval over company documents.
EPAM Systems
November 29, 20260
0
0 solved
Design a platform that lets thousands of employees and internal apps at a large enterprise use several LLM providers (hosted and self-hosted) through one API, with per-team quotas, cost tracking, data protection, model routing and fallback, and retrieval over company documents.
EPAM builds and open-sources AI DIAL, an enterprise LLM orchestration platform, and runs many GenAI engagements for regulated clients, so this is directly in its domain. The interviewer checks that you treat governance (access, PII, audit, cost) as first-class alongside latency and quality, and that routing and fallback are concrete.
What the Interviewer Expects
- Single OpenAI-compatible API in front of multiple providers via adapters
- Authentication, per-team quotas and token-based cost attribution
- PII detection or redaction and audit logging suited to regulated clients
- Routing policy by task, cost, latency and data residency, with fallback
- Retrieval augmented generation with document-level access control
- Evaluation and monitoring of quality, not just uptime
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How do you stream responses through the gateway while still enforcing output filters?
- How would you enforce that a user only retrieves chunks from documents they can access?
- How do you decide when a cheaper model is good enough for a given app?
- How do you handle a provider changing model behavior under the same model name?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
Functional: chat and embedding APIs, streaming, tool calling passthrough, RAG over SharePoint and Confluence content, per-app model allowlists. Non-functional: added gateway latency under 50 ms p95 be...
High-Level Design
Clients call one OpenAI-compatible endpoint. The gateway authenticates via the corporate IdP (OIDC) or app keys, resolves the caller to a team and policy, applies quota checks (token buckets in Redis ...