Open vs Closed Models
API providers vs self-hosted open weights: control, cost, compliance, and quality trade-offs.
In plain words
Closed models are like using a service over the internet. Open models are ones you can download and run yourself.
Think of it like…
Renting a car with a driver versus buying your own car. The driver service gets you moving today with no maintenance and the latest model, but you pay per trip, accept their rules and can't see under the bonnet. Owning gives control and lower cost per kilometre at high use, but you buy the garage, the mechanic and the fuel.
Where you’ve seen it
A healthcare analytics company can't send patient notes outside its cloud account. They evaluate API models with a business associate agreement, and also a 70B open-weight model quantised on four GPUs in their own VPC. The open model hits 91 percent of the best API model's score on their note-summarisation set, passes the privacy review without negotiation, and costs less than the API at their volume of roughly 300 million tokens a day. They keep an API model for the hardest 5 percent of requests where permitted.
Words you’ll hear
- Open-weight
- Model weights are downloadable; licence and data transparency vary.
- Self-hosting
- Running a model on your own GPUs or cloud instances.
- Data residency / compliance
- Rules on where data may be processed and who may see it.
- Vendor lock-in
- Cost of switching providers or models because of proprietary APIs and prompts.
Visual diagram
Theory & deep dive
Comparing closed and open-weight models
Quality: frontier closed models usually lead on the hardest general tasks, while strong open-weight models are close behind and often sufficient, especially after fine-tuning on a narrow task. Cost: APIs are pay-per-token with no fixed cost, which is hard to beat at low or spiky volume. Self-hosting has a fixed cost (GPUs, engineers, monitoring) and a low marginal cost, so it wins at sustained high volume and high GPU utilisation; compute your break-even honestly, including idle time and staff.
Control and privacy: open weights allow fine-tuning, quantisation, pinned versions that never change underneath you, offline or on-device use, and data that never leaves your environment. Closed APIs may deprecate or silently update models, and their data-handling terms vary, though enterprise agreements often include zero-retention options and regional processing. Operations: an API means no GPUs, autoscaling or serving expertise; self-hosting means you run inference engines (vLLM, TGI), capacity planning, security patches and on-call.
If an API costs $2 per million tokens and a four-GPU node plus ops costs $12,000 a month, the node breaks even near 6 billion tokens a month (about 200M a day) at full utilisation. At 10% utilisation the real cost per token is ten times higher.
Making and keeping the choice flexible
Evaluate candidates on your own task set, with your prompts and data, measuring quality, latency, cost and failure modes. Public leaderboards are a starting shortlist, not a decision. Check licences carefully: some open-weight licences restrict commercial use at scale, forbid using outputs to train other models, or require attribution; closed-provider terms constrain how outputs may be used too.
Reduce lock-in with a thin model-gateway layer (a single internal interface, structured-output schemas, prompts kept in configuration, eval suites that run against any model) so switching is a config change plus a re-evaluation. Many teams run a hybrid: a cheap open model for high-volume simple tasks, a closed frontier model for the hardest requests, and sensitive data routed only to approved environments. Revisit the decision regularly, because quality and prices change quickly.
Requests containing PII go to the self-hosted open model only. Non-sensitive hard questions escalate to the frontier API. Everything passes through one gateway that logs cost, latency and eval scores per route.
How it works, step by step
Step 1 of 41. List non-negotiables
Write down compliance and data residency rules, latency targets, volume and quality bar.
- Decides
- what's even allowed
When to use it & trade-offs
What it is
Closed models are reached through a provider's API: you send prompts, you get completions, and the weights stay private. Open-weight models publish their trained weights (under licences that vary from permissive to restricted), so you can download, run, fine-tune and inspect them on your own infrastructure or through hosting providers. "Open source" is stricter and usually not accurate: most open-weight releases don't include training data or full training code. The choice is a trade-off across quality, cost, control, privacy, compliance and operational burden.
Why it matters: This decision shapes your architecture, budget and risk. A startup may ship fastest on an API; a bank with data-residency rules may be unable to send customer text to a third party; a company with a million daily classification calls may save most of its bill by self-hosting a small open model. Engineers are expected to reason about the trade-offs and to prevent lock-in, rather than defend one camp.
When to reach for it
- APIs for prototypes and unpredictable traffic
- Open weights for sensitive data and high-volume stable tasks
- A gateway and hybrid routing in larger systems
When to avoid or be careful
- Choosing by leaderboard rank alone
- Comparing API price with GPU price without utilisation and staff costs
- Hard-coding one provider's API throughout the codebase
API (closed) vs self-hosted open weights
Strengths: No infrastructure; always-improving models; pay as you go.
Watch out: Per-token cost at scale; less control; deprecations; data-sharing review.
Strengths: Data stays with you; pinned versions; fine-tuning; low marginal cost.
Watch out: GPUs, serving expertise and on-call; may trail frontier quality.
Strengths: Pay-per-token for open models; easy switching.
Watch out: Still third-party processing; fewer guarantees than your own VPC.
Interview signals & numbers to know
When this topic comes up
- “Should we self-host?”
- “Our compliance team won't allow sending data out”
- “What does open-weight mean?”
- Vendor lock-in
- Model gateways
Benchmarks & rules of thumb
- utilisation
- the number that makes or breaks self-hosting economics
- ~91%
- open model's relative score in the healthcare example
- 10×
- cost per token at 10% GPU utilisation vs full
Common mistakes & follow-ups
Common interview mistakes
- Calling an open-weight model "open source" and ignoring a licence that restricts your use.
- Self-hosting for a workload of a few thousand requests a day and paying for idle GPUs.
- Writing prompts tuned to one provider's quirks with no evaluation set to port them.
Likely interviewer follow-ups
- When does self-hosting an open model become cheaper than an API?
- How would you keep the system provider-agnostic?
- What compliance questions would you ask before using an API?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply Open vs Closed Models with generative AI interview Q&A and hands-on practice.