Choosing LLMs in Production: Speed, Task Completion, and True Cost
API list price is a poor proxy for LLM cost. This article uses a real pipeline failure to show how latency, completion quality, and rework dominate total cost of ownership, and how to evaluate models on your own tasks with version control, validators, and fallbacks.
A real failure, not a benchmark story
In a production content pipeline, an AI coding assistant owned the scripts, and a carefully designed prompt called an LLM to produce structured reports and companion web pages. The chain had been stable. The model that rewrote prompts and generated reports was only a mid-tier “mini” model. Runtime was predictable and output was consistent.
When the client added support for custom model providers, we tried a new model marketed as high value for money. The change was small: tweak the report output format. The model looped for 18 minutes without converging. After 25 minutes and about 1 RMB of API spend, the page layout was worse than leaving the format alone. Git made rollback cheap.
The same edit on a frontier model finished cleanly in 6 minutes. List price was about 40 RMB, but subscription credits (often several times the raw token subsidy) brought the effective cost to about 4 RMB.
The lesson is not to dunk on one vendor. Many teams price models on unit token cost and ignore completion rate, speed, and rework.
Why “cheap” is often expensive
Teams start with dollars per million tokens. From an engineering-economics view, a task’s true cost is:
true cost = API spend + wait-time cost + rework cost + opportunity cost
- API spend is the only line item that is visible, and often the smallest. A prompt-format tweak is usually a few dollars or less regardless of unit price.
- Wait time. Nineteen extra minutes versus a 6-minute run dwarfs a few dollars of API delta—especially when you sit in a debug loop.
- Rework. Failed output means rollback, reruns, or hand patches. Version control saved this case. If downstream jobs already consumed bad artifacts, cost grows fast.
- Opportunity cost. Slipped schedules and lost trust are hard to meter but real.
When completion is weak, unit-price wins disappear. A cheap model can cost several times a dearer one.
Completion rate: what leaderboards hide
Public scores measure standardized benchmarks. Production work differs:
- Long-horizon constraints. Real tasks must satisfy format, business rules, and API contracts at once. Missing any one fails the job. Benchmarks rarely stress simultaneous constraints.
- Tools and multi-step work. Planning and error recovery matter more than single-turn Q&A. Weak models spin in retry loops.
- Format stability. Reports and pages need consistent structure. If the model drifts, parsers break.
The reliable test is a small eval set from your own historical tasks, not a public board. A minimal harness:
import time, jsondef evaluate(model_client, task_cases):results = []for case in task_cases:start = time.time()output = model_client.run(case.prompt, tools=case.tools)elapsed = time.time() - startpassed = case.validator.check(output) # business validator for completionresults.append({"case": case.id,"passed": passed,"latency": elapsed,"cost": model_client.last_call_cost,})return results
Run a fixed batch of real jobs. Record pass rate, latency, and cost. That ranking beats a leaderboard.
Why speed matters for interactive work
For overnight batch jobs, ten extra minutes may not matter. For interactive development—prompt edits, page debug, plan iteration—latency sets the cadence.
Slow models push people to dump larger, more complex instructions in one shot. Those prompts are exactly where weaker models fail. You get slower → more errors → more retries → slower. Frontier models feel good because they are capable and fast enough for small, frequent steps.
Portability and fallbacks
Code from different models can hand off if you stick to standard language features, common frameworks, and a clear tree. There is no lock-in to the model that first wrote the files.
Practical risk controls:
- Version every high-stakes change. Commit a clean tree before the model edits. Automated changes belong on a branch so you can revert in one step.
- Match model strength to blast radius. Format changes and core refactors go to the highest-completion model. Cheap models can handle format conversion and copy polish.
- Fallback chain. After N failures, switch providers. Keep it thin:
def run_with_fallback(task, model_chain):for client in model_chain:try:result = client.run(task)if task.validator.check(result):return resultexcept Exception:continueraise RuntimeError("all models failed validation")
- Validators, not eyeballs. Check JSON shape for reports; check that key DOM nodes exist for pages. Completion becomes a programmatic metric.
Closing
A “cheap” model feels unusable when speed, completion, and true cost are misaligned with the task. Unit price is only one variable. Mismatch turns saving money into burning it, and saving time into wasting it.
Three practices: build evals from your real jobs instead of worshipping public scores; put wait time and rework on the books; use version control, business validators, and model fallbacks as engineering insurance. Major LLM APIs—including platforms such as Baidu AI Cloud Qianfan—make it inexpensive to wire up that eval and fallback stack so selection is driven by data, not gut feel.
