Open-weight vs proprietary models: architecture, benchmarks, and cost tradeoffs
By Flavio
Tagged: AI
How to choose between closed APIs, hosted open-weight APIs, and your own GPUs, backed by live streaming tests, license traps, and real monthly GPU math.
Most arguments about open-weight vs closed AI models get stuck in a false choice. One person says closed APIs lock you into one vendor and drain your wallet. Another replies that renting cloud GPUs costs thousands of dollars a month before a single user shows up.
Both sides skip the middle option that wins for most real apps.
In my earlier post on open-weight AI models, I explained what model weights are, how safetensors and GGUF store them, and how quantization shrinks them to fit on a laptop.
Here we pick up from there for real production apps. We’ll walk through five decisions I make before picking a model:
- Which of the three hosting tiers fits your traffic
- What the model’s license actually lets you ship
- Where closed frontier models still beat open weights
- What live streaming speed and tool-guard tests look like
- Where monthly GPU break-even math really crosses over
Three hosting tiers, not two
When we argue about “open” vs “closed”, we usually mash two separate questions together: who controls the weights and who runs the GPUs.
Split those two apart, and we actually have three tiers:
Tier 1: Closed APIs (OpenAI, Anthropic, Google)
You call an HTTP API, pay per million tokens, and touch zero GPUs. You get top reasoning, strong image/PDF reading, built-in prompt caching, and global uptime.
The trade-off is lock-in, third-party data rules, and forced upgrades when a lab retires a model snapshot six months after we tuned our prompts for it.
Tier 2: Hosted open-weight APIs
You still pay per token over an OpenAI-compatible API and run zero GPUs. The difference is that the model behind it is a public open-weight checkpoint like Qwen, DeepSeek, Mistral, or Llama, hosted on a shared GPU cluster (Fireworks, Together, DeepInfra, Cloudflare Workers AI, AWS Bedrock, or OpenRouter).
Because these hosts pack thousands of customers onto H100 and B200 clusters with continuous batching and FP8 kernels, prices drop 5x to 15x below flagship closed APIs with zero GPU ops. And if one host raises prices or goes down, you can move the same weights to another host or bring them in-house later.
One small catch on Tier 2: two hosts serving the “same” model can still behave slightly differently depending on whether they run 16-bit, FP8, or 4-bit weights, or use different chat templates and tool parsers. I always pin and test the exact host, not just the model name.
Tier 3: Your own cloud GPUs (self-hosted)
You rent dedicated NVIDIA H100, H200, or B200 GPUs (or own datacenter hardware) and run vLLM, SGLang, or TensorRT-LLM inside your private network.
You own the exact model file, keep every byte inside your VPC, run custom LoRA fine-tunes, and control every sampler setting. You also pay the hourly GPU bill 24/7, even at 3 AM when traffic is near zero.
In my local LLM vs API cost breakdown, I ran the numbers for one home GPU. Production is harsher: one GPU can’t survive a crash or reboot without downtime, so real uptime means at least two GPU nodes, a load balancer, monitoring, and someone on call when VRAM fills up.
| Dimension | Tier 1: Proprietary API | Tier 2: Hosted Open-Weight API | Tier 3: Self-Hosted HA GPUs |
|---|---|---|---|
| Weight access | Closed, vendor-only | Public downloadable weights | Public weights pinned in your registry |
| Billing model | Pay per token | Pay per token | Fixed hourly GPU meter + ops |
| Vendor portability | Low (prompts shift on switch) | High (same weights across hosts) | Full (move across any GPU cloud) |
| Version pinning | Temporary snapshots, forced retirements | Longer retention, still host-dependent | Indefinite by SHA-256 weight hash |
| Data residency | Vendor cloud, ZDR addenda available | Multi-tenant cloud or dedicated VPC host | Strictly inside your VPC or on-prem |
| Custom fine-tuning | Vendor-managed API only | Supported on select hosts (LoRA upload) | Full control (LoRA, QLoRA, full weights) |
| Ops overhead | Near zero | Near zero | High (vLLM/SGLang, scaling, on-call) |
| Sweet spot | Complex reasoning, low-to-mid volume | Bulk structured tasks, 50M to 5B+ tok/mo | Strict compliance, custom weights, 1B+ frontier swap |
Most teams jump straight from Tier 1 to pricing out Tier 3 GPUs when their OpenAI or Anthropic bill climbs. Almost every time, Tier 2 solves the cost and lock-in problem long before renting dedicated GPUs makes sense.
Privacy rules and custom fine-tuned weights trigger self-hosting far more often than token bills alone.
Check the license before you ship
“Downloadable on Hugging Face” does not mean “free to ship in any product.” Open-weight licenses differ wildly, even between two models from the same lab. Always read the repo’s LICENSE file instead of the announcement post.
Apache 2.0 and MIT: the cleanest commercial footing
Models like Qwen3, Qwen3.8-27B, Mistral’s Apache-2.0 models, and Meta’s Muse Glimmer use Apache 2.0, while DeepSeek V3 and R1 use MIT.
You can run them inside a paid SaaS, resell API calls, quantize them, fine-tune on private data, and distill their outputs into smaller models, just keep the copyright and license notice. Apache 2.0 also adds an explicit patent grant, which enterprise legal teams love.
Custom community licenses (Llama, Gemma, flagship open weights)
Meta’s Llama Community License looks permissive at first glance, yet carries three real catches:
- 700M monthly user cap. Above 700M MAU you need a separate commercial license from Meta (something enterprise buyers and M&A lawyers flag).
- Branding rules. Redistributing modified weights requires showing “Built with Llama” and starting derivative names with “Llama”.
- No distilling into other model families. You can’t use Llama outputs to train or improve a Qwen or Gemma model.
Google’s Gemma Terms of Use drop the 700M cap, yet force you to pass Google’s Prohibited Use Policy through to your own customers and let Google update those terms later.
And never assume one model family uses one license: Qwen3.8-27B is Apache 2.0, while Qwen3.8-2.4T-A95B uses a custom Qwen3.8-Max license. Kimi K3.1 Pro adds revenue and MAU triggers ($20M/year if reselling as a model service, or 100M MAU / $20M monthly revenue for attribution), and Amazon Ergo adds a similar $20M annual gross-revenue threshold if you resell raw API inference as a Model-as-a-Service business (while exempting internal use and product features).
| License family | Example models | Commercial SaaS | Distill into another model family | User or revenue cap | Naming / attribution requirement | Explicit patent grant |
|---|---|---|---|---|---|---|
| Apache 2.0 | Qwen3, Qwen3.8-27B, Muse Glimmer | Yes | Yes | None | Keep license and NOTICE file | Yes |
| MIT | DeepSeek V3 / R1 | Yes | Yes | None | Keep copyright and license text | No |
| Llama Community License | Llama 3 / 4 series | Yes (below cap) | No (Llama family only) | 700M MAU | ”Built with Llama” + derivative prefix | Limited |
| Gemma Terms of Use | Gemma 3 / 4 series | Yes | Permitted under ToU | None | Flow down Prohibited Use Policy | No |
| Custom flagship open-weight | Qwen3.8-Max, Kimi K3.1 Pro, Amazon Ergo | Check specific file | Often restricted | Varies ($20M rev / 100M MAU) | Often required above threshold | Varies |
Training data rules and hosting your own copy
One quiet legal trap: closed APIs (OpenAI, Anthropic, Google) almost all forbid using their API answers to train or fine-tune a competing open-weight model. When I build fine-tuning datasets, I use human labels, real test/SQL outputs, or Apache 2.0 / MIT teacher models instead.
And if you self-host, never pull weights straight from Hugging Face when a GPU boots. Mirror the safetensors files, tokenizer, and LICENSE into your own S3/R2/GCS bucket pinned by SHA-256 so an upstream rename, rate limit, or deletion never breaks autoscaling.
Where closed frontier models still pull ahead
Open-weight models now match closed APIs on summarization, translation, drafting, extraction, and isolated code helpers. Still, frontier proprietary models keep a clear lead in four spots:
- Long multi-file coding sessions. Working across a 60,000-line repo over 25 turns with 60k tokens of diffs and stack traces is where frontier models still shine. Smaller or quantized open models often look sharp on turn 1, then loop on the same broken fix once logs pile up.
- Knowing when not to call a tool. Formatting valid JSON is easy now. Deciding when to ask for a missing field or refuse a dangerous tool call under strict rules is harder, and many open-weight models still fire tools eagerly with guessed arguments.
- Messy PDFs and dense screenshots. On skewed 30-page scans, tiny 10px dashboard tables, or cluttered diagrams, closed vision models still make noticeably fewer silent misreads.
- Managed prompt caching and uptime. Frontier providers run global failover and deep prefix caching (cutting repeated multi-turn prompt costs 75% to 90%). On multi-tenant open-weight hosts without sticky routing, consecutive turns often hit different GPUs and miss the cache.
Where open-weight models win
Once an AI feature runs at scale, raw smarts stop being the only thing that matters:
- Locked versions forever. Closed APIs retire snapshots every 6 to 12 months and silently tweak safety layers. With open weights, pinning the SHA-256 weight hash next to your vLLM/SGLang container digest means nothing changes under your feet a year later.
- Hard network privacy. Even with Zero Data Retention (ZDR) contracts, banks, healthcare networks, and EU public agencies often require proof that data never leaves a private VPC. Self-hosted open weights cut outbound traffic at the firewall.
- Small LoRA fine-tunes instead of giant prompts. Instead of paying for 8,000 tokens of few-shot examples on every single call forever, you can train a 50–200 MB LoRA adapter and serve multiple customer/task adapters on one base GPU (multi-LoRA in vLLM/SGLang), shrinking prompts to 350 tokens. A fine-tuned small AI model often beats a general giant model on one narrow job.
- Full sampler and grammar control. Closed reasoning models lock
temperature, hidelogprobs, and limit JSON schemas. Open weights let us read fulllogprobs, compile custom SQL/DSL grammars (XGrammar/Outlines), and tunemin_por logit filters directly. - Noisy-neighbor isolation and price competition. Having five competing clouds host the same Apache 2.0 model keeps prices tight and lets you fail over in minutes.
Live streaming benchmark: why leaderboards hide real bugs
Public leaderboards average hundreds of puzzles and hide two things that break apps: how streaming wait time feels and whether the model obeys a “don’t call this tool” guard.
I ran a live streaming test (node run.mjs) across four OpenAI models (gpt-4.1-mini, gpt-4.1, gpt-5-nano, and gpt-6-luna) on two checks:
- Find and fix a real TypeScript timer leak:
export async function withTimeout<T>(
promise: Promise<T>,
ms: number
): Promise<T> {
let timer: ReturnType<typeof setTimeout>
const timeout = new Promise<never>((_, reject) => {
timer = setTimeout(() => reject(new Error('Timed out')), ms)
})
return Promise.race([promise, timeout])
}
When promise finishes early, setTimeout stays alive in Node’s event loop until ms expires, leaking timers and keeping CLIs open. The fix has to call clearTimeout(timer) in a finally block.
- Obey a strict guarded tool call (with 1,500 tokens of output headroom) where a rule forbids firing the tool unless a precondition passes.
Here is the streaming timing loop I used to separate TTFT (wait time to the first visible character) from decode speed (tok/s once text starts flowing):
const startedAt = performance.now()
let firstTokenAt = null
let visibleText = ''
for await (const chunk of stream) {
const delta = chunk.choices?.[0]?.delta?.content
if (delta) {
if (firstTokenAt === null) {
firstTokenAt = performance.now()
}
visibleText += delta
}
}
const finishedAt = performance.now()
const ttftMs = Math.round((firstTokenAt ?? finishedAt) - startedAt)
const totalMs = Math.round(finishedAt - startedAt)
const decodeSeconds = Math.max((finishedAt - (firstTokenAt ?? finishedAt)) / 1000, 0.001)
const tokPerSec = Number((outputTokens / decodeSeconds).toFixed(1))
Here is the actual terminal run along with the monthly cost model:

| Model | TTFT | Total Latency | Decode Speed | Input / Output Tokens | Timer Fix | Tool Guard | Tool Latency |
|---|---|---|---|---|---|---|---|
gpt-4.1-mini | 705 ms | 2,301 ms | 93.4 tok/s | 108 / 149 | PASS | PASS | 827 ms |
gpt-4.1 | 701 ms | 1,692 ms | 225.0 tok/s | 108 / 223 | PASS | PASS | 598 ms |
gpt-5-nano | 6,929 ms | 6,929 ms | 216.5 tok/s | 107 / 1,500 | FAIL | PASS | 2,636 ms |
gpt-6-luna | 4,833 ms | 5,828 ms | 581.9 tok/s | 107 / 579 | PASS | FAIL | 240 ms |
Three real bugs jumped right out of that 4-row table:
- Non-reasoning models feel way snappier in live UIs. Both
gpt-4.1andgpt-4.1-ministarted printing in ~700 ms, caught theclearTimeoutbug, and respected the tool guard. Staring at an empty screen for 5 to 7 seconds feels broken in an IDE or chat box, even if words pour out fast afterward. - Running out of thinking tokens returns nothing. Look at
gpt-5-nano: TTFT equaled total time (6,929 ms), output hit the exact1,500-token cap, and the fix failed because hidden thinking burned all 1,500 tokens before printing one visible word. - Fast typing doesn’t save a broken tool guard.
gpt-6-lunastreamed at a wild 581.9 tok/s and nailed the timer leak, yet broke the tool guard in 240 ms.
Notice the two newest reasoning models failed opposite tests. I never trust a leaderboard or a new release inside my tool loop until it passes my own prompts, token caps, and guard tests.
Monthly GPU break-even math: when self-hosting loses and when it wins
Napkin GPU math tricks teams into renting GPUs way too early. Someone divides $2.80/hr for an H100 by a peak synthetic 2,000 tok/s benchmark and thinks APIs are a ripoff.
Real traffic ruins that math fast: daytime peaks tower over 3 AM traffic, prompts are much longer than replies, and real uptime needs at least two GPUs so one crash doesn’t take your app offline.
I modeled monthly Total Cost of Ownership (TCO) from 50 million to 5 billion tokens/month using realistic numbers (75% input / 25% output):
- Hosted open-weight API:
$0.4125/Mblended ($0.30in /$0.75out on 70B/MoE endpoints). - Small closed API (
gpt-4.1-mini):$0.70/Mblended ($0.40in /$1.60out). - Frontier closed API:
$6.00/Mblended ($3.00in /$15.00out). - Self-hosted HA cluster: at least 2× H100 GPUs at
$2.80/hr($2,044/moeach) plus a modest$1,500/mofor monitoring, load balancer, and ops =$5,588/mominimum floor, scaling to 5 GPUs ($11,720/mo) at 5 billion tokens/month.
Here is the Node.js calculator so you can plug in your own rates and volume:
const HOURS_PER_MONTH = 730
const H100_HOURLY_USD = 2.8
const MONTHLY_OPS_USD = 1500
const TOKENS_PER_GPU_MONTH_M = 1000
const BLENDED_RATES_PER_M = {
hostedOpen: 0.3 * 0.75 + 0.75 * 0.25,
smallProp: 0.4 * 0.75 + 1.6 * 0.25,
frontierProp: 3.0 * 0.75 + 15.0 * 0.25,
}
function estimateMonthlyTco(monthlyMTokens) {
const gpuNodes = Math.max(2, Math.ceil(monthlyMTokens / TOKENS_PER_GPU_MONTH_M))
const gpuCost = gpuNodes * H100_HOURLY_USD * HOURS_PER_MONTH
return {
monthlyMTokens,
hostedOpenUsd: Math.round(monthlyMTokens * BLENDED_RATES_PER_M.hostedOpen),
smallPropUsd: Math.round(monthlyMTokens * BLENDED_RATES_PER_M.smallProp),
frontierPropUsd: Math.round(monthlyMTokens * BLENDED_RATES_PER_M.frontierProp),
selfHostedHaUsd: Math.round(gpuCost + MONTHLY_OPS_USD),
gpuNodes,
}
}
for (const volume of [50, 200, 500, 1500, 5000]) {
console.log(estimateMonthlyTco(volume))
}

