Self-hosted LLMs vs an inference API vs on-prem: how to choose
Use a hosted inference API while you are still choosing models and volume: you pay per token and need no hardware. Move to dedicated GPUs when traffic is steady enough to keep them busy. Run on-prem or in your own cloud account when prompts, code or data must not leave your network.
The three options
| Hosted API | Dedicated | On-prem or private cloud | |
|---|---|---|---|
| You pay for | Tokens | Reserved GPUs | Your own GPUs |
| Start | Minutes | Days | Weeks |
| Latency | Shared | Predictable | Predictable |
| Data leaves your network | Yes | Yes | No |
| Best for | Finding fit | Steady volume | Regulated data |
When does dedicated capacity pay?
A GPU costs the same whether it is busy or idle. Per-token pricing wins while your traffic is spiky or small, because you only pay for what you use. Dedicated capacity wins once your agents keep the GPUs busy most of the day: the cost per token falls as utilisation rises, and no other customer's load can slow your tasks. Agent traffic helps here, because long sessions reuse cached context, so each GPU finishes more work.
What hardware does each model need?
At 8-bit precision, a model's weights take about one gigabyte per billion parameters, and the KV cache for long agent sessions needs room on top. A mixture-of-experts model activates only part of its weights per token, but all of them must be in GPU memory.
- MiniMax M3 (428B parameters): about 430 GB of weights, which fits on one node of eight 80 GB GPUs with room for cache.
- Qwen3.8-Max (2.4T): about 2.4 TB of weights, several nodes.
- Kimi K3 (2.8T): about 2.8 TB of weights, three or more nodes of eight 141 GB GPUs.
Smaller fine-tuned models, often the best fit for a narrow agent, run on a single GPU or a single node.
When should you run on-prem?
On-prem or private-cloud deployment is the right call when contracts or regulation say data cannot leave your network, when your agents read source code or records you can't send to a third party, or when you already own GPUs. The serving runs inside your environment, so prompts, code and tool output never leave it.
What about running it yourself?
Open serving engines such as vLLM and SGLang make it possible to self-host. The hard part for agents is everything around the engine: keeping each session's context cached between tool calls, scheduling the calls that block a task first, spreading huge models across nodes, and proving that a change makes tasks cheaper without making them fail. That is the work we do, on our GPUs or yours.
Common questions
Is it cheaper to self-host an LLM than to use an API?
Only when your traffic keeps the GPUs busy. A GPU costs the same idle or busy, so per-token APIs are cheaper for small or spiky traffic, and dedicated or self-hosted GPUs are cheaper at steady high volume.
How many GPUs do I need to run an open-source model?
At 8-bit precision, about one gigabyte of GPU memory per billion parameters for the weights, plus room for the KV cache. MiniMax M3 fits on one node of eight 80 GB GPUs; Kimi K3 needs three or more nodes of eight 141 GB GPUs.
Can you deploy open models on-prem?
Yes. We deploy the same agent-aware serving in your data centre or your own cloud account, so prompts, code and tool output stay in your network. Book a call to scope it.
More guides
- Open-source LLM inference for AI agents: the complete guide
- The best open-source models for coding agents in 2026
- How to fine-tune an open-source LLM for your AI agent
- Prompt caching and the KV cache: why cached tokens decide an agent's bill
- How to run Claude Code on open-source models
- Cost per successful task, explained