How to Run DeepSeek V4 Locally or via API
DeepSeek V4 is unusual in offering both open weights and a hosted API with the same lineage. That gives you a genuine choice, and the right answer depends on volume, privacy needs, and how much maintenance you tolerate.
Here is the comparison in practical terms, without the benchmarks.
What do you get with the API?
A key, an endpoint, and per-token billing. No hardware, no setup, no updates. You get the full-size model immediately, including reasoning mode, and you can scale by sending more requests.
Latency is network-dependent but consistent, usually well under a second for the first token in fast mode. Reasoning requests take longer by design.
What do you get with open weights?
The model files, a licence, and full control. Nothing leaves your network. You can fine-tune, that is, retrain on your own data, which the API does not offer. The cost is hardware and upkeep.
Realistically, running the full-size model locally needs multiple GPUs. Most self-hosters use a quantised version at reduced quality and accept the trade-off.
How do the costs compare?
| Factor | Hosted API | Local open weights |
|---|---|---|
| Upfront cost | $0 | GPU hardware |
| Ongoing cost | Per million tokens | Electricity + time |
| Privacy | Data leaves your network | Fully private |
| Maintenance | None | You own every update |
| Fine-tuning | Not available | Yes |
| Best for | Light to moderate use | High volume, private data |
The break-even point is roughly where your monthly token spend approaches the amortised cost of a GPU. For low usage that never happens, which is why most individuals should stay on the API.
How do you set up the API side?
- Create a key in the DeepSeek console and store it in an environment variable.
- Use an OpenAI-compatible client with the base URL pointed at DeepSeek.
- Choose the model per request — fast or reasoning.
- Log token usage to spot the requests that are costing the most.
- Add retries with backoff for rate-limit errors.
How do you set up the local side?
Download a quantised build, load it with a runtime that supports the format, and cap context length to what you need. Test throughput before committing — if you cannot get usable tokens per second, the local route is a dead end on your hardware.
Expect the setup to take an afternoon the first time, mostly spent on dependencies and memory tuning.
Which should you pick?
Pick the API if you are one person, or a small team, processing modest volumes. Pick local weights if you handle regulated or confidential data, need fine-tuning, or run enough volume that hardware pays for itself inside a year.
A common middle path: build against the API, then migrate the highest-volume path to local inference once you know it is worth a machine.
Quick Summary
- DeeSeek V4 offers both a hosted API and open weights.
- API: zero setup, per-token cost, no fine-tuning, data leaves your network.
- Local: privacy and fine-tuning, paid for in hardware and maintenance.
- Break-even is roughly when monthly token spend meets GPU cost.
- Most individuals should use the API; regulated data should go local.
