Modal + vLLM GPU economics — SAND-032
Qwen3-8B-AWQ on vLLM v0.29.0, Modal L4 GPUs at $0.80/h each · 24 runs, 1,713 documents, 20,406,786 tokens · generated by sandbox reports/dashboard/export_hub_reports.py from the cross-checked reports hub (1,844 source-quoted figures, 781 automated cross-checks) · sources: local-mailroom-sandbox @ 95d89fa8f401 · eval-environment @ 86b4e54fc5a2 · mailroom-ml @ d3ad22263da0
This report covers what the self-hosted leg cost and how well it used the GPUs. It answers five questions: what a token costs on a Modal L4, where the GPU money went, when a warm fleet beats a cold one, how busy the GPUs were, and what adding a second L4 did. Its companions are Cost comparison (cost per document against the hosted API) and Master report.
Summary#
- Spend. SAND-032 used $2.80 of its $5.00 cap (fleet-window ledger at close; it stood at $1.21 after stages 1–5). The runs themselves bill at least $2.18: $1.72 while the batch ran and $0.46 of cold boots. The aborted sorter run cost $0.08. The remaining $0.53 (19%) is fleet time outside any run: warm replicas waiting between runs and deploy windows. Only $1.17 (42% of the ledger) paid for GPU slots with a request in flight.
- Cost per token. A token costs $0.052 to $0.321 per million on the busy-window basis. At a fixed L4 price the only variable is throughput per L4: $ per 1M tokens = 222.2 ÷ (tok/s per L4). The cheapest run is S6 (LLM sorter, 2×L4 at c32): 98% of its tokens are input, and it ran at 4,237 tok/s per L4. The dearest is S5 (Merger agreements · MAUD prompt, 2×L4 at c32), at 692 tok/s per L4 with long decodes and a long-document tail. Per million output tokens the range is $0.82–$4.00.
- Against the hosted API, per token. On the same tasks, Modal at 2×L4 c32 is cheaper per token than every hosted model that logged tokens for correspondence, and dearer for insurance claims, corporate records, contracts and merger agreements. Those are busy-window figures. This program's ledger was 1.6× its busy-window GPU $ (boots, idle slots and warm time); at that load Modal is not cheaper per token for any task. Hosted Qwen3-8B, the same model that Modal serves as a 4-bit AWQ quantization, costs $0.169–$0.306 per 1M tokens.
- Cost per token at real utilization. A warm fleet bills by the hour whether or not it has work, so its cost per token is the busy-window figure divided by the share of time the GPUs are busy. Against the cheapest hosted model, a warm L4 fleet stays cheaper only while it is busy more than 69% of the time for correspondence; for insurance claims, corporate records, contracts, merger agreements and sorter the API is cheaper even at 100% busy.
- Where Modal deployment wins, per document. Run corporate records on self-hosted Qwen3-8B-AWQ (Modal): the measured 1×L4 configuration
sand032-s10-corporate75-v2(v2 prompts) costs $0.00039 per document against Qwen3.7-Flash via the API at $0.00079, 50% less, and scores 0.469 against 0.418. It pays once one warm L4 sustains 1,018 docs/h or a cold batch holds 191 documents. The per-class break-evens are in the cost comparison's §3. - Warm vs cold. A cold 2×L4 cycle (the 120 s scale-down tail plus a 216 s L5 boot) costs $0.149, the same as 5.6 minutes of a warm 2×L4 fleet. So stay warm when the next batch starts within 5.6 minutes and scale to zero otherwise. A single cold batch costs 1.1–22.0× its warm cost at the batch sizes measured; the boot stops mattering (under 10% premium) only past 432–10,485 documents per cold 2×L4 batch.
- Utilization. GPU compute (SM) utilization was never sampled. The measured proxy is client-slot occupancy, the share of admitted request slots holding a request. It is 82%–98% on one L4 at c8, 47%–82% across the 2×L4 c32 sweep, and lowest on insurance claims, contracts and merger agreements, where one slow document holds the batch open while the other slots drain. Idle slots inside runs cost $0.55 (32% of busy-window GPU $). vLLM recorded no preemptions on any scraped replica, so KV cache was never the constraint.
- The second L4. On the same 100 documents, 2×L4 · c16 finished in 46.1 s against 95.0 s on 1×L4 · c8 (2.06× faster). Throughput per L4 held (2,579 → 2,654 tok/s), so cost per token moved from $0.0862 to $0.0837 and cost per document stayed flat. p95 latency rose from 11.6 s to 14.4 s. The second L4 pays only if Modal's router spreads the load. With
max_inputs64, it sent 97 of 100 requests to one replica: throughput per L4 fell to 820 tok/s and cost per token rose 3.2×. Withmax_inputs32 at c64 the split was 51 / 49, and throughput per L4 reached 3,141 tok/s (+18% on c16). - Boot. 9 runs started on a cold fleet; each waited 117–219 s for the engine to answer its first request. CUDA-graph capture is most of the difference: deploy → ready went from 123 s at L1 to 216 s at L5. Boots cost $0.46, 21% of the runs' billed GPU $; one cold 2×L4 start at L5 costs $0.096.
1. Setup and method#
| Model / engine | Qwen/Qwen3-8B-AWQ (23 runs, quant awq, awq_marlin, max_model_len 32768); Qwen/Qwen3-8B (1 run, quant bf16, max_model_len 16384); vLLM v0.29.0 (not recorded in the S6 report), prefix caching on |
| Frozen serving posture (L5) | awq_marlin, fp8 KV cache, thinking off, CUDA graphs on (enforce_eager=off), max_num_seqs 16 (32 on the c64 runs) |
| Fleet | Modal L4 (24 GB VRAM per the deploy spec quoted below; not a run record), one vLLM replica per container, min = max containers pinned for each batch, scaledown 120 s |
| Price | $0.80 per L4-hour (docs/RUN-COST-DERIVATION.md in the sandbox) |
| Data | public HF mailroom-dataset (ground_truth, split all) @ ed7576b6, seed 42, nested draws (20 ⊂ 50 ⊂ 100) |
Every other value in this table is read per run from the SAND-032 run reports' header rows and serving exports (hub_data.json["fleet"]) and must agree across the runs that record it. The GPU memory is the one setup value no run records; it is quoted from the sandbox deploy spec deploy/README.md: | MODAL_VLLM_GPU | L4 | 24 GB VRAM |.
Definitions.
- Busy-window GPU $ = wall time of the batch × replicas × $0.80/h. Every $/doc and $/token here uses it, as every SAND-032 run report does.
- Billed GPU $ = (wall + cold boot) × replicas × $0.80/h. It is a lower bound on what Modal bills for the run: warm time before and after the batch is not in it.
- $ per 1M tokens = busy-window GPU $ ÷ (prompt + completion tokens) × 10⁶. Because the GPU bills by time, this equals 222.2 ÷ (tokens per second per L4).
- Client-slot occupancy = Σ request latency ÷ (client concurrency × wall). 100% means every admitted slot held a request for the whole batch. The unused share, priced at the busy-window rate, is idle-slot $.
- Effective parallelism = Σ request latency ÷ wall: how many requests were in flight on average.
- Per-replica vLLM figures come from each replica's
/metricsendpoint. Request counts are deltas over the run; TTFT means and prefix-cache hit rates are cumulative since the replica started.
Not measured. No run sampled GPU SM utilization, memory bandwidth or power (no DCGM or nvidia-smi sampling), and KV-cache usage was only scraped at idle, where it reads 0%. Occupancy and throughput per L4 are therefore the utilization evidence. See section 7.
2. GPU spend#
| Part of the ledger | USD | Share |
|---|---|---|
| Slots with a request in flight | $1.17 | 42% |
| Idle slots inside runs | $0.55 | 20% |
| Cold boots | $0.46 | 16% |
| Aborted sorter run (incident) | $0.08 | 3% |
| Fleet time outside any run | $0.53 | 19% |
The five parts sum to the $2.80 ledger. The first three come from the runs' serving exports; the incident is the aborted sorter run; the last is the ledger minus everything attributable to a run. The fleet-window ledger itself under-counts Modal billing (the program summary's finding), so treat $2.80 as a floor and reconcile it against the Modal usage page.
By stage.
| Stage | Runs | Docs | Tokens | Busy $ | Boot $ | Billed $ |
|---|---|---|---|---|---|---|
| 1×L4 knob ladder · correspondence n = 20 · c8 | 5 | 100 | 201,434 | $0.033 | $0.130 | $0.163 |
| Scale-out · correspondence n = 100 · same documents | 4 | 400 | 979,764 | $0.125 | $0.177 | $0.302 |
| Five-class sweep · 2×L4 · c32 · n = 50 | 7 | 337 | 2,182,235 | $0.521 | $0.055 | $0.577 |
| Doubled admission · 2×L4 · c64 · n = 50 | 4 | 194 | 978,550 | $0.169 | $0.00063 | $0.169 |
| v2 prompts · 1×L4 · c8 · n = 75 | 3 | 225 | 883,125 | $0.078 | $0.040 | $0.118 |
| LLM sorter · 2×L4 · c32 | 1 | 457 | 15,181,678 | $0.796 | $0.058 | $0.854 |
Before SAND-032. Tracked spend from 16–27 Sep totals $12.09, of which $11.60 was Modal GPU time; the largest item was "Sorter pipeline run (bf16)" at $7.98. With SAND-032, tracked Modal GPU spend is at least $14.40.
| Bucket | USD | Detail |
|---|---|---|
| Sorter pipeline run (bf16) | $7.98 | run-50-modal-hf: 50 docs, about 5 LLM calls each, up to 4×L4; metered |
| Granite specialist legs | $2.22 | merger $1.287; correspondence-50 $0.330; contracts halt window (low end) $0.400; contracts probes (wall × L4 rate) $0.203 |
| Qwen AWQ specialist runs (9) | $1.40 | insurance $0.094; correspondence A $0.034; correspondence B $0.125; correspondence c5 $0.114; correspondence c8 $0.056; contracts c4 $0.285; contracts c8 $0.375; corporate $0.152; merger $0.164 |
| API legs (OpenRouter) | $0.492 | 7 eval-environment legs $0.480 + qwen-flash ledger $0.012 |
3. Cost per token#
3.1 Every run#
| Run | Fleet | Docs ok | Tokens | Output share | tok/s per L4 | Busy GPU $ | $ / 1M tokens | $ / 1M output | $ / doc |
|---|---|---|---|---|---|---|---|---|---|
| L0 · baseline | 1×L4 · c8 · seqs 6 · max_inputs 32 | 20/20 | 40,202 | 8% | 1,261 | $0.0071 | $0.176 | $2.31 | $0.00035 |
| L1 · + thinking off | 1×L4 · c8 · seqs 6 · max_inputs 32 | 20/20 | 40,339 | 8% | 1,524 | $0.0059 | $0.146 | $1.88 | $0.00029 |
| L2 · + awq_marlin (reverted) | 1×L4 · c8 · seqs 6 · max_inputs 32 | 20/20 | 40,343 | 8% | 1,526 | $0.0059 | $0.146 | $1.88 | $0.00029 |
| L5 · frozen config | 1×L4 · c8 · seqs 16 · max_inputs 32 | 20/20 | 40,242 | 8% | 2,238 | $0.0040 | $0.099 | $1.32 | $0.00020 |
| S4 · bf16 Qwen3-8B (quality arm) | 1×L4 · c8 · seqs 6 · max_inputs 32 | 20/20 | 40,308 | 8% | 859 | $0.010 | $0.259 | $3.37 | $0.00052 |
| S2a · 1×L4, c8 | 1×L4 · c8 · seqs 16 · max_inputs 32 | 100/100 | 244,982 | 8% | 2,579 | $0.021 | $0.086 | $1.14 | $0.00021 |
| S2b · 2×L4, c16 | 2×L4 · c16 · seqs 16 · max_inputs 32 | 100/100 | 244,902 | 8% | 2,654 | $0.021 | $0.084 | $1.11 | $0.00021 |
| S7 · 2×L4, c64, max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 100/100 | 245,048 | 8% | 820 | $0.066 | $0.271 | $3.56 | $0.00066 |
| S9 · 2×L4, c64, max_inputs 32 | 2×L4 · c64 · seqs 32 · max_inputs 32 | 100/100 | 244,832 | 8% | 3,141 | $0.017 | $0.071 | $0.94 | $0.00017 |
| S3 · Correspondence | 2×L4 · c32 · seqs 16 · max_inputs 32 | 50/50 | 118,503 | 7% | 3,698 | $0.0071 | $0.060 | $0.82 | $0.00014 |
| S3 · Correspondence (repeat) | 2×L4 · c32 · seqs 16 · max_inputs 32 | 50/50 | 118,459 | 7% | 2,793 | $0.0094 | $0.080 | $1.10 | $0.00019 |
| S3 · Insurance claims | 2×L4 · c32 · seqs 16 · max_inputs 32 | 50/50 | 184,598 | 11% | 1,521 | $0.027 | $0.146 | $1.30 | $0.00054 |
| S3 · Corporate records | 2×L4 · c32 · seqs 16 · max_inputs 32 | 50/50 | 264,132 | 3% | 2,346 | $0.025 | $0.095 | $3.06 | $0.00050 |
| S3 · Contracts | 2×L4 · c32 · seqs 16 · max_inputs 32 | 47/50 | 378,643 | 20% | 808 | $0.104 | $0.275 | $1.39 | $0.0022 |
| S3 · Merger agreements | 2×L4 · c32 · seqs 16 · max_inputs 32 | 44/50 | 505,796 | 8% | 739 | $0.152 | $0.301 | $3.78 | $0.0035 |
| S5 · Merger agreements · MAUD prompt | 2×L4 · c32 · seqs 16 · max_inputs 32 | 46/50 | 612,104 | 8% | 692 | $0.197 | $0.321 | $4.00 | $0.0043 |
| S9 · Insurance claims | 2×L4 · c64 · seqs 32 · max_inputs 32 | 50/50 | 184,910 | 11% | 1,751 | $0.023 | $0.127 | $1.11 | $0.00047 |
| S9 · Corporate records | 2×L4 · c64 · seqs 32 · max_inputs 32 | 50/50 | 264,187 | 3% | 2,715 | $0.022 | $0.082 | $2.62 | $0.00043 |
| S9 · Contracts | 2×L4 · c64 · seqs 32 · max_inputs 32 | 44/50 | 344,854 | 19% | 785 | $0.098 | $0.283 | $1.47 | $0.0022 |
| S7 · Insurance · max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 50/50 | 184,599 | 11% | 1,584 | $0.026 | $0.140 | $1.24 | $0.00052 |
| S10 · Correspondence | 1×L4 · c8 · seqs 16 · max_inputs 16 | 75/75 | 226,796 | 5% | 3,051 | $0.017 | $0.073 | $1.34 | $0.00022 |
| S10 · Insurance claims | 1×L4 · c8 · seqs 16 · max_inputs 16 | 75/75 | 275,799 | 10% | 1,891 | $0.032 | $0.117 | $1.13 | $0.00043 |
| S10 · Corporate records | 1×L4 · c8 · seqs 16 · max_inputs 16 | 75/75 | 380,530 | 3% | 2,867 | $0.029 | $0.078 | $2.42 | $0.00039 |
| S6 · LLM sorter | 2×L4 · c32 · seqs 16 | 457/458 | 15,181,678 | 2% | 4,237 | $0.796 | $0.052 | $3.28 | $0.0017 |
What drives it.
- Throughput per L4 is the whole story. Cost per token is 222.2 ÷ (tok/s per L4), so every lever is a throughput lever. The L0 → L5 ladder raised throughput from 1,261 to 2,238 tok/s on the same 20 documents and cut cost per token 44%.
- Prompt-heavy work is cheap. Prefill is fast and prefix caching skips shared system prompts, so tasks dominated by input tokens run at high throughput. The LLM sorter (98% input) reaches 4,237 tok/s per L4.
- Long documents are expensive. Contracts and mergers run at 808 and 739 tok/s per L4 at c32. Long decodes are slow, and the last long document holds both GPUs while the other slots have drained (section 5).
- The bf16 arm costs more for no quality gain. Unquantised
Qwen/Qwen3-8Bran at 859 tok/s per L4, 1.8× the cost per token of the L1 AWQ rung on the same documents.
3.2 Three cost bases per workload#
The same measured batch, priced three ways, for the cheapest measured configuration of each workload:
| Workload | Run and fleet | Warm fleet (busy window) | One cold batch | Program-loaded | Cheapest API |
|---|---|---|---|---|---|
| Correspondence | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | $0.060 | $1.320 | $0.098 | Qwen3.7-Flash $0.087 |
| Insurance claims | S10 · 1×L4 · c8 · seqs 16 · max_inputs 16 | $0.117 | $0.388 | $0.191 | Qwen3.7-Flash $0.089 |
| Corporate records | S10 · 1×L4 · c8 · seqs 16 · max_inputs 16 | $0.078 | $0.274 | $0.126 | Qwen3.7-Flash $0.053 |
| Contracts | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | $0.275 | $0.669 | $0.447 | Qwen3.7-Flash $0.063 |
| Merger agreements | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | $0.301 | $0.596 | $0.489 | Qwen3.7-Flash · frozen (filed as Qwen3-8B) $0.037 |
| Sorter | S6 · 2×L4 · c32 · seqs 16 | $0.052 | $0.060 | $0.085 | Qwen3.7-Flash $0.032 |
- Warm fleet is the busy-window cost: the fleet was already up and fed.
- One cold batch adds the boot (the run's own when it started cold, else the L5 216 s) and the 120 s scale-down tail on every replica: what a single batch costs if the fleet is started for it and allowed to scale to zero after.
- Program-loaded multiplies the warm figure by this program's ledger ÷ busy-window GPU $ (1.62×): the average overhead SAND-032 actually carried in boots, idle slots and warm time between runs.
3.3 Warm-fleet utilization vs cost per token#
A warm fleet bills $0.80 per L4-hour busy or not, so at a GPU-busy share u its cost per token is 222.2 ÷ (tok/s per L4 × u). The last column is the break-even: the busy share below which the cheapest hosted model is cheaper per token.
| Workload | Run | tok/s per L4 | 100% busy | 75% busy | 50% busy | 25% busy | 10% busy | Cheapest API | Break-even busy share |
|---|---|---|---|---|---|---|---|---|---|
| Correspondence | S3 | 3,698 | $0.060 | $0.080 | $0.120 | $0.240 | $0.601 | $0.087 | 69% |
| Insurance claims | S10 | 1,891 | $0.117 | $0.157 | $0.235 | $0.470 | $1.175 | $0.089 | never (API cheaper at 100%) |
| Corporate records | S10 | 2,867 | $0.078 | $0.103 | $0.155 | $0.310 | $0.775 | $0.053 | never (API cheaper at 100%) |
| Contracts | S3 | 808 | $0.275 | $0.367 | $0.550 | $1.100 | $2.750 | $0.063 | never (API cheaper at 100%) |
| Merger agreements | S3 | 739 | $0.301 | $0.401 | $0.602 | $1.203 | $3.008 | $0.037 | never (API cheaper at 100%) |
| Sorter | S6 | 4,237 | $0.052 | $0.070 | $0.105 | $0.210 | $0.524 | $0.032 | never (API cheaper at 100%) |
These break-evens are per token. Per document, which is what decides deployment, the warm-fleet break-even busy share against the cheapest hosted model is 64% for corporate records and 32% for correspondence, and Modal is never cheaper for the other classes (cost comparison §3). The two differ because each route spends a different number of tokens on the same document.
Utilization here is the share of the fleet's paid hours spent running batches like the measured one. The measured throughput already includes the idle slots inside each batch (section 5); idle time between batches (section 2) is what moves a real fleet down this table.
3.4 Against the hosted API, per token#
| Task | Modal $ / 1M | Modal output share | Cheapest API (per 1M) | API output share | Other API models | Cheapest API ÷ Modal |
|---|---|---|---|---|---|---|
| Correspondence | $0.060 | 7% | Qwen3.7-Flash $0.087 | 57% | DeepSeek-V4.1-Flash $0.143 · Granite-4.2-8B $0.187 · Qwen3-8B $0.306 | 1.4× |
| Insurance claims | $0.146 | 11% | Qwen3.7-Flash $0.089 | 59% | DeepSeek-V4.1-Flash $0.164 · Granite-4.2-8B $0.187 · Qwen3-8B $0.253 | 0.6× |
| Corporate records | $0.095 | 3% | Qwen3.7-Flash $0.053 | 23% | DeepSeek-V4.1-Flash $0.085 · Granite-4.2-8B $0.135 · Qwen3-8B $0.169 | 0.6× |
| Contracts | $0.275 | 20% | Qwen3.7-Flash $0.063 | 33% | DeepSeek-V4.1-Flash $0.107 · Granite-4.2-8B $0.141 · Qwen3-8B $0.174 | 0.2× |
| Merger agreements | $0.301 | 8% | Qwen3.7-Flash · frozen (filed as Qwen3-8B) $0.037 | 7% | Qwen3.7-Flash $0.038 · DeepSeek-V4.1-Flash $0.056 · Granite-4.2-8B $0.089 | 0.1× |
Hosted rows are the eval-environment n = 20/50 legs that logged token counts (list price × tokens). Modal rows are busy-window only; scaled by this program's ledger-to-busy ratio (1.6×), Modal is not cheaper per token for any task. Each leg counts tokens with its own prompts and tokenizer, and the API charges output tokens several times more than input, so the output share matters: Modal's GPU-time price does not care about the mix. The per-document comparison, with the break-even volumes and the optimal deployment, is in COST-COMPARISON-MODAL-VS-API.md §3.
4. Warm vs cold GPUs#
4.1 Boot measurements#
- Deploy → engine ready on the knob ladder: 123 s at L1, 120 s at L2 and 216 s at L5. The L5 changes (fp8 KV,
max_num_seqs16 and CUDA graphs; the program summary attributes the longer boot to graph capture) add about 93 s to the boot and buy the L5 throughput (section 3). - Cold starts in the program: 9 runs started on a cold fleet and waited 117–219 s for the engine to answer; the rest ran on a fleet already warm from the previous run (at most 0.5 s to first answer). A run counts as cold when its first answer took at least 60 s (section 8).
- Scale-down: every fleet kept its containers 120 s after the last request before scaling to zero; that tail is billed.
4.2 Warm vs cold, per workload#
| Workload | Run and fleet | Docs | Batch wall | Boot | Warm $/doc | Cold $/doc | Warm $/1M | Cold $/1M | Cold ÷ warm |
|---|---|---|---|---|---|---|---|---|---|
| Correspondence | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | 50 | 16 s | 216 s (L5 boot) | $0.00014 | $0.0031 | $0.060 | $1.320 | 22.0× |
| Insurance claims | S10 · 1×L4 · c8 · seqs 16 · max_inputs 16 | 75 | 146 s | 216 s (L5 boot) | $0.00043 | $0.0014 | $0.117 | $0.388 | 3.3× |
| Corporate records | S10 · 1×L4 · c8 · seqs 16 · max_inputs 16 | 75 | 133 s | 216 s (L5 boot) | $0.00039 | $0.0014 | $0.078 | $0.274 | 3.5× |
| Contracts | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | 47 | 234 s | 216 s (L5 boot) | $0.0022 | $0.0054 | $0.275 | $0.669 | 2.4× |
| Merger agreements | S3 · 2×L4 · c32 · seqs 16 · max_inputs 32 | 44 | 342 s | 216 s (L5 boot) | $0.0035 | $0.0069 | $0.301 | $0.596 | 2.0× |
| Sorter | S6 · 2×L4 · c32 · seqs 16 | 457 | 1791 s | 131 s (measured) | $0.0017 | $0.0020 | $0.052 | $0.060 | 1.1× |
SAND-032's batches were small: 20–457 documents, and 13 of 24 runs finished in under a minute. At those sizes a cold start costs more than the batch itself for correspondence, insurance claims, corporate records and contracts; only sorter (30 min of GPU work) absorbs its boot.
4.3 Batch size that amortizes a cold start#
Documents per cold batch needed to bring the cold premium (scale-down tail + L5 boot) under 50%, 25% and 10% of the batch's own GPU cost, at each workload's measured busy $/doc (which the second L4 leaves flat, section 6):
| Workload | Busy $/doc | 1×L4 · 50% | 1×L4 · 25% | 1×L4 · 10% | 2×L4 · 50% | 2×L4 · 25% | 2×L4 · 10% |
|---|---|---|---|---|---|---|---|
| Correspondence | $0.00014 | 1,049 | 2,097 | 5,243 | 2,097 | 4,194 | 10,485 |
| Insurance claims | $0.00043 | 346 | 692 | 1,729 | 692 | 1,383 | 3,457 |
| Corporate records | $0.00039 | 380 | 760 | 1,899 | 760 | 1,520 | 3,798 |
| Contracts | $0.0022 | 68 | 135 | 337 | 135 | 270 | 674 |
| Merger agreements | $0.0035 | 44 | 87 | 216 | 87 | 173 | 432 |
| Sorter | $0.0017 | 86 | 172 | 429 | 172 | 343 | 858 |
A 2×L4 cold start costs twice a 1×L4 one, so it needs twice the batch to amortize.
4.4 Keep warm or scale to zero#
Between two batches with an idle gap G, a pinned warm 2×L4 fleet costs G × $1.60/h. A scale-to-zero fleet pays the gap while the 120 s scale-down tail runs; past that it pays the tail plus the next cold boot (216 s at L5), and the next batch starts that much later.
| Idle gap | Stay warm (2×L4) | Scale to zero (2×L4) | Cheaper | Added wait |
|---|---|---|---|---|
| 1 min | $0.027 | $0.027 | stay warm | none |
| 2 min | $0.053 | $0.053 | stay warm | none |
| 5 min | $0.133 | $0.149 | stay warm | +216 s cold boot |
| 10 min | $0.267 | $0.149 | scale to zero | +216 s cold boot |
| 30 min | $0.800 | $0.149 | scale to zero | +216 s cold boot |
| 60 min | $1.60 | $0.149 | scale to zero | +216 s cold boot |
Rule: stay warm while the next batch starts within 336 s (5.6 min, the scale-down tail plus one L5 boot); beyond that, scale to zero. One cold 2×L4 cycle costs $0.149; a warm 2×L4 hour costs $1.60.
4.5 What SAND-032 paid#
- Cold boots: $0.46 across 9 cold starts (21% of the runs' billed GPU $).
- Warm time outside any run: $0.53, the price of about 3.6 cold 2×L4 cycles, or 20 minutes of a warm 2×L4 fleet with no work. The run timestamps needed to split it gap by gap were not exported, so whether each gap should have scaled to zero is not measured here.
5. GPU utilization#
| Run | Fleet | Slot occupancy | Effective parallelism | tok/s per L4 | Idle-slot share of busy $ | Cold boot | Prefix-cache hit per replica | Mean TTFT per replica (s) |
|---|---|---|---|---|---|---|---|---|
| L0 · baseline | 1×L4 · c8 · seqs 6 · max_inputs 32 | 85% | 6.8× of 8 | 1,261 | 15% | warm | 59% | 3.1 |
| L1 · + thinking off | 1×L4 · c8 · seqs 6 · max_inputs 32 | 82% | 6.6× of 8 | 1,524 | 18% | 120 s | 59% | 2.5 |
| L2 · + awq_marlin (reverted) | 1×L4 · c8 · seqs 6 · max_inputs 32 | 82% | 6.6× of 8 | 1,526 | 18% | 117 s | 59% | 2.7 |
| L5 · frozen config | 1×L4 · c8 · seqs 16 · max_inputs 32 | 90% | 7.2× of 8 | 2,238 | 10% | 213 s | 59% | 1.4 |
| S4 · bf16 Qwen3-8B (quality arm) | 1×L4 · c8 · seqs 6 · max_inputs 32 | 83% | 6.7× of 8 | 859 | 17% | 134 s | 59% | 4.0 |
| S2a · 1×L4, c8 | 1×L4 · c8 · seqs 16 · max_inputs 32 | 98% | 7.8× of 8 | 2,579 | 2% | warm | 57% | 0.7 |
| S2b · 2×L4, c16 | 2×L4 · c16 · seqs 16 · max_inputs 32 | 96% | 15.3× of 16 | 2,654 | 4% | warm | 70% / 50% | 0.5 / 1.3 |
| S7 · 2×L4, c64, max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 34% | 22.0× of 64 | 820 | 66% | 219 s | 27% / 51% | 1.8 / 16.2 |
| S9 · 2×L4, c64, max_inputs 32 | 2×L4 · c64 · seqs 32 · max_inputs 32 | 79% | 50.6× of 64 | 3,141 | 21% | 179 s | 49% / 50% | 5.5 / 5.5 |
| S3 · Correspondence | 2×L4 · c32 · seqs 16 · max_inputs 32 | 72% | 22.9× of 32 | 3,698 | 28% | warm | 75% / 55% | 0.7 / 1.1 |
| S3 · Correspondence (repeat) | 2×L4 · c32 · seqs 16 · max_inputs 32 | 82% | 26.1× of 32 | 2,793 | 18% | warm | 49% / 38% | 6.6 / 6.7 |
| S3 · Insurance claims | 2×L4 · c32 · seqs 16 · max_inputs 32 | 55% | 17.7× of 32 | 1,521 | 45% | warm | 72% / 55% | 0.9 / 2.1 |
| S3 · Corporate records | 2×L4 · c32 · seqs 16 · max_inputs 32 | 81% | 25.8× of 32 | 2,346 | 19% | warm | 66% / 44% | 1.2 / 5.7 |
| S3 · Contracts | 2×L4 · c32 · seqs 16 · max_inputs 32 | 59% | 18.8× of 32 | 808 | 41% | warm | 49% / 38% | 7.0 / 7.2 |
| S3 · Merger agreements | 2×L4 · c32 · seqs 16 · max_inputs 32 | 47% | 15.0× of 32 | 739 | 53% | warm | 50% / 35% | 6.9 / 6.3 |
| S5 · Merger agreements · MAUD prompt | 2×L4 · c32 · seqs 16 · max_inputs 32 | 58% | 18.7× of 32 | 692 | 42% | 123 s | 31% / 28% | 95.6 / 3.4 |
| S9 · Insurance claims | 2×L4 · c64 · seqs 32 · max_inputs 32 | 42% | 26.8× of 64 | 1,751 | 58% | warm | 51% / 52% | 6.0 / 5.8 |
| S9 · Corporate records | 2×L4 · c64 · seqs 32 · max_inputs 32 | 65% | 41.7× of 64 | 2,715 | 35% | warm | 43% / 43% | 6.9 / 9.3 |
| S9 · Contracts | 2×L4 · c64 · seqs 32 · max_inputs 32 | 36% | 23.2× of 64 | 785 | 64% | warm | 43% / 43% | 8.2 / 11.2 |
| S7 · Insurance · max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 41% | 26.2× of 64 | 1,584 | 59% | warm | 49% / 52% | 4.6 / 14.4 |
| S10 · Correspondence | 1×L4 · c8 · seqs 16 · max_inputs 16 | 98% | 7.8× of 8 | 3,051 | 2% | 178 s | 59% | 1.0 |
| S10 · Insurance claims | 1×L4 · c8 · seqs 16 · max_inputs 16 | 94% | 7.5× of 8 | 1,891 | 6% | warm | 57% | 1.0 |
| S10 · Corporate records | 1×L4 · c8 · seqs 16 · max_inputs 16 | 98% | 7.9× of 8 | 2,867 | 2% | warm | 46% | 1.5 |
| S6 · LLM sorter | 2×L4 · c32 · seqs 16 | 79% | 25.2× of 32 | 4,237 | 21% | 131 s | — | — |
Findings.
- One L4 at c8 stays full. Occupancy is 82%–98% on the single-L4 runs: 8 client slots feed one engine, so a straggler idles one slot in 8 rather than most of 32.
- Wide fleets idle on long tails. At 2×L4 c32, occupancy drops to 47%–82%. On insurance claims, contracts and merger agreements, one slow document is still decoding after the other slots have emptied, so both GPUs bill while mostly idle. Across all runs idle slots cost $0.55, 32% of busy-window GPU $.
- Doubling admission lowers occupancy. At c64 (
max_num_seqs32) occupancy is 34%–79%: requests queue inside vLLM, latency rises, and wall time falls by less than the extra admission. - KV cache was never the limit. vLLM reported no preemptions on any scraped replica, including the contracts runs at up to 32 sequences per replica (
max_num_seqs) with fp8 KV. Prefix-cache hit rates were 27%–75% per replica. - Boot is the other idle. 9 runs started on a cold fleet and waited 117–219 s for the engine. At L5 the boot was 213 s for an 18 s batch: 92% of that run's billed GPU time.
6. Adding the second L4#
6.1 Same documents, one L4 vs two#
| Metric | 1×L4 · c8 | 2×L4 · c16 | 2×L4 · c64, max_inputs 64 | 2×L4 · c64, max_inputs 32 |
|---|---|---|---|---|
| Fleet | 1×L4 · c8 · seqs 16 · max_inputs 32 | 2×L4 · c16 · seqs 16 · max_inputs 32 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 32 |
| Wall time | 95.0 s | 46.1 s | 149.4 s | 39.0 s |
| Throughput | 2,579 tok/s | 5,308 tok/s | 1,641 tok/s | 6,282 tok/s |
| Throughput per L4 | 2,579 tok/s | 2,654 tok/s | 820 tok/s | 3,141 tok/s |
| Busy-window GPU $ | $0.021 | $0.021 | $0.066 | $0.017 |
| $ per 1M tokens | $0.0862 | $0.0837 | $0.2709 | $0.0707 |
| $ per document | $0.00021 | $0.00021 | $0.00066 | $0.00017 |
| p50 / p95 latency | 6.9 / 11.6 s | 5.7 / 14.4 s | 31.2 / 51.5 s | 21.2 / 30.4 s |
| Client-slot occupancy | 98% | 96% | 34% | 79% |
| Requests per replica | 100 | 49 / 51 | 3 / 97 | 51 / 49 |
| Mean TTFT per replica | 0.69 s | 0.51 s / 1.26 s | 1.81 s / 16.18 s | 5.51 s / 5.46 s |
| Prefix-cache hit per replica | 57.3% | 70.0% / 50.4% | 27.0% / 50.8% | 49.2% / 50.5% |
- Near-linear scale-out. With per-replica admission held at 8 (client concurrency ÷ replicas), the second L4 cut wall time 2.06× and held throughput per L4, so cost per token and per document stayed flat. The extra GPU buys time, not cost.
- Tail latency got worse. p95 rose from 11.6 s to 14.4 s while p50 fell from 6.9 s to 5.7 s. The prefix cache is per replica (70.0% / 50.4% hit rates, against 57.3% on one L4), so shared prompt prefixes are cached once per replica.
- Routing decides whether the second L4 works. Modal's
@web_serverrouter fills a container up tomax_inputsbefore using the next. Atmax_inputs64 and c64, one replica got 97 of 100 requests, its mean TTFT reached 16.2 s, and the batch took 149.4 s. Atmax_inputs32 the same load split 51 / 49 and took 39.0 s.
6.2 Admission on two L4s#
| Task | Fleet | Wall | tok/s per L4 | $ / 1M tokens | Requests per replica | p50 / p95 |
|---|---|---|---|---|---|---|
| Correspondence n = 100 | 2×L4 · c16 · seqs 16 · max_inputs 32 | 46.1 s | 2,654 | $0.084 | 49 / 51 | 5.7 / 14.4 s |
| Correspondence n = 100 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 149.4 s | 820 | $0.271 | 3 / 97 | 31.2 / 51.5 s |
| Correspondence n = 100 | 2×L4 · c64 · seqs 32 · max_inputs 32 | 39.0 s | 3,141 | $0.071 | 51 / 49 | 21.2 / 30.4 s |
| Insurance n = 50 | 2×L4 · c32 · seqs 16 · max_inputs 32 | 60.7 s | 1,521 | $0.146 | 23 / 27 | 19.7 / 34.1 s |
| Insurance n = 50 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 58.3 s | 1,584 | $0.140 | 16 / 34 | 31.3 / 48.6 s |
| Insurance n = 50 | 2×L4 · c64 · seqs 32 · max_inputs 32 | 52.8 s | 1,751 | $0.127 | 25 / 25 | 27.0 / 40.5 s |
Once the router is balanced, doubling admission (c32 → c64, max_num_seqs 16 → 32) buys a modest gain and costs median latency: on insurance claims throughput per L4 rose 15% while p50 went from 19.7 s to 27.0 s. The program summary's reading, not a separate measurement here: “One L4 saturates at around 16 concurrent sequences for these prompts” (reports/serving/QWEN3-L4-LADDER-SUMMARY.md).
6.3 Load balance on every 2×L4 run#
| Run | Fleet | Requests per replica | Busier replica | Mean TTFT per replica | Prefix-cache hit | tok/s per L4 |
|---|---|---|---|---|---|---|
| S2b · 2×L4, c16 | 2×L4 · c16 · seqs 16 · max_inputs 32 | 49 / 51 | 51% | 0.5 s / 1.3 s | 70% / 50% | 2,654 |
| S7 · 2×L4, c64, max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 3 / 97 | 97% | 1.8 s / 16.2 s | 27% / 51% | 820 |
| S9 · 2×L4, c64, max_inputs 32 | 2×L4 · c64 · seqs 32 · max_inputs 32 | 51 / 49 | 51% | 5.5 s / 5.5 s | 49% / 50% | 3,141 |
| S3 · Correspondence | 2×L4 · c32 · seqs 16 · max_inputs 32 | 35 / 15 | 70% | 0.7 s / 1.1 s | 75% / 55% | 3,698 |
| S3 · Correspondence (repeat) | 2×L4 · c32 · seqs 16 · max_inputs 32 | 25 / 25 | 50% | 6.6 s / 6.7 s | 49% / 38% | 2,793 |
| S3 · Insurance claims | 2×L4 · c32 · seqs 16 · max_inputs 32 | 23 / 27 | 54% | 0.9 s / 2.1 s | 72% / 55% | 1,521 |
| S3 · Corporate records | 2×L4 · c32 · seqs 16 · max_inputs 32 | 21 / 29 | 58% | 1.2 s / 5.7 s | 66% / 44% | 2,346 |
| S3 · Contracts | 2×L4 · c32 · seqs 16 · max_inputs 32 | 22 / 28 | 56% | 7.0 s / 7.2 s | 49% / 38% | 808 |
| S3 · Merger agreements | 2×L4 · c32 · seqs 16 · max_inputs 32 | 30 / 20 | 60% | 6.9 s / 6.3 s | 50% / 35% | 739 |
| S5 · Merger agreements · MAUD prompt | 2×L4 · c32 · seqs 16 · max_inputs 32 | 41 / 9 | 82% | 95.6 s / 3.4 s | 31% / 28% | 692 |
| S9 · Insurance claims | 2×L4 · c64 · seqs 32 · max_inputs 32 | 25 / 25 | 50% | 6.0 s / 5.8 s | 51% / 52% | 1,751 |
| S9 · Corporate records | 2×L4 · c64 · seqs 32 · max_inputs 32 | 17 / 33 | 66% | 6.9 s / 9.3 s | 43% / 43% | 2,715 |
| S9 · Contracts | 2×L4 · c64 · seqs 32 · max_inputs 32 | 22 / 28 | 56% | 8.2 s / 11.2 s | 43% / 43% | 785 |
| S7 · Insurance · max_inputs 64 | 2×L4 · c64 · seqs 32 · max_inputs 64 | 16 / 34 | 68% | 4.6 s / 14.4 s | 49% / 52% | 1,584 |
Even with max_inputs = max_num_seqs, short batches split unevenly; the program summary attributes this to Modal's router, not vLLM. The imbalance matters most on long-document classes, where the busier replica's last document sets the wall time.
6.4 The first second-L4 attempt (before SAND-032)#
| Run | Fleet | Docs | tok/s per L4 | Slot occupancy | $ / 1M tokens |
|---|---|---|---|---|---|
| run-20-correspondence-specialist-awq | 2×L4 · c8 · seqs 6 | 20 | 358 | 84% | $0.622 |
| run-50-correspondence-specialist-awq | 2×L4 · c8 · seqs 6 | 50 | 215 | 64% | $1.031 |
The pre-SAND-032 correspondence runs (both at sandbox commit 59b9d35, per their reports' git rows) added a second L4 without raising admission: c8 across 2 replicas with max_num_seqs 6 and eager mode (enforce_eager=on, no CUDA graphs). Each L4 was offered about 4 requests at a time (client concurrency ÷ replicas, as the reports state). Their prompts differ from SAND-032's, so this is not a paired comparison, but throughput per L4 was a small fraction of the 2,654 tok/s SAND-032 later reached on two L4s. The lesson carried into the runbook: raise client concurrency with the replica count.
6.5 What the second L4 costs#
- Per batch, nothing extra while it runs. Busy-window cost scales with wall × replicas, and wall halves.
- Boot doubles. Each cold replica boots separately; at the L5 posture's 216 s, a 2×L4 cold start costs $0.096, half of it for the second L4.
- Warm idle doubles. A pinned 2×L4 fleet costs $1.60/h whether or not it has work, which is how $0.534 of this program's ledger was spent outside any run.
- Verdict. Add the second L4 when wall time matters and the fleet is fed: client concurrency = replicas ×
max_num_seqs, andmax_inputs=max_num_seqs. For a latency-insensitive batch it gains nothing per token, and it doubles boot and idle exposure.
7. Recommendations#
- Keep the frozen L5 posture and the routing rule.
max_inputs=max_num_seqsper container, client concurrency = replicas ×max_num_seqs. This is the largest cost lever measured here. - Match fleet width to document length. Short documents fill two L4s; long contracts and mergers leave them idle behind one straggler. Split long-document classes into their own batch, or cap their decode budget, before adding replicas.
- Stay warm only across short gaps. 19% of the ledger bought no run. Queue runs back-to-back against one warm fleet; when the next batch starts more than 336 s (5.6 min) later, let the fleet scale to zero (section 4.4).
- Size cold batches to their boot. A cold 2×L4 start is worth it only for batches large enough to amortize it: correspondence ≥ 10,485, insurance claims ≥ 3,457, corporate records ≥ 3,798, contracts ≥ 674, merger agreements ≥ 432 and sorter ≥ 858 documents keep the cold premium under 10% (section 4.3). Smaller jobs belong on an already-warm fleet or the hosted API.
- Cut sorter input, not sorter GPUs. The LLM sorter is prefill-bound and already the cheapest work per token; head-truncating its input is what moves its cost per document.
- Measure real GPU utilization before the next spend. Sample
nvidia-smior DCGM (SM %, memory bandwidth, power) and scrape vLLM KV usage under load. Slot occupancy shows when the fleet is starved; it cannot show how hard a busy GPU is working. - Reconcile the ledger. Compare $2.80 against the Modal usage page for 27–28 Sep (UTC: the vLLM replica start times in the run reports, plus the program summary's stage 6–9 date, 2026-09-28).
8. Source notes#
- The SAND-032 program summary headed its spend line with the stage 1–5 figure ($1.21) while its closing ledger read $2.80. The runs alone bill $2.18, so $1.21 could not be the program total. The summary is corrected in the sandbox, and the hub now checks the header against the closing ledger and against the runs' billed GPU $.
- The S6 sorter report quotes $0.0019/doc on the billed basis (it includes the 131 s cold boot). This report and the hub use the busy-window figure, $0.0017/doc, like every other run.
- The two pre-SAND-032 2×L4 serving exports are on a one-replica basis; their run reports bill both replicas. Section 6.4 uses both replicas and checks the report's billed figure against the replica count × the export.
- A run counts as starting on a cold fleet when its first answer took at least 60 s (
COLD_BOOT_MIN_S). That cutoff is a classification rule, not a measurement: every SAND-032 export is either under 0.5 s (warm) or at least 117 s (cold), so any cutoff between the two gives the same split.
Sources#
| Source | What it gives |
|---|---|
local-mailroom-sandbox/reports/serving/sand032-*.serving.json |
per-run wall, boot, tokens, throughput, latency, slot occupancy, GPU $ |
local-mailroom-sandbox/reports/*/SAND032-*-REPORT.md |
engine flags, busy-window GPU $, per-replica vLLM /metrics |
local-mailroom-sandbox/reports/serving/QWEN3-L4-LADDER-SUMMARY.md |
spend ledger, incident, runbook findings |
local-mailroom-sandbox/reports/dashboard/hub_data.json |
the cross-checked extract every number here is read from |
eval-environment/reports/api-comparisons/ (via the hub) |
hosted-API legs with token counts and cost |
local-mailroom-sandbox @ 95d89fa8f401 · eval-environment @ 86b4e54fc5a2 · mailroom-ml @ d3ad22263da0