Cheat sheets

Managed Platforms and Self-Hosting Compared

Pick a hyperscaler, an inference platform or a self-hosted engine. Price it, size it, cut cold starts.

  • Concepts and terms
  • Tasks and commands
  • Diagrams
  • Comparisons
  • Troubleshooting
  • Questions and tips

Source

Three hyperscalers side by side#

FactorBedrockAzure OpenAIVertex AI
StrategyModel marketplaceExclusive OpenAI modelsGemini first
CatalogClaude, Llama, Titan, Mistral, CohereGPT, o-series, DALL·E, WhisperGemini plus Model Garden
Median TTFT~75 ms on-demand~50 ms with PTUs60 ms in main.py
Dedicated capacityProvisioned Throughput, $21-$50/hrPTU, up to 70% savingsPer Gemini SKU
Break-evenAbout half peak utilization~40-60% sustained utilizationLess publicly advertised
Cost attributionApplication Inference ProfilesScopes, tags, PTU reservationsProject per team, BigQuery export
ComplianceBAAs, VPC endpoints, guardrailsHIPAA, SOC 2, ISO 27001HIPAA, GDPR, residency per region

Inference platforms side by side#

FactorFireworksTogetherBasetenModal
OptimizesLatencyCatalog breadthEnterprise polishPython-native DX
BillingPer tokenPer tokenPer minutePer second
Rate in main.py$0.90/M output$0.88/M output$0.55/min$0.48/min
Reserved floorNoneNone1440 min/day60 min/day
Cold start in main.py1.5 s2.0 s5.0 s2.5 s
Key factBatch tier ~50% of serverless200+ modelsTruss, SOC 2 Type II@modal.function(gpu="A100")

Use a hyperscaler when#

Bedrock
you need Claude, Llama and others behind one API and one IAM surface.
Bedrock
you need cost per team, product or feature with no post-processing.
Azure OpenAI
you need GPT models and TTFT P99 under 100 ms on PTUs.
Vertex AI
you need 1M-token Gemini context or multimodal input.
Two providers
every product-critical call runs on two hyperscalers.
Common pair
Claude from Bedrock, GPT from Azure OpenAI, one gateway.

Use a platform or self-host when#

Custom silicon
latency is critical. Groq is the pick for voice agents.
Fireworks
you need low latency and LoRA at the base model rate.
Together
you need new open models within days of release.
Baseten
you need a fine-tuned model, dedicated GPUs, SOC 2 and HIPAA.
Modal
your team writes Python and wants per-second billing.
Replicate
you serve image, video and audio models per prediction.
Anyscale
inference is one node in a larger Ray graph.
Self-host
data residency, custom fine-tune, cost at scale or no hosted model.

Cold start of a 70B model (seconds)#

PhaseRawPre-seeded imageModel streamerGPU snapshot
node provision50.050.050.00.5
image pull180.00.0180.00.0
weights to HBM75.075.035.00.0
engine init20.020.020.02.0
first forward3.03.03.00.5
ToolnoneBottlerocket, EC2NodeClassRun:ai Model StreamerModal checkpoints
Gain328s total2-4 minutes saved~2x weight-load speedup10x faster restart

Pick a self-hosted engine#

1Hardware CPUuse llama.cpp. No other engine is competitive onCPU.2Hardware AMDuse vLLM with ROCm. TRT-LLM is NVIDIA-locked.3Hardware BlackwellTRT-LLM leads on B200/GB200. vLLM and SGLangfollow.4Scale 1 useruse Ollama. One command, first token in seconds.5Scale 10-100 usersuse vLLM on a single GPU.6Scale 100-10k usersuse vLLM production-stack or SGLang.7Workload agentic or prefix heavyuse SGLang RadixAttention.8Pipelinedev Ollama, staging llama.cpp, prod vLLM.Convert GGUF to safetensors.

Run the models in code#

TaskCode
Cost and TTFT per hyperscalersimulate(tokens_in_per_day, tokens_out_per_day, sla_ttft_ms, use_ptu)
Azure PTU break-even sweepbreak_even_demo()
Cost of the two-provider minimumlock_in_cost()
Cost per day for one vendorcost_per_day(v, tokens_per_day, predictions_per_day)
Per-token vs per-minute sweeputilization_breakeven()
Cold start for a mitigation stacktotal_for_stack({"pre_seeded", "streamer"})
Warm pool break-evenwarm_pool_break_even(gpu_hourly=4.50, cold_seconds=328, sla_tolerated_drops_per_day=5)
Engine for hardware, scale, workloadpick_engine(hardware, scale, workload)

Troubleshooting#

SymptomCauseFix
P99 TTFT misses 100 ms on-demandShared capacity competes with other trafficBuy PTUs or Provisioned Throughput
PTU bill high at low trafficYou pay for the reservation when idleReserve only at ~40-60% sustained utilization
Bedrock bill up 4x, same trafficNo per-feature attributionRoute calls through Application Inference Profiles
No per-request cost on AzureTags come from resource groupsApplication Insights custom metrics or gateway headers
Product down in a provider outageSingle-vendor lock-inTwo-provider minimum behind one gateway
First token takes 3-8 minutesRaw 70B cold start after scale to zeroStack pre-seeded image, streamer, snapshot
Snapshot restore fails on new nodeSnapshots are per GPU topologyRe-checkpoint on the new SKU
New project picks TGIMaintenance mode since Dec 11, 2025Default 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.