Pick a self-hosted engine#
Run the models in code#
| Task | Code |
|---|
| Cost and TTFT per hyperscaler | simulate(tokens_in_per_day, tokens_out_per_day, sla_ttft_ms, use_ptu) |
|---|
| Azure PTU break-even sweep | break_even_demo() |
|---|
| Cost of the two-provider minimum | lock_in_cost() |
|---|
| Cost per day for one vendor | cost_per_day(v, tokens_per_day, predictions_per_day) |
|---|
| Per-token vs per-minute sweep | utilization_breakeven() |
|---|
| Cold start for a mitigation stack | total_for_stack({"pre_seeded", "streamer"}) |
|---|
| Warm pool break-even | warm_pool_break_even(gpu_hourly=4.50, cold_seconds=328, sla_tolerated_drops_per_day=5) |
|---|
| Engine for hardware, scale, workload | pick_engine(hardware, scale, workload) |
|---|
Troubleshooting#
| Symptom | Cause | Fix |
|---|
| P99 TTFT misses 100 ms on-demand | Shared capacity competes with other traffic | Buy PTUs or Provisioned Throughput |
|---|
| PTU bill high at low traffic | You pay for the reservation when idle | Reserve only at ~40-60% sustained utilization |
|---|
| Bedrock bill up 4x, same traffic | No per-feature attribution | Route calls through Application Inference Profiles |
|---|
| No per-request cost on Azure | Tags come from resource groups | Application Insights custom metrics or gateway headers |
|---|
| Product down in a provider outage | Single-vendor lock-in | Two-provider minimum behind one gateway |
|---|
| First token takes 3-8 minutes | Raw 70B cold start after scale to zero | Stack pre-seeded image, streamer, snapshot |
|---|
| Snapshot restore fails on new node | Snapshots are per GPU topology | Re-checkpoint on the new SKU |
|---|
| New project picks TGI | Maintenance mode since Dec 11, 2025 | Default to vLLM or SGLang |
|---|
Q&A#
- Why is Bedrock ~25 ms slower?
- Shared on-demand capacity. Azure PTUs reserve GPUs for your tenant.
- When does per-minute beat per-token?
- The docs say above ~30% sustained utilization.
main.py says ~60-70% under reserved-minute billing. - When is a warm pool mandatory?
- Typically at TTFT P99 < 60s on a 70B+ model.
- What does a warm pool cost?
- Five products with one warm replica use 3,600 GPU-hours/month.
- Why does live migration move tokens?
- Input is KB. KV cache is GB. Recompute is cheaper.
- Why not Ollama in production?
- 15-30% slower than llama.cpp, 3x gap under prod load.
Glossary#
- PTU
- Provisioned Throughput Unit. Reserved inference GPUs, priced per hour.
- BAA
- Business Associate Agreement. Required for PHI. All three provide it.
- Application Inference Profile
- tagged Bedrock profile with cost per profile in CloudWatch.
- Truss
- Baseten manifest for dependencies, secrets and serving config.
- FireAttention
- Fireworks custom attention kernel.
- RayTurbo
- Anyscale proprietary inference engine on Ray.
- min_workers
- serverless keep-alive count.
min_workers=1 is a warm pool. - GGUF
- llama.cpp weight format with bundled K-quant variants.