Insights // Infrastructure2026-09-1711 min read

DeepSeek V4.1-Flash at $0.15/M: Self-Host vs API for Document Agents

DeepSeek's MIT-licensed V4.1-Flash (552B MoE, 1M context, $0.15 per million input tokens) is cheap enough to force a real build-versus-API decision. Here is the math we would run.

Varun Raj Manoharan
Varun Raj ManoharanFounder & Principal Engineer
Open SourceSelf-hostingCost OptimizationLLM CostData ExtractionRAG

Key takeaways

  • V4.1-Flash is MIT-licensed, 552B MoE, 1M-token context, list API around $0.15/M input. That undercuts frontier input rates by more than an order of magnitude.
  • API wins until you have stable, high-volume, latency-tolerant traffic and a team that can run vLLM. Self-host wins when data cannot leave the VPC or the API bill crosses a GPU lease.
  • 1M context does not retire retrieval. It retires naive chunking as an excuse. See why [retrieval still matters](/blog/million-token-context-retrieval-still-matters).
  • Matching a lab on an agentic benchmark is not matching them on overnight autonomy. Shadow on your documents, not on theirs.

DeepSeek released V4.1-Flash as an MIT-licensed 552B mixture-of-experts model with a 1M-token context window and list pricing around $0.15 per million input tokens. Coverage said it "matches Claude Opus 5 on agentic benchmarks." Treat that sentence as marketing until your eval says it.

What is not marketing: the price. At $0.15/M input, a 200k-token contract pack that used to cost a dollar on a frontier model costs a few cents. Document agents, the ones that read leases, claims, and vendor packs, just got a new default candidate.

The decision is not "is DeepSeek good." The decision is API versus self-host versus "stay on Opus/Sol and stop thinking about it."

Three bills, not one

API. $0.15/M in, plus output, plus whatever they charge for long-context. No GPUs, no drivers, no on-call for the inference box. Data leaves your VPC. Rate limits and regional availability are theirs.

Self-host. Weights are MIT, so you can. 552B MoE does not mean 552B active. You still need a serious GPU graph (think multiple H100/H200-class, or a well-tuned lower-end cluster if the active path is much smaller: measure, do not blog-post the VRAM). vLLM or an equivalent, quantization choices, batching, observability. See self-host a coding LLM with vLLM for the shape of the work, even if the model is different.

Stay on frontier. Opus 5 and Sol still win when a wrong extraction is a wire. Paying 20x on tokens is cheap next to a bad payable.

When the API is enough

  • Volume is bursty or you are still finding product
  • Documents are not prohibited from a third-country processor
  • You do not have a GPU story and do not want one this quarter
  • You need to A/B against Opus 5 next week, not next quarter

Call the API. Put it behind the same provider adapter as everyone else. Shadow 10k real documents. Promote it on routes where cost per correct extraction drops.

When self-host starts to win

Rough threshold we use internally: when the monthly API invoice for a single model exceeds about 60 to 70 percent of a dedicated inference box (lease or amortized buy) and utilization is above ~40 percent, run the numbers. Below that, you are buying GPUs to feel independent.

Self-host also wins when the documents cannot leave: health, certain financial, anything your counsel has already said "no cloud model." MIT license is necessary for that conversation. It is not sufficient. You still need a private serving stack, evals, and a patch process for the next weight drop.

For the ops you will eat, see self-hosted LLM observability.

1M context is not a RAG killer

Dumping a 400-page pack into the window feels good in a demo. In production you still want:

  • A catalog of what is in the pack (or you cannot cite)
  • Deterministic checks (totals, dates, party names) after the model writes JSON
  • A smaller retrieved set for the question, even if the pack is already in context, because attention is not uniform

We wrote this up at length in million-token context, retrieval still matters and beyond RAG for messy documents. DeepSeek does not repeal those posts.

A routing sketch

WorkloadFirst tryStay on frontier if
Bulk classify / route mailV4.1-Flash APIAccuracy drops on your labels
Extract fields with a verifierFlash extract, Opus 5 auditAudit disagrees a lot
Overnight multi-hour agentNot Flash, not firstUse Opus 5
Air-gapped corpusSelf-host FlashCounsel still says no GPUs either, then you have a process problem

Frequently Asked Questions

Does MIT mean we can fine-tune and sell? MIT is permissive. Still read the card, the acceptable-use rules on the API, and your customer's contract. License of weights is not license to ignore export or sector rules.

Can we run 552B MoE on a single box? Unlikely at full quality. MoE helps, quantization helps, "a single 4090" is a tweet. Budget a cluster or stay on the API.

Is $0.15/M a trap intro price? Treat it as intro until it has been stable for two quarters. Design so swapping to another cheap long-context model is a config change.

Should we replace Opus 5 with Flash everywhere? No. Replace it on the routes where your eval says cost per completed, correct task is better. That is usually bulk and first-pass extraction, not the final say on a payment.


FoundrySoft builds document agents and serving stacks, API or VPC. See data extraction and self-hosted agentic AI, or contact us.

Interactive Engineering Calculators

Estimate your project cost, token budget, and automation ROI

We built free, production-calibrated tools to help engineering leaders forecast token consumption, compare build vs buy scenarios, and audit code security.

Related reading

Available for new projects

Let's build something great.

Have a project in mind? We are an elite software and AI development studio ready to bring your ideas to production. Let's talk about your roadmap.

See our work