Self-host vs API
CoreDecide where the model runs on total cost and control, not on instinct.
Concepts
Build vs buyAPIs win on speed and total cost until volume or control changes the math.
Managed API endpoints from providers like OpenAI, Anthropic, or Together are the right default: they abstract away GPU procurement, scaling, and model updates, and the per-token price is usually cheaper than self-hosting until you reach sustained, high-utilization workloads. The math flips when you have volume that keeps GPUs saturated around the clock, when you need a model not offered by any provider, or when data-residency and control requirements rule out third-party processing. Start with an API, measure actual usage, and revisit the calculation when you have real numbers.
Sources
Cost-per-token mathCompare API price against amortized GPU cost at your real utilization.
The true cost of self-hosting is not the per-token GPU rate but the amortized hourly cost of the instance divided by the tokens you actually produce each hour at your real utilization level. A GPU running at 20% utilization is five times more expensive per token than its spec sheet suggests. Build the model before deciding: take your monthly token volume, divide it across the hours in a month, convert that into required GPU-hours, price them, and compare directly against the API invoice you would receive for the same tokens.
Sources
Data residencySelf-hosting buys control over where data and weights live.
Sending prompts and completions through a managed API means your data travels to and is processed on infrastructure you do not control, which creates compliance risk for regulated industries and sensitive workloads. Self-hosting puts both the weights and every inference request inside your own perimeter, satisfying HIPAA, GDPR, and internal data-governance policies that prohibit third-party processing. Data residency is one of the two non-negotiable reasons to self-host; the other is needing a model no provider offers.
Sources
Technologies
Bedrock / Together / FireworksManaged inference for open and frontier models.
Managed inference platforms that host open and frontier models behind an API, removing the need to operate GPU infrastructure. Amazon Bedrock integrates with AWS IAM and VPC controls and supports models from Anthropic, Meta, Mistral, and others. Together AI and Fireworks AI specialize in open-weight models with low-latency endpoints, per-token pricing, and dedicated deployment options. All three handle provisioning, scaling, and model updates, making them the practical starting point before evaluating self-hosting.
Sources
vLLMThe default open-source self-hosted serving engine.
vLLM is the most widely adopted open-source LLM serving engine, developed at UC Berkeley. It introduced PagedAttention for near-zero KV cache waste and continuous batching to keep GPUs saturated, and it supports over 200 model architectures, quantization formats from FP8 to GGUF, and tensor and pipeline parallelism across multiple GPUs. When you decide to self-host, vLLM is the default starting point before considering more specialized alternatives.
Sources
In production
The discipline that separates a shipped system from a demo.
Default to an APISelf-host only at sustained high volume or strict data and control needs.
Unless you already know you have a data-residency requirement or a volume that makes self-hosting cheaper, an API is almost always the faster and more economical path. The hidden costs of self-hosting, including GPU reserved instances, on-call burden, model update cycles, and the engineering time to tune batching and memory, are large and easy to underestimate. Ship with an API, instrument your actual token volume and latency requirements, and only revisit the decision when evidence changes the math.
Sources
Model your real utilizationIdle GPUs make self-hosting expensive; price the load you actually have.
A GPU that sits idle waiting for traffic is pure waste. Self-hosting becomes cost-competitive only when the GPU runs at high utilization consistently, typically above 50 to 70 percent, because the denominator in cost-per-token is the tokens produced per hour, not the tokens the card could produce per hour. Model your real traffic distribution across the day, account for idle time overnight or on weekends, and price the instance accordingly. Bursty workloads with long quiet periods almost always favor managed APIs.
Sources