← all posts
// economics · commercial-models

Commercial vs free models for RAG systems: tools and integration quality

Say you're running a retrieval pipeline that has to cite its sources, and someone above you wants to know whether swapping the paid API for a local model would cut the bill.

Three products wearing one name tag

Separate what's on the table first. A paid API bundles inference with a service: uptime, rate limits, native tools, someone else's on-call rotation. A free hosted tier is a limited version of that same service, capped until you outgrow it, not so different from paying for a subscription when your usage pattern doesn't fit one. An open-weight model is just an artifact, and whether its license counts as open source is separate from whether you can run it profitably. Local inference doesn't remove cost, it swaps a token invoice for hardware, electricity, maintenance, and capacity planning nobody puts in the pitch deck. Four different things, and people keep comparing them like one axis with a price tag on each end.

What the retrieval loop asks of the model

For a RAG system, what you're buying is an answer the retrieved passages can support: a question, ranked passages, metadata, and whatever citation rules the product has committed to. The failure that costs you is a fluent, confident answer that quietly ignores a passage, merges two into a claim neither one makes, or invents a citation that looks right until someone checks it. That's expensive in a way a slow response never is: a cheap call that fails validation, triggers a retry, and burns ten minutes of a reviewer's afternoon can cost more than the pricier call that finished the job in one pass. Underneath, the axis that matters is tool reliability: schemas, streaming, argument precision, authorization, error states, anything that has to persist across a turn. On the open side that's a local open-weight generator paired with local embeddings, glued together by code you wrote and now own; on the commercial side it's a generation API with a native search or grounding tool bolted on. Put real model names and today's prices into the experiment, then drop the specifics from the permanent rule, because providers change catalogs, free allowances get pulled, and open artifacts pick up a better quantization every few months.

Same fixtures, same bar, both routes

Run the same valid and adversarial tool fixtures down both paths and score whether the task got done, not whether the right tool name got picked. Give each route identical evidence and acceptance criteria, but let each use its own documented prompt template and API, since that difference is part of the comparison, not noise to average out. If the commercial side ships a native tool the open side has to hand-roll, count that integration gap as a real cost, not proof the two endpoints behave identically because they both accept a JSON schema. Log this per run, across both routes:

DimensionWhat you record
Routeexact model revision, not the family name
Tokensinput, cached input, reasoning, output
Timingqueue, first token, completion, timeout
Hardwareenergy draw and idle allocation
Outcomepass, retry, abstain, human repair
Overheadengineering and incident time spent
Constraintsprivacy, license, and fallback rules

The bar you're clearing is answer-bearing retrieval, correct citations, honest abstention, and end-to-end latency, roughly in that order. Keep every failed output and label why: missing evidence, an ignored instruction, a malformed structure, bad reasoning, a tool error, or an unsafe action. Those labels make a routing decision defensible later instead of a vibe. A local model, in my experience, nails the easy cases outright and only falls over once context or ambiguity crosses some threshold you couldn't always see coming.

Where each side wins, until it doesn't

The commercial route earns its price when native search, computer use, file handling, or managed conversation state removes complexity your team would otherwise build. That's not a license to route everything to the flagship model: put a cheaper tier from the same vendor into the comparison too, and cap output length and reasoning effort first. Managed capacity is worth paying for when it removes work your team would have done. A dashboard existing is not that. The open or free route earns its keep when the tool set stays small and stable and portability or custom execution genuinely matters, the same logic behind running a local-first cascade instead of defaulting every request to a remote call. It shrinks fast once the model barely fits in memory, reloads constantly, needs a human to nurse it through edge cases, or depends on a runtime only one engineer understands. Spare hardware isn't free either, not if another workload loses it the moment you start using it for inference.

The recurring mistake is treating two APIs that accept the same JSON schema as proof they behave the same under a real tool call, and the fix is boring: attach every number to a specific workload and time period. List price per million tokens and tokens per second are diagnostic, not a business outcome. What you want is cost per accepted task, p95 completion latency, how bad failures get, and how much human attention is still needed to close the loop.

Build the exit before you need it: provider-specific request and response handling behind one narrow adapter, prompts and schemas in version control, authoritative job or conversation state stored somewhere that isn't a vendor's thread object, so the boundary between systems stays visible. Contract-test streaming, tool calls, structured output, errors, cancellation, and token accounting for every route you support, not just today's. Fallback has to be explicit: if the commercial API goes down and a local model steps in as a degraded mode, fine, but the user should know the capability changed under them. If local capacity runs out, quietly routing sensitive data to a remote provider defeats the point of having a local path; privacy and authorization checks run before capability routing, not after. I wouldn't bother with any of this for a single-route pipeline that's never going near a second provider.

Re-run the comparison whenever traffic, model versions, prices, licenses, hardware utilization, or review practice shifts enough to matter. A route right at ten thousand tasks a month can be wrong at a hundred thousand. The local model that failed last year might clear the bar now on a better quantization or a tighter prompt, and the free tier that made the open route look cheap can vanish entirely. None of this needs a universal winner: the durable design is the smallest set of routes that clears the quality gate, keeps cost and data movement visible, and fails safely. Free and commercial are procurement labels, not engineering ones.

What I still don't have is a reliable way to catch, before the call goes out, that a given query is about to cross the ambiguity threshold where the local model quietly stops being trustworthy. You find out after the retry, same as everyone else.

#commercial-models#open-models#cost