{"slug": "deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live", "title": "DeepSeek V4 on Cloudflare Workers AI: 1M Context Window Is Live", "summary": "On August 14, Cloudflare added DeepSeek V4 Pro and DeepSeek V4 Flash to Workers AI, both with a 1,048,576-token context window, the first models on the platform to cross the 1M mark. The Flash model (284B total parameters, 13B active) outputs at 103.2 tokens per second and scores 47 on the Artificial Analysis Intelligence Index, while Pro (1.6T total, 49B active) scores 52 and costs roughly 3.1x more per output token. Cloudflare recommends Flash as the production default, reserving Pro for complex agent workflows.", "body_md": "On August 14, Cloudflare added DeepSeek V4 Pro and DeepSeek V4 Flash to Workers AI — both with a 1,048,576-token context window. That is the first time any model on Workers AI has shipped with a 1 million token context. If you have been routing long-context inference tasks out of your Workers to external APIs because the old ceiling broke your architecture, you no longer need to.\n\n## What Shipped\n\nTwo model IDs are live: `@cf/deepseek-ai/deepseek-v4-pro-0813`\n\nand `@cf/deepseek-ai/deepseek-v4-flash-0731`\n\n. Both run on Cloudflare’s managed GPU network and support the same three access paths: the Workers AI binding (`env.AI.run()`\n\n), the REST API, and the [OpenAI-compatible chat completions endpoint](https://developers.cloudflare.com/ai-gateway/usage/chat-completion/). Both also support thinking mode and function calling.\n\nWorkers AI’s previous context ceiling was 128K tokens on the best available models. V4 Flash and Pro represent an 8x jump minimum — and [the official Cloudflare changelog](https://developers.cloudflare.com/changelog/post/2026-08-14-deepseek-v4-workers-ai/) confirms these are the first models on the platform to cross the 1M mark. That is not an incremental upgrade. It changes what you can fit into a single inference call.\n\n## Flash vs Pro: Pick Flash First\n\nThe two models are not equals, but the gap is narrower than the naming implies. Flash (284B total parameters, 13B active) outputs at 103.2 tokens per second and scores 47 on the Artificial Analysis Intelligence Index. Pro (1.6T total, 49B active) scores 52 — a 5-point gap. Pro also costs roughly 3.1x more per output token.\n\nIn most production workloads, that 5-point intelligence difference does not show up. Use Flash as your default. Reserve Pro for workflows with 10+ tool call chains, multi-agent planning where the coordinator needs to track complex state, or explicitly hallucination-sensitive pipelines where the quality gap actually matters. Paying 3x for the Pro label on a straightforward RAG pipeline is a waste.\n\n| Flash 0731 | Pro 0813 | |\n|---|---|---|\n| Active params | 13B | 49B |\n| Context | 1M tokens | 1M tokens |\n| Output speed | 103.2 tok/s | Slower |\n| Intelligence Index | 47 | 52 |\n| Relative cost | ~3.1x cheaper | Baseline |\n| Best for | Production default | Complex agents |\n\n## How to Wire It Up\n\nThe Workers binding requires two things: add `[ai] binding = \"AI\"`\n\nto your `wrangler.toml`\n\n, then call the model in your handler. The [Workers Wrangler setup guide](https://developers.cloudflare.com/workers-ai/get-started/workers-wrangler/) covers the full configuration.\n\n```\nexport default {\n  async fetch(request: Request, env: { AI: Ai }): Promise<Response> {\n    const messages = [\n      { role: \"user\", content: \"Your prompt here...\" }\n    ];\n    const response = await env.AI.run(\n      \"@cf/deepseek-ai/deepseek-v4-flash-0731\",\n      { messages }\n    );\n    return Response.json(response);\n  }\n};\n```\n\nFor streaming, add `stream: true`\n\nto the options object and pipe the resulting `ReadableStream`\n\ndirectly to the response. If you are already using the OpenAI SDK elsewhere, you can point its `baseURL`\n\nat Cloudflare’s OpenAI-compatible endpoint — no code rewrite required.\n\n## The Output Ceiling You Need to Know About\n\nThe 1M token context is for input plus output combined. The maximum generated output is 384,000 tokens, but that output must fit within the same 1M window alongside your prompt. Feed in 800K tokens of context and your maximum output drops to roughly 248K tokens. This is not a surprise gotcha — it is how transformer architectures work — but it is worth planning around before you design a workflow that assumes 384K output tokens regardless of input size.\n\nAlso worth noting: thinking mode tokens count against your context and your billing even when they are not surfaced to the user. If you enable reasoning mode for a simple classification task, you are burning tokens you did not need to burn.\n\n## Pricing and Access\n\nBoth models require either the Workers Paid plan or prepaid AI Gateway credits. The free tier gets nothing here. Standard Workers Paid billing gives you a 20-request-per-minute rate limit. If you route through AI Gateway using [Unified Billing](https://blog.cloudflare.com/workers-ai-gateway-unification/) — which launched August 7, a week before these models dropped — the rate limit jumps to 50 RPM. Cloudflare passes through inference pricing at cost with no markup. The Unified Billing credits carry a 5% fee on purchase, but the per-token rates are identical to calling DeepSeek directly.\n\n## The Architecture Unlock\n\nBefore V4, building a long-context agentic workflow on Workers meant one of two things: artificially chunk your context and accept worse results, or break out to an external API and accept egress costs and latency spikes. Neither is a clean solution.\n\nWith V4, the coordinator-worker pattern becomes practical entirely within Workers AI. A single V4 Pro coordinator holds the full task plan in its 1M context, delegates subtasks to multiple V4 Flash workers for high-speed execution, and reviews combined output — without a single external inference call. The entire loop stays on Cloudflare’s network.\n\nThis is the change that matters. The 1M token number is headline material, but the real value is removing the architectural compromise that forced developers off the platform for long-context workloads. Check the [Flash model docs](https://developers.cloudflare.com/workers-ai/models/deepseek-v4-flash-0731/) and the [Pro model docs](https://developers.cloudflare.com/workers-ai/models/deepseek-v4-pro-0813/) for the full parameter reference. Start with Flash, measure whether the Pro intelligence gap matters for your specific pipeline, and keep the inference on the edge where it belongs.", "url": "https://wpnews.pro/news/deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live", "canonical_source": "https://byteiota.com/deepseek-v4-workers-ai-1m-context/", "published_at": "2026-08-18 20:14:14+00:00", "updated_at": "2026-08-18 20:44:44.906088+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-products", "ai-infrastructure"], "entities": ["Cloudflare", "Workers AI", "DeepSeek V4 Pro", "DeepSeek V4 Flash", "Artificial Analysis Intelligence Index"], "alternates": {"html": "https://wpnews.pro/news/deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live", "markdown": "https://wpnews.pro/news/deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live.md", "text": "https://wpnews.pro/news/deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live.txt", "jsonld": "https://wpnews.pro/news/deepseek-v4-on-cloudflare-workers-ai-1m-context-window-is-live.jsonld"}}