| Monthly Volume | Hosted Open-Weight API | Small Proprietary API | Frontier Proprietary API | Self-Hosted HA (H100) | GPU Nodes |
|---|---|---|---|---|---|
| 50M tokens | $21 | $35 | $300 | $5,588 | 2 |
| 200M tokens | $83 | $140 | $1,200 | $5,588 | 2 |
| 500M tokens | $206 | $350 | $3,000 | $5,588 | 2 |
| 1,500M tokens | $619 | $1,050 | $9,000 | $5,588 | 2 |
| 5,000M tokens | $2,063 | $3,500 | $30,000 | $11,720 | 5 |
Look at where the crossover lines actually land:
- Under 1 billion tokens/month, self-hosting loses to every API. At 50M tokens, 2 H100s cost $5,588/mo vs $21/mo hosted open-weight (266x cheaper) and $300/mo frontier. Even at 500M tokens, frontier is still $3,000 vs $5,588. Self-hosting only passes frontier around 931M tokens/month (
$5,588 / $6.00). - Even at 5 billion tokens/month, hosted open-weight APIs still crush self-hosting on price: $2,063/mo (and
$3,500/mosmall closed) vs $11,720/mo for 5 H100s.
Why can a hosted open-weight cloud beat your own H100s by 5x? Four real-world drags eat dedicated GPUs alive:
Paying for empty GPUs at 3 AM
App traffic at 2 PM on Tuesday is routinely 3x to 5x higher than at 3 AM or Sunday morning. You have to size GPUs for peak plus failover, then pay full hourly rent while they sit 90% idle overnight. Multi-tenant clouds pool Tokyo, London, and New York onto one fleet so GPUs stay busy around the clock.
Multi-GPU replicas double or quadruple the floor
Our table assumed one 80 GB H100 per replica (fine for 8B–32B in 16-bit or 70B in FP8). A full 16-bit 70B model (~140 GB) or big MoE with 64k context needs 2 to 4 GPUs per replica, meaning 4 to 8 GPUs minimum for high availability, multiplying that $5,588 floor overnight.
Slow GPU cold starts break naive autoscaling
Booting a new H100 pod, downloading 40–140 GB of weights, and warming CUDA graphs takes 45 seconds to 4 minutes. You can’t stall a live user for 2 minutes, so you end up keeping warm spares running anyway. Spot GPUs drop mid-stream unless you build drain queues, and 1-year reserved commitments (25–35% off) lock you into older hardware while models evolve quarterly.
Serving ops and 4-bit precision drift
Tuning vLLM memory flags, chunked prefill, prefix caching, and engine upgrades takes real engineering time (a quarter of a senior engineer’s month already blows past $4,000/mo). And squeezing weights down to INT4/AWQ to save GPUs can silently break JSON schemas or tool guards unless you re-run your full eval suite.
Self-hosting makes total sense for VPC privacy, custom fine-tunes, forever-pinned versions, or replacing $10k+/mo frontier bills. Just don’t rent GPUs expecting to undercut hosted open-weight APIs under 5B tokens/month.
Hybrid routing: getting the best of both worlds
Most apps aren’t 100% hard reasoning. Roughly 80% of tokens go to routine jobs (tagging, extracting fields, cleaning webhooks, summarizing threads), while only 10% to 20% need deep reasoning or multi-file coding.
Send 85% of a 1,500M-token/month app to hosted open-weight ($526) and 15% to frontier ($1,350), and your bill drops from $9,000/mo (all frontier) or $5,588/mo (self-hosted) down to $1,876/mo with zero GPU ops.
Whenever code can check the answer cheaply (Zod schema, JSON.parse, tsc, SQL validator, unit test), try the cheap tier first and only escalate failures to frontier:
In regulated industries you can even combine Tier 3 and Tier 1: run a small VPC model to scrub PII into placeholders, then send only anonymized data to frontier if needed.
Because closed APIs, hosted open-weight clouds, and vLLM/SGLang all speak OpenAI-compatible HTTP, a tiny TypeScript adapter handles escalation, failover, and clean timeout cancellation (clearTimeout in finally):
type ModelTier = 'hosted-open' | 'small-prop' | 'frontier'
interface EndpointConfig {
baseUrl: string
apiKey: string
model: string
timeoutMs: number
}
const ENDPOINTS: Record<ModelTier, EndpointConfig> = {
'hosted-open': {
baseUrl: process.env.OPEN_WEIGHT_BASE_URL!,
apiKey: process.env.OPEN_WEIGHT_API_KEY!,
model: 'qwen/qwen3-32b',
timeoutMs: 12000,
},
'small-prop': {
baseUrl: 'https://api.openai.com/v1',
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-4.1-mini',
timeoutMs: 15000,
},
frontier: {
baseUrl: 'https://api.openai.com/v1',
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-4.1',
timeoutMs: 30000,
},
}
async function callTier(tier: ModelTier, prompt: string): Promise<string> {
const cfg = ENDPOINTS[tier]
const controller = new AbortController()
const timer = setTimeout(() => controller.abort(), cfg.timeoutMs)
try {
const res = await fetch(`${cfg.baseUrl}/chat/completions`, {
method: 'POST',
signal: controller.signal,
headers: {
'content-type': 'application/json',
authorization: `Bearer ${cfg.apiKey}`,
},
body: JSON.stringify({
model: cfg.model,
temperature: 0,
messages: [{ role: 'user', content: prompt }],
}),
})
if (!res.ok) {
throw new Error(`${tier} HTTP ${res.status}`)
}
const data = await res.json()
return data.choices[0].message.content ?? ''
} finally {
clearTimeout(timer)
}
}
export async function runWithEscalation<T>(
prompt: string,
parseAndVerify: (raw: string) => T
): Promise<{ result: T; tier: ModelTier }> {
const order: ModelTier[] = ['hosted-open', 'small-prop', 'frontier']
let lastError: unknown
for (const tier of order) {
try {
const raw = await callTier(tier, prompt)
return { result: parseAndVerify(raw), tier }
} catch (err) {
lastError = err
}
}
throw lastError
}
Log tier, model, ttft_ms, in_tok, out_tok, cached_tok, and escalated_from on every call. If your cheap tier fails 45% of the time, stop escalating and either fix the prompt, fine-tune a LoRA, or route that task straight to frontier. And never switch providers mid-conversation inside a long multi-turn chat, or you throw away the warm prompt cache on turn 5.
How I choose for a new project
- Start on a fast closed API (
gpt-4.1orgpt-4.1-mini) and save 50 to 100 real test cases in a JSONL file, including ugly edge cases and tool guards. - Move proven routine jobs to hosted Apache 2.0/MIT models (via a Tier 2 host or OpenRouter) once they match your pass rate at
$0.41/Minstead of$6.00/M. - Keep hard jobs on frontier APIs. Paying
$300/mofor 50M tokens of reliable coding or PDF parsing beats losing two days debugging subtle open-model misses. - Only rent dedicated self-hosted GPUs when a real trigger hits: a legal VPC-only data rule, custom fine-tuned/multi-LoRA weights, or sustained 1B+ tokens/month replacing frontier API spend.
- Keep personal laptop models in a separate bucket. Running an open model on a Mac you already own (see running LLMs locally vs paying for an API and how to run an LLM locally) is awesome and nearly free, totally different from committing
$5,588/moto a 24/7 cloud GPU cluster.
Pick the simplest tier that passes your own tests, read the LICENSE file before shipping, keep your HTTP client swappable, and let your real monthly invoices tell you when to move tiers.
For the cost math behind those API invoices, see token pricing and budgeting, and for when customizing open weights actually pays off, see how LLM training and fine-tuning work.
Want me to talk about your product? You can sponsor this site.
Related posts about ai: