Technical Writer II

When comparing models for Llama 3.3 70B-class workloads, most cost analyses sort by input token rate. That sorting is incomplete. Output tokens are generated one at a time through sequential autoregressive decoding, priced at a premium on most models in DigitalOcean’s inference catalogue, and cannot be reduced by prompt caching. The model with the lowest input rate is not always the cheapest once output volume is accounted for, and the ratio at which model rankings flip is narrower than it appears.
This article works through the mechanics of that cost structure for Llama 3.3 70B (model card), verified DigitalOcean catalogue pricing (last verified 1 Jul 2026), the output:input crossover that flips the ranking between flat-rate Llama 3.3 70B and Llama 4 Maverick, and a practical control framework for production agent workloads. Self-hosting, quantization, and GPU Droplet break-even are out of scope. Model pricing changes frequently; re-verify all rates before deploying to production.
Input processing (the prefill stage) evaluates all prompt tokens in a single parallelized forward pass through the model’s layers. The GPU handles the entire context simultaneously. Output generation (the decode stage) works serially: each token requires its own full forward pass that attends to every previously generated token. GPU utilization per generated token is a fraction of what it is during prefill, and DigitalOcean prices that asymmetry into most of its catalogue rates. This is why output carries a 2.2x to 5.4x premium over input on asymmetric-priced models, and why the cost cannot be cached away.
The key-value (KV) cache stores computed attention states for already-processed tokens. When a subsequent turn shares a prefix (system prompt, prior turns, repeated tool context), the model reads from cache instead of recomputing prefill. As sessions lengthen, cached input displaces fresh input, and the session cost split tilts heavily toward cached reads.
Measured data shows how far that tilt goes:
A per-turn curve from cold (approximately 25 to 58%) to warm (approximately 89%) is a useful mental model, but specific numbers for individual turn depths are modeled projections, not measured values.
One critical caveat: the caching discussed here is Serverless billing-level prompt caching (a per-token pricing discount on cached input), not engine-level KV or prefix caching in a self-hosted serving stack, which is a separate mechanism covered in the dedicated-GPU companion piece. On Serverless billing, DigitalOcean does not list a cache-read discount for Llama 3.3 70B specifically, so cached input on that model bills at the standard rate; other catalogue models (Qwen, DeepSeek, GLM, Kimi, MiMo variants) do carry a discounted cache-read price, and caching never discounts output on any model. TraceLab’s 11.2% figure was measured on cached sessions with discounted input; on uncached Llama 3.3 70B, the full input rate makes output’s relative weight smaller still, so 11.2% is a best case, not a typical one, here.
Session averages obscure what happens inside a single reasoning step. The inference router article measured GPT-5 output tokens by step type in live runs (June 16, 2026): a reasoning path produced 3,411 output tokens; a Q&A response produced 292; a classifier produced 80. A ratio above 6:1 output to input at a single step means output token pricing dominates that step’s cost, even when it barely registers at the session level.
The numbers below are a constructed illustrative estimate, not a measured benchmark. They are built to total 7,870 input tokens and 3,000 output tokens per task, consistent with the DigitalOcean model cost table below and the 0.38:1 aggregate ratio derived from it. The chain-of-thought decomposition step is sized to produce a 6.7:1 local ratio, the same order of per-step output dominance the Router run demonstrates.
| Step | Task | Input Tokens | Output Tokens | Out:In |
|---|---|---|---|---|
| 1 | System prompt and user query | 2,200 | 100 | 0.05 |
| 2 | Tool selection and planning | 2,000 | 380 | 0.19 |
| 3 | Tool result ingestion | 2,370 | 60 | 0.03 |
| 4 | Chain-of-thought decomposition | 300 | 2,010 | 6.70 |
| 5 | Final response synthesis | 1,000 | 450 | 0.45 |
| Total | 7,870 | 3,000 | 0.38 |
The 0.38:1 aggregate ratio sits well below the Llama 3.3 70B/Llama 4 Maverick crossover at 1.82. At this ratio, Maverick wins by $24.88 per 10,000 tasks. Step 4 alone runs at 6.7:1, far above the crossover; flat-rate Llama 3.3 70B is meaningfully cheaper at that step. Routing all steps to the model with the lowest input rate is correct on average but wrong on the step that drives output cost. The aggregate ratio is useful for session-level budget forecasting; it is not a reliable guide for per-step model selection in CoT-heavy pipelines.
All rates are per 1 million tokens, DigitalOcean Serverless Inference, last verified 1 Jul 2026 (source: DO Inference pricing). Cost columns use the reference workload of 7,870 input and 3,000 output tokens per task. The output-to-input ratio column is the point: it is invisible if you compare on input rate alone.
| Model | Input ($/1M) | Output ($/1M) | Output:Input | $/10k Tasks |
|---|---|---|---|---|
| Llama 3.3 70B | $0.65 | $0.65 | 1.00x | $70.66 |
| Llama 4 Maverick | $0.25 | $0.87 | 3.48x | $45.78 |
| Qwen3-32B | $0.25 | $0.55 | 2.20x | $36.18 |
| Gemma 4 | $0.18 | $0.50 | 2.78x | $29.17 |
| Kimi K2.5 | $0.375 | $2.025 | 5.40x | $90.26 |
| GLM-5.2 | $1.05 | $4.40 | 4.19x | $214.64 |
DigitalOcean hosts Llama 3.3 70B at a rare flat rate; most models charge two to five times more for output. Rates change; re-verify against the live pricing page before production.
Cost per task is computed as (input_tokens × input_rate + output_tokens × output_rate) / 1,000,000 using the reference workload of 7,870 input and 3,000 output tokens per task.
This function reproduces the cost-per-task column for any token counts and rates. Use it to project your workload against the model table once you have measured your actual output:input ratio.
def cost_per_task(
input_tokens: int,
output_tokens: int,
input_rate: float, # $/1M tokens
output_rate: float, # $/1M tokens
) -> float:
return (input_tokens * input_rate + output_tokens * output_rate) / 1_000_000
WORKLOAD_INPUT = 7_870
WORKLOAD_OUTPUT = 3_000
models = {
"Llama 3.3 70B": (0.65, 0.65),
"Llama 4 Maverick": (0.25, 0.87),
"Qwen3-32B": (0.25, 0.55),
"Gemma 4": (0.18, 0.50),
"Kimi K2.5": (0.375, 2.025),
"GLM-5.2": (1.05, 4.40),
}
from decimal import Decimal, ROUND_HALF_UP
def usd(value: float, places: str) -> Decimal:
# round half up so displayed cents match the hand-computed rate table
return Decimal(str(value)).quantize(Decimal(places), rounding=ROUND_HALF_UP)
for name, (in_rate, out_rate) in models.items():
task_cost = cost_per_task(WORKLOAD_INPUT, WORKLOAD_OUTPUT, in_rate, out_rate)
print(f"{name}: ${usd(task_cost, '0.000001')}/task "
f"(${usd(task_cost * 10_000, '0.01')}/10k tasks)")
OutputLlama 3.3 70B: $0.007066/task ($70.66/10k tasks)
Llama 4 Maverick: $0.004578/task ($45.78/10k tasks)
Qwen3-32B: $0.003618/task ($36.18/10k tasks)
Gemma 4: $0.002917/task ($29.17/10k tasks)
Kimi K2.5: $0.009026/task ($90.26/10k tasks)
GLM-5.2: $0.021464/task ($214.64/10k tasks)
Gemma 4 is cheapest for this workload at $29.17 per 10,000 tasks; Qwen3-32B ($36.18) and Llama 4 Maverick ($45.78) follow. Flat-rate Llama 3.3 70B ($70.66) costs more here because this workload is input-heavy (0.38:1); on output-heavy steps the ranking reverses. Kimi K2.5 ($90.26) and GLM-5.2 ($214.64) carry the highest output premiums and cost the most. These per-task and per-10,000-task figures follow from the illustrative token counts in the reference workload above; your actual costs will shift with your own workload’s output-to-input ratio, so treat the ranking as directional and recompute it against your measured token distribution.
DigitalOcean Serverless Inference delivers sub-400ms time-to-first-byte (TTFB) on Llama 3.3 70B at $0.65 per million tokens, as measured in DigitalOcean’s own model-selection tutorial. This is a first-party measurement: Llama 3.3 70B on DigitalOcean meets sub-second latency at its flat per-token rate, with no cross-host comparison required. Treat it as a reference point, not a guarantee: it was measured on DigitalOcean’s own infrastructure, and observed latency varies with load, region, prompt length, and request concurrency, so measure against your own traffic before relying on it for an SLA.
Prompt caching, where a model supports it, discounts cached reads of input tokens. Output tokens are always billed at the full output rate regardless of cache state. The DigitalOcean prefix-caching blog shows that prefix-aware routing lifts cache hit rates from approximately 25% to 75%+, compressing the input portion of the bill while leaving output unchanged.
DigitalOcean does not list a cache-read discount for Llama 3.3 70B specifically, so cached input on that model bills at the standard rate. Several other models in the catalogue, including Qwen, DeepSeek, GLM, Kimi, and MiMo variants, do carry a discounted cache-read price. Caching never discounts output on any model, regardless of whether input caching is available for that model.
Artificial Analysis computes a single headline blended price per model by using a default 7:2:1 weighting of cached-read, input, and output tokens, adjustable in their own comparison UI (source: Artificial Analysis, Llama 3.3 70B providers page). That default is cache-heavy and output-light: it assumes roughly 70 percent of your tokens are cache hits, a large assumption, and it is adjustable precisely because no single ratio fits every workload.
Measure your per-step token distribution before using any blended price as a production cost baseline.
This crossover is worked entirely within DigitalOcean’s own catalogue: Llama 4 Maverick ($0.25 input / $0.87 output) against flat-rate Llama 3.3 70B ($0.65/$0.65). Both are Meta models on DigitalOcean, so this is a model-selection decision within one catalogue. Maverick’s input advantage is $0.40 per million; its output disadvantage is $0.22 per million.
Costs equalize when:
0.65 × I + 0.65 × O = 0.25 × I + 0.87 × O
0.40 × I = 0.22 × O
O / I = 0.40 / 0.22 = 1.82
Below 1.82, Maverick is cheaper; above it, flat-rate Llama 3.3 70B is cheaper. Three worked checks confirm this, using the reference workload steps from the table above: the full reference task (0.38:1) favors Maverick, $0.004578 vs $0.007066 per task; Step 4, the CoT decomposition step (6.70:1), favors Llama 3.3 70B, $0.001502 vs $0.001824; Step 5, the final synthesis step (0.45:1), favors Maverick again, $0.000642 vs $0.000943.
Maverick’s low input rate wins on the aggregate, input-heavy workload, but its 3.48x output premium makes plain Llama 3.3 70B cheaper on output-heavy steps. A modest fraction of CoT-intensive steps can push the ratio above 1.82 and flip the ranking at the session level; sorting models by input rate alone misses this.
CoT token counts vary with prompt framing, instruction verbosity, temperature, and problem complexity. The Router measurements showed a 42:1 range, from 80 tokens (classifier) to 3,411 (reasoning path), on the same model. A cost budget built on a CoT median underestimates the bill at p95; track p95 output tokens per step type instead.
Set max_tokens (or max_completion_tokens on OpenAI-compatible endpoints) to your p95 output token count plus a 10 to 15% buffer; the mean fails at mean + 1 sigma, roughly 15% of calls. Defend against finish_reason: length: a cut-off generation returns an incomplete response, and parsing breaks silently unless you check finish_reason on every call.
import os
import openai
client = openai.OpenAI(
base_url="https://inference.do-ai.run/v1",
api_key=os.environ["MODEL_ACCESS_KEY"],
)
response = client.chat.completions.create(
model="llama3.3-70b-instruct",
messages=[{"role": "user", "content": "List the steps to configure prefix caching."}],
max_tokens=512,
)
print(response.choices[0].finish_reason)
print(response.usage.completion_tokens)
if response.choices[0].finish_reason == "length":
raise ValueError(
f"Response truncated at {response.usage.completion_tokens} tokens; "
"increase max_tokens or split the prompt."
)
Outputstop
341
If your pipeline’s step types are known at dispatch time, route by the expected output:input ratio. Steps below 1.82 (tool result ingestion, classification, short responses) route to a low-input-rate model such as Llama 4 Maverick or Gemma 4. Steps above 1.82 (CoT decomposition, long-form reasoning) route to flat-rate Llama 3.3 70B. The inference router article covers the dispatch thresholds.
Caching discounts only cached input reads; output always bills full rate. Batch inference, where available, discounts both input and output, the one mechanism applying symmetrically to both sides of the bill. Check DigitalOcean’s pricing page for current batch availability.
Track p50, p95, and p99 output token counts and alert on the p99-to-p50 ratio, which normalizes for prompt-length variation across traffic. A spike at p99 typically signals runaway CoT, a stuck tool-call loop, or a prompt that lost its length constraints. See metrics that matter for serverless inference for the instrumentation pattern.
Use these criteria to select a model within DigitalOcean’s catalogue by workload shape.
| Choose | When |
|---|---|
| Llama 3.3 70B (flat $0.65/$0.65) | Output:input above ~1.82; CoT-heavy or multi-step reasoning; sub-400ms TTFB required. |
| Llama 4 Maverick ($0.25/$0.87) | Output:input below ~1.82; input-heavy steps: tool-result ingestion, classification, RAG context. |
| Gemma 4 ($0.18/$0.50) or Qwen3-32B ($0.25/$0.55) | Lowest cost on input-heavy or mixed workloads; both still carry an output premium (2.78x, 2.20x), so confirm the step-level ratio first. |
| Kimi K2.5 or GLM-5.2 | Avoid for cost-constrained, output-heavy workloads; highest output premiums in the catalogue (5.40x, 4.19x). |
Core rule: the flat-rate model avoids the output premium on output-heavy steps; a low-input model wins on input-heavy ones. No model wins both shapes.
Input tokens are processed in a single parallelized forward pass during prefill; the GPU evaluates the entire context simultaneously. Output tokens are generated one at a time through autoregressive decoding, each requiring a full sequential forward pass. GPU utilization per generated token is far lower than during prefill, and DigitalOcean prices that gap into its rates. This is why output carries a 2.2x to 5.4x premium on most models in DigitalOcean’s catalogue, with flat-rate Llama 3.3 70B the exception.
DigitalOcean Serverless Inference runs Llama 3.3 70B at a flat $0.65 per million tokens for both input and output, so it carries no output premium. That makes it the model to reach for on output-heavy or CoT-heavy production workloads. On input-heavy workloads, Gemma 4 ($29.17 per 10,000 tasks) or Qwen3-32B ($36.18) can be cheaper. Re-verify pricing against the DO Inference pricing page before production deployment.
DigitalOcean Serverless Inference delivers sub-400ms time-to-first-byte on Llama 3.3 70B at $0.65 per million tokens, as measured in DigitalOcean’s own model-selection tutorial. That sub-second TTFB comes at the same flat rate that protects output-heavy steps from an output premium, so there is no latency-versus-cost tradeoff to make on this model. This is a DigitalOcean-measured figure and real latency varies with load, region, and prompt size, so validate it against your own workload before committing to a latency SLA.
Four mechanisms in order of leverage: set per-step max_tokens at p95 plus a buffer; route high-output steps (CoT, reasoning) to flat-rate Llama 3.3 70B using the 1.82 crossover as the threshold; use batch inference where DigitalOcean offers it, since batch discounts both input and output while caching discounts input only; and monitor p95 and p99 output token counts by step type to catch drift early. See the inference router article for routing implementation.
Not reliably. Artificial Analysis’s default 7:2:1 blending weight assumes roughly 70% cache hits and targets cross-provider comparison, not production agent cost modeling; it structurally understates cost for pipelines with significant CoT or tool-call output. Measure your per-step output:input ratio in staging first.
Prompt caching discounts cached input tokens only; it never discounts output. DigitalOcean does not list a cache-read discount for Llama 3.3 70B specifically, so cached input bills at the standard rate on that model. Other catalogue models, including Qwen, DeepSeek, GLM, Kimi, and MiMo variants, do carry a discounted cache-read price; on those, prefix-aware routing lifts cache hit rates from approximately 25% to 75%+, compressing the input portion of the bill while output stays unchanged.
At the session level, TraceLab (arXiv 2606.30560, measured) found output accounts for 11.2% of session cost in multi-agent workflows. At the per-step level, ratios range from under 0.1:1 for tool ingestion to above 6:1 for CoT decomposition. Llama 3.3 70B is relatively concise; your actual distribution depends on prompt structure and step composition.
Sample a batch of requests, compute the p95 output token count per step type, add a 10 to 15% buffer, and set max_tokens to that value. Do not use the mean: a budget at the mean truncates roughly 50% of calls. Always handle finish_reason: length explicitly, since a truncated response returns an incomplete payload without raising an exception in most SDKs.
Output token pricing is the uncacheable floor of Llama 3.3 70B inference cost: no caching mechanism eliminates it, and its per-token rate drives the model-ranking flip that input-only comparisons miss. At the session level, TraceLab’s measured 11.2% output cost share shows output rarely dominates the bill; at the per-step level, a single CoT decomposition step at 6.7:1 is enough to undo a session-level cost advantage. The crossover within DigitalOcean’s own catalogue, comparing flat-rate Llama 3.3 70B against Llama 4 Maverick, puts the breakeven at an output:input ratio of 1.82, a threshold that CoT-intensive steps routinely exceed even when the session average stays below it. For the full economics of this model on dedicated GPU infrastructure, see the LLM inference cost breakdown.
Model selection and cost control both operate at the step level, not the session level. The inference router article covers dispatch; serverless inference metrics covers monitoring.
Before committing to a model at production volume, profile your own output:input ratio per step, then project it to the catalogue table using the cost function above. Rates change; re-verify against the live pricing page before production, since the crossover threshold is narrow enough that a rate change on either side can flip the ranking.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
Building future-ready infrastructure with Linux, Cloud, and DevOps. Full Stack Developer & System Administrator. Technical Writer @ DigitalOcean | GitHub Contributor | Passionate about Docker, PostgreSQL, and Open Source | Exploring NLP & AI-TensorFlow | Nailed over 50+ deployments across production environments.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
