Design an AWS fine-tuning platform for LLMs
Company: OpenAI
Role: Machine Learning Engineer
Category: ML System Design
Difficulty: hard
Interview Round: Onsite
## Scenario
You need to build a system that lets customers fine-tune their own large language model (LLM) on AWS.
## Task
Design a managed platform where users can:
- Upload datasets (text + optional instruction/response pairs).
- Choose a base model and fine-tuning method (full FT, LoRA/QLoRA, adapters).
- Launch training jobs, monitor progress, and evaluate results.
- Deploy the resulting model behind an inference endpoint.
## Constraints / Requirements
- Multi-tenant isolation and security (VPC, IAM, encryption).
- Cost controls and quotas.
- Support for distributed training and checkpointing.
- Reproducibility (job config, code versioning, dataset versioning).
- Observability (metrics, logs, traces) and failure recovery.
## Deliverables
Architecture, key APIs, training workflow, data management, and evaluation strategy.
Overview: This question evaluates a candidate's competency in designing cloud-native ML platforms for fine-tuning large language models, covering distributed training, multi-tenant security and isolation, cost controls, reproducibility, observability, checkpointing, and deployment workflows.
Read the full OpenAI Machine Learning Engineer interview experience this question came from
Community answers
Answer by srinidhi786
Scope and assumptions
Pin these down first, because they drive most of the later choices:
Tenants: about 1k organizations. Most are self-serve. A few are enterprise customers that need stronger isolation, such as bring-your-own VPC or KMS key, or a dedicated account.
Models: open-weight models from 1B to 70B parameters, with 405B as a stretch goal. Licenses are gated per tenant.
Workload mix: about 80% LoRA/QLoRA jobs that run from minutes to hours. Full fine-tunes are rarer but expensive, multi-node, and run for days.
Datasets: from MBs up to roughly 100 GB of text per job.
Inference: many low-QPS custom models (a long tail) plus a few high-QPS ones.
The core design principle is to split the control plane from the data plane. The control plane is shared, stateless, and multi-tenant. The data plane, meaning training and inference compute, runs with tenant-scoped identities and never mixes tenants on one node.
Architecture
┌──────────────────────── CONTROL PLANE (platform account) ─────────────────────────┐
Customer ──► API GW ──► │ AuthN (Cognito/IAM Identity Center) → API services (EKS, stateless) │
(SDK/CLI/UI) + WAF │ ├─ Dataset svc ├─ Job svc ├─ Model registry ├─ Endpoint svc │
│ ├─ Quota/Billing ├─ Eval svc └─ Audit (CloudTrail + immutable log) │
│ Metadata: Aurora Postgres (jobs, lineage, quotas) + DynamoDB (job state, leases) │
│ Orchestrator: Step Functions / Temporal (per-job state machine, idempotent) │
│ Scheduler: Kueue on EKS (gang scheduling, fair share, quota c