Don't Judge a Model by Token Price Alone: How to Calculate Per-Task Cost for LLMs
When choosing a large language model, many teams start by comparing official token prices. But the listed price is only part of the picture—actual per-task cost also depends on output length, input context size, and retries. This article walks through a worked example using publicly disclosed comparison data, shows how to convert token prices into per-task cost, and provides a practical framework you can apply to your own workloads.
When evaluating large language models, many teams start with the officially published token prices. Price per token is important information, but it doesn’t equal the actual cost of a single task. How many tokens a model outputs per response, how much context is included in the input, and whether retries occur all shape the final bill. Using a set of publicly disclosed comparison data, this article explains how to convert token prices into per-task cost and provides a calculation method you can apply directly.
1. The Two Models at a Glance
According to publicly disclosed data, Model A has roughly 753B total parameters with about 40B activated per inference, while Model B has roughly 2.8T total parameters with about 104B activated per inference. Both score 60 on the same intelligence benchmark. This shows that on some comprehensive evaluations, a model with fewer activated parameters can match a much larger one. The reason usually lies in post-training. Pretraining determines knowledge coverage, while supervised fine-tuning, preference optimization, and other post-training techniques more directly affect instruction following and reasoning quality. That said, post-training recipes are rarely published, and benchmark scores depend on the question set, prompts, and scoring method. When citing such scores, always check the original release for test conditions.
2. Fewer Activated Parameters Doesn’t Mean Cheaper Inference
MoE architectures use sparse activation so each token only passes through a small number of expert networks, keeping per-step computation manageable. But cheap per-step doesn’t mean cheap overall. On the same batch of tasks, Model A averages about 41K output tokens per task, while Model B averages about 25K. Model A activates fewer parameters per step, yet needs to produce longer reasoning chains to reach an answer.
Long outputs affect inference services in two main ways. First, generation takes longer—end-to-end latency grows roughly linearly with output token count. Second, every request occupies KV Cache during generation; the longer the output, the more memory is consumed, and the fewer concurrent requests the same GPU memory can serve. Note that time-to-first-token (TTFT) is mainly driven by input length, prefill computation, and queue scheduling. Long outputs have little effect on TTFT, so the two should not be conflated.
3. Converting Token Prices into Per-Task Cost
Take the aforementioned official prices. Model A charges $1.40 per million input tokens and $4.40 per million output tokens. Model B charges $3.00 per million input tokens and $15.00 per million output tokens. On output price alone, Model B is about 3.4x more expensive than Model A.
Now consider a simplified scenario: each task has 2,000 input tokens, and output tokens reflect each model’s actual behavior. For Model A with 41,000 output tokens: input cost is 2,000 / 1,000,000 × 1.40 ≈ $0.0028; output cost is 41,000 / 1,000,000 × 4.40 ≈ $0.1804; total ≈ $0.183. For Model B with 25,000 output tokens: input cost ≈ $0.006, output cost ≈ $0.375, total ≈ $0.381.
The takeaway: the per-task cost gap is far smaller than the price sheet suggests. Model B’s output unit price is about 3.41x that of Model A, but it generates only about 61% as many output tokens. Multiply the two, and the actual output cost gap shrinks to about 2.1x. Under these assumptions, Model A is still cheaper, but by much less than the unit prices imply. If a model tends to produce longer outputs, or your workload uses longer inputs, the conclusion could flip—so always recalculate with real business data.
These numbers are illustrative calculations meant to demonstrate the method, not a formal cost benchmark of the two models. To get decision-grade figures, collect average input tokens, average output tokens, retry counts, cache hit rates, and system prompt length from your own business samples, then plug them into the formula.
4. Hidden Costs Often Missed During Selection
Beyond input and output tokens, several factors can change the bill:
- System prompts are counted as input on every call. The longer the prompt, the more costs amplify.
- Retries after failures are billed again.
- Multi-turn conversations that resend the full history each turn cause input tokens to grow with every round.
- Some platforms offer discounts for cache hits on input tokens; a well-designed caching strategy can meaningfully reduce costs.
- Self-hosted models also require accounting for GPU hours, operations effort, and idle resources.
5. What Lightweight Open-Source Models Offer
A class of lightweight open-source models with around 27B parameters has recently emerged. After dedicated optimization, one such model scores 52 on the intelligence benchmark. These models matter because small and mid-sized teams can deploy them on limited compute to serve vertical use cases. However, benchmarks differ widely in questions, versions, and settings, so 52 points and the 60 points mentioned earlier are not directly comparable. Always run comparison tests on your own tasks before deciding.
6. Actionable Engineering Practices
First, build a per-call cost estimator. Extract real requests from production logs and analyze the distribution of input and output tokens rather than relying on a single average. Long-tail requests often account for most of the cost, and averages tend to hide this.
Second, monitor token efficiency continuously. Log input tokens, output tokens, latency, and retry counts per call at the application layer, grouped by model and task type. If a model produces noticeably long outputs on a certain task type, first check whether your prompt is encouraging over-elaboration.
Third, constrain output length carefully. You can ask for concise answers via the system prompt, set a max output token limit, or use stop sequences. But these approaches carry a risk of false positives: if the limit is set too low, answers to complex tasks get truncated. Observe truncation rates and accuracy on an evaluation set before finalizing limits.
Fourth, evaluate total cost for self-hosting. If you’re considering private deployment, you can use container services and elastic GPU resources from major cloud providers, and leverage inference frameworks like vLLM or TGI to improve concurrency. Deployment cost depends on resource utilization. Under low load, pay-per-call APIs may be more economical.
In summary, token price is only the starting point for model selection. Decisions should be grounded in per-task cost, combined with output length, concurrency capacity, hidden overhead, and data privacy requirements.
