Background Mobile

Commercial LLM API or Open Weights: Three Constraints That Decide

artificial intelligence/
September 17, 2026
Commercial LLM API or Open Weights: Three Constraints That Decide

Choosing between a commercial LLM API and open-weights models is one of the most consequential infrastructure decisions you'll make early in an AI product. Get it wrong and you'll either overpay by an order of magnitude or spend six months on MLOps work that wasn't in the plan. This post walks through the three constraints that actually decide the question.

What Does "Open Weights" Actually Mean in Practice?

Open weights means the model parameters are publicly released. You download them, you run them. That's it. It does not mean open source in the traditional sense; the licence terms vary significantly. Llama 3.1 405B is open weights but has a commercial use policy that restricts deployment at scale above 700 million monthly active users. Mistral's models use Apache 2.0, which is genuinely permissive. Falcon 180B uses a custom licence. Read the licence before you architect anything.

The practical implication is that open weights gives you a binary you control. You can fine-tune it, quantise it, run it on your own GPU cluster, and it never phones home. Commercial APIs like GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are the opposite: you send tokens out, you get tokens back, and the provider controls everything in between.

Constraint One: Data Residency and Confidentiality

This is the constraint that overrides everything else for a large set of use cases.

If you are processing documents that contain personally identifiable information governed by GDPR, protected health information under HIPAA, or anything covered by India's DPDP Act, sending that data to a third-party API requires a Data Processing Agreement, legal review, and often explicit consent from the data subject. Some categories of data — certain financial records, patient notes, classified government information — cannot legally leave a specific jurisdiction at all.

Commercial providers have DPAs available. OpenAI's enterprise tier, Azure OpenAI, and AWS Bedrock all offer DPAs and, in some cases, regional data residency guarantees. But a DPA is not a technical control. It is a contractual assurance. For high-stakes regulated data, many organisations treat that as insufficient and require the model to run in their own environment.

Open weights models running in your VPC or on-premises are a hard technical boundary. No data leaves. That solves the residency problem cleanly, at the cost of everything else you have to manage.

If your use case handles data that is genuinely non-sensitive — public documents, internal knowledge bases with no PII, marketing copy — data residency is not a binding constraint and you can evaluate on other factors.

Constraint Two: Inference Cost at Your Actual Volume

The pricing gap between commercial APIs and self-hosted open-weights models is real, but it depends entirely on your volume and your ability to utilise GPU capacity.

Model Input cost per 1M tokens Output cost per 1M tokens
GPT-4o (as of mid-2025) ~$2.50 ~$10.00
Claude 3.5 Sonnet ~$3.00 ~$15.00
Gemini 1.5 Pro ~$1.25 ~$5.00
Llama 3.1 70B (self-hosted, A100 80GB spot) ~$0.10–0.30* ~$0.10–0.30*

*Self-hosted cost estimate assumes roughly 3,000–4,000 tokens/second throughput on a single A100 80GB and spot instance pricing on AWS or GCP. Your number will vary based on batch size, quantisation, and whether you can keep the GPU busy.

The crossover point matters. If you are running under roughly 100 million tokens per month, a commercial API is almost certainly cheaper once you account for GPU instance costs, engineering time to set up vLLM or TGI, and the operational overhead of keeping a serving stack running. Above roughly 500 million to 1 billion tokens per month, self-hosted starts winning on pure cost, assuming reasonable GPU utilisation.

Utilisation is the hidden variable. A GPU sitting idle at 20% utilisation because your traffic is spiky is expensive. Commercial APIs have no idle cost. If your workload is bursty rather than steady, that changes the economics significantly.

/// Not sure where to start?

Get the architecture before you commit

Tell us what you're building and we'll map the technical approach, stack, and rough timeline. No cost, no obligation, no sales call required.

What About Fine-Tuning Cost?

Fine-tuning adds another dimension. Fine-tuning a 7B parameter model on a custom dataset of 50,000 examples costs roughly $20–50 on a single A100 via a managed service. Fine-tuning a 70B model is in the hundreds. Fine-tuning GPT-4o is not publicly available at time of writing; GPT-3.5-turbo fine-tuning costs around $8 per million training tokens. If your differentiation depends on a heavily customised model, open weights gives you more control over that process and lets you run fine-tuning experiments without per-token charges on training data.

Constraint Three: Latency Profile and Tail Latency

