Usage Tiers for LLM Coding Assistants and the Cost of Private Deployment
This article explains why LLM coding assistant services use tiered usage quotas, breaks down the cost structure of model inference—including prefill, decode, KV cache, and fixed costs with a worked example—and compares cloud-based API calls against self-hosted inference. It also covers the key engineering steps for private deployment, common mistakes in ROI estimation, and practical recommendations for deciding which approach fits your workload.
1. Where Usage Tiers Come From
Coding assistant services built on large language models typically offer multiple usage tiers. The differences between tiers are not arbitrary pricing decisions; they reflect how the provider allocates compute budgets, concurrency limits, and per-unit-time throughput across its user base. An inference cluster must serve many users simultaneously, and quotas exist to keep the load within what the infrastructure can handle.
For users, moving to a higher tier usually means two things. First, each task can consume a longer context and you get more requests. Second, response speed remains more stable during peak hours. To decide whether a tier fits your needs, first measure your actual usage, then compare it against the quota each tier provides.
2. The Cost Structure of Inference
The cost of a single LLM call comes mainly from the following components.
- Prefill: When processing input tokens, the model runs one full forward pass over the entire context. The longer the context, the more compute this requires, and the higher the time to first token.
- Decode: Output tokens are generated one by one, and generating each token requires reading the model weights and the cache. This phase is mostly bound by memory bandwidth, and batching strategy has a large impact on it.
- KV cache: Each request’s intermediate states are cached, consuming significant GPU memory. The remaining memory determines how many concurrent requests a single card can handle.
- Fixed costs: Hardware purchase or rental, electricity, data center facilities, networking, and operations staff.
You can normalize total cost to a per-million-token figure with the following method:
def cost_per_million_tokens(hourly_cost, tokens_per_second, utilization):"""hourly_cost: total hourly cost of one inference devicetokens_per_second: effective output throughput at full load (tokens/sec)utilization: actual utilization, between 0 and 1"""effective_tps = tokens_per_second * utilizationtokens_per_hour = effective_tps * 3600return hourly_cost / tokens_per_hour * 1_000_000# The parameters below are only for demonstrating the calculation,# not measured dataprint(round(cost_per_million_tokens(hourly_cost=30, tokens_per_second=800, utilization=0.5), 2))
Utilization often affects unit cost more than the hardware price itself. On the same device, if utilization drops from 50% to 25%, the cost per million tokens doubles. Therefore, the economics of self-hosting inference depend first on whether your workload can keep the devices consistently busy.
3. Cloud APIs vs. Self-Hosted Inference
| Dimension | Cloud API | Self-Hosted Inference |
|---|---|---|
| Startup cost | Low; pay-as-you-go or subscription | High; hardware purchase or long-term rental |
| Operations effort | Handled by the provider | Dedicated staff for drivers, inference frameworks, and model versions |
| Cost structure | Grows linearly with usage | Mostly fixed costs; unit price falls at high utilization |
| Data boundary | Depends on terms of service and contracts | Data stays inside your own environment; strong control |
| Model selection | Limited to the provider’s model catalog | Free choice of models, but you must review licenses yourself |
Self-hosting only becomes more economical than cloud APIs when the workload is stable and close to full capacity over the long term. For workloads with large fluctuations and pronounced peaks and valleys, on-demand cloud calls are usually the more sensible choice.
4. Key Steps in Self-Hosting Inference
1. Model selection and license review
First confirm whether the model’s license permits commercial use, redistribution, and offering it as a service to others. License restrictions can invalidate the entire plan, so this step should be completed before any cost calculation.
2. Quantization and precision trade-offs
Quantization formats such as INT8, FP8, and INT4 can significantly reduce memory footprint, enabling more concurrency or the use of smaller devices. Quantization also degrades output quality, and sensitivity varies by task. For scenarios like code generation and structured output, you need to validate each item against your own evaluation sets rather than relying on general benchmark scores.
3. Inference serving framework
Mature inference serving frameworks generally support continuous batching and dynamic KV cache management. They merge the decode steps of different requests into shared execution, avoiding the compute waste of processing requests strictly one after another. When selecting a framework, evaluate its support for your target model architecture, its concurrency scheduling capability, and the completeness of its operational tooling.
4. Hardware adaptation
Different accelerator cards differ in operator coverage, compilation toolchains, and framework versions. When migrating to a new compute ecosystem, common problems cluster around three areas: missing operators, numerical precision differences, and performance tuning. Run small-scale benchmarks first to confirm functional correctness item by item, then evaluate throughput and latency.
5. Observability and capacity planning
Metrics that need continuous monitoring include time to first token, output tokens per second, request queuing time, GPU memory utilization, and error rate. This data both exposes bottlenecks and serves as the basis for deciding how many nodes to add when scaling.
5. Common Pitfalls in ROI Estimation
When estimating the returns of self-hosted inference, the following biases are the most common.
- Counting only hardware prices. Electricity, data center facilities, networking, operations staff, and downtime losses are also costs.
- Substituting peak throughput for average throughput. Peak figures only hold for short periods; long-term returns should be calculated using average throughput and real utilization.
- Ignoring idle periods. When load drops at night or on weekends, fixed costs persist, dragging down overall utilization.
- Treating “it runs” as “it serves reliably.” Rate limiting, retries, health checks, and alerting all require engineering effort; without them, service quality cannot be guaranteed.
- Overlooking compliance boundaries. If you resell inference capacity or open it to third parties, you must check the model license and relevant terms of service, and meet data protection and privacy requirements.
6. Practical Recommendations
- Start by running the business on cloud APIs, and record real token usage, peak concurrency, and average concurrency.
- Use this data to estimate total monthly token volume, then calculate the fixed and marginal costs of a self-hosted solution and find the crossover point between the two options.
- Run a small-scale proof of concept for the self-hosted option, focusing on post-quantization output quality, time to first token, and stability over extended operation.
- Complete license review and data compliance checks before doing cost calculations.
- Build billing, rate limiting, and access control into the design from the start, so both internal use and external services have clear quota management.
Usage tiers are, at their core, a way of allocating compute and cost. Whether to self-host inference comes down to three questions: whether the workload is sustained, whether utilization can stay high, and whether the team can carry the operational burden over the long term.
