Complete AI Training
Start for Free

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI news ·

Qwen4 Max patches a Tornado bug in one request using the full codebase

Alibaba's Qwen4 Max is available on Together AI with a 1M-token context window and a 30% discount through November 22, 2026. It processed 652,519 tokens from an entire codebase and returned a working patch in 72 seconds for 69 cents at sale pricing.

Alibaba's flagship Qwen4 Max model is now available on Together AI's serverless inference platform, shipping with a 1M-token context window and a 30% discount through November 22, 2026. The launch puts a model capable of ingesting an entire codebase in a single request within reach of development teams, with sale pricing set at $1.05 per million input tokens and $3.15 per million output tokens.

In a direct test, Qwen4 Max processed all 344 files of the Tornado Python web framework - 652,519 tokens - alongside a bug report, then returned a working patch in 72 seconds. The fix passed the maintainers' own regression tests, and the full suite of 1,673 tests showed no failures. The request cost 69 cents at sale pricing.

How the test worked

The bug involved Tornado's websocket layer. When a connection closed with messages still unsent, every write_message() call that wasn't awaited logged a "Task exception was never retrieved" error, even though awaiting the returned Future is optional. The model received every text file from the repository and a bug report describing only the symptom - no file selection, no retrieval step, no tools.

Qwen4 Max traced the cause to tornado/websocket.py, where each write is wrapped in a task. When the connection drops, the task fails with an exception nobody is required to collect, and Python logs it. The model's patch marks the exception as retrieved so nothing is logged, while callers who do await the write still receive the error.

The model also identified a precedent the bug report never mentioned. It pointed to tornado/iostream.py, where BaseIOStream.write already handles the same problem the same way. Tornado's maintainers cited the same code in their own fix, committed two days after the model's release.

Cost and caching behavior

At list price the request would cost 98 cents. Sending the same repository again costs far less because Together AI caches prompt input automatically. A repeated request of roughly 630,000 tokens returned nearly all of it from cache, with the first token arriving in 8 seconds instead of 54. The input portion dropped to about 3 cents, with cached tokens priced at $0.0525 per million during the sale.

Two constraints apply to Qwen4 Max on this platform. Requests must stream - non-streaming calls return a 400 error - and thinking is on by default, with reasoning tokens counted as output tokens. Developers can disable thinking by passing reasoning={"enabled": False} in the request.

Model architecture and positioning

Alibaba released Qwen4 Max on November 16, 2026, describing it as the most capable model in the Qwen family. It uses a sparse mixture-of-experts design with 2.4 trillion total parameters, activating 71 billion per token. On Alibaba's Work360 benchmark, which spans 721 specialized industry fields, the company reports the model outperforms Qwen3.8 Max while using 35% fewer tokens at high reasoning effort and costing about 60% less per task on average.

The model supports text and image input, tool calling, and automatic prompt caching. It is available only on serverless inference for now - no dedicated endpoints or fine-tuning. Alibaba has said smaller open-weight models from the Qwen4 series will follow.

Why this matters for IT and development teams

A model that can hold an entire mid-sized repository in context and produce a maintainer-grade patch changes the economics of bug investigation. Instead of manually selecting files or building retrieval pipelines, a developer can hand over the whole codebase and a symptom description, then get back a fix with an explanation of where the same pattern already exists in the code. For teams working across large codebases, the combination of 1M-token context and automatic prompt caching means repeat queries on the same repository cost pennies, not dollars. Developers looking to build skills around this workflow can explore AI Code Generation Courses and AI for Developers Courses that cover prompt design and evaluation for code-level tasks.

Share