Median latency is rarely the problem. Tail latency is.

Commercial APIs, particularly OpenAI and Anthropic, have P99 latencies that can spike to 30–60 seconds during peak hours for large context requests. That is not theoretical; it's observable if you instrument your calls. For user-facing features with a hard timeout, this is a real failure mode.

Self-hosted models give you predictable latency because you control the queue. With vLLM's continuous batching, a Llama 3.1 70B model on two A100s can sustain around 2,000–3,000 tokens per second of output throughput with P99 latencies under 2 seconds for typical generation lengths. You own the infrastructure, so you can scale it to your SLA.

The trade-off is that owning the infrastructure means you are also responsible for it failing. A misconfigured CUDA driver, a GPU memory leak, a botched deployment, these become your incidents. Commercial APIs abstract that away.

For batch workloads — document processing, nightly pipelines, offline analysis — tail latency barely matters and cost dominates. For synchronous user-facing inference, latency SLAs matter more and the calculus shifts depending on your tolerance for API variance.

Is There a Hybrid Approach That Actually Works?

Yes, and it is increasingly the practical answer for teams past early-stage.

Route by sensitivity and volume. Use a commercial API for low-volume, high-complexity reasoning tasks where you want the best model available without operational overhead. Run a self-hosted open-weights model for high-volume, well-defined tasks — classification, extraction, summarisation — where you have benchmarked quality against your specific data and the model is good enough.

The routing layer itself can be as simple as a feature flag per task type. You do not need a sophisticated semantic router to start. Define your task taxonomy, benchmark both options against a held-out eval set you actually care about, and set the threshold based on quality delta versus cost delta.

The risk with hybrid is that you now maintain two serving stacks, two sets of prompts, and two evaluation pipelines. That has a real engineering cost. If your team is under five engineers, that overhead is probably not worth it.

Conclusion

Three questions decide this: Does your data have to stay inside a technical boundary you control? What does your monthly token volume look like, and is it steady enough to justify GPU utilisation? And what latency SLA does your product actually need?

If any one of those answers points hard in a direction, go that way. If all three are ambiguous, start with a commercial API, instrument your costs and latencies from day one, and revisit at the six-month mark with real data.

If you are at the point of modelling this decision for a specific workload, map out your token volume, your data classification, and your latency requirements and work through the numbers before committing to infrastructure.

FAQ

Can I switch from a commercial API to a self-hosted model later without rebuilding everything? You can, if you abstract your LLM calls behind a consistent interface from the start. Libraries like LiteLLM or a thin internal wrapper make this tractable. The harder migration is prompt engineering — prompts tuned for GPT-4o do not always transfer cleanly to Llama or Mistral without re-evaluation.

What open-weights model is closest to GPT-4o quality today? As of mid-2025, Llama 3.1 405B and Mistral Large 2 are the closest open-weights alternatives on general reasoning benchmarks. For code-specific tasks, DeepSeek Coder V2 performs competitively. None of them consistently match GPT-4o on complex multi-step reasoning, but the gap has narrowed considerably compared to 12 months ago.

How much engineering effort does self-hosting a 70B model actually take? Expect two to four weeks for a first production-ready deployment using vLLM and a managed Kubernetes environment, assuming your team has prior GPU infrastructure experience. Ongoing operational overhead is roughly 10–20% of one engineer's time, covering upgrades, monitoring, and incident response.

Does using a commercial API mean the provider trains on my data? Not automatically. OpenAI, Anthropic, and Google all offer opt-out of training data usage, and enterprise tiers typically exclude your data from training by default. Check the specific terms for the tier you are on. A DPA gives you contractual guarantees; verify what the default setting is before you start sending production data.

When is open weights the wrong choice even if cost and residency favour it? When you do not have the MLOps capability to run it reliably. A poorly maintained self-hosted model with no load testing, no autoscaling, and no rollback plan is worse than paying commercial API rates. The operational complexity is real. If your team has not run GPU inference in production before, the commercial API gives you breathing room to build that capability without betting your product SLA on it.

Have a project in mind? Contact Sodio Technologies to discuss your requirements and explore the right technology solution for your business.

/// Work with us

Talk to the engineers who'd build it

You'll get a technical scope, timeline and cost estimate from the people doing the work, not an account manager. In-house team, no subcontracting, since 2016.

Contact Us