Qwen4 Max, 1 million token context analyzes the entire codebase at once

Alibaba's flagship model Qwen4 Max has been released with Together AI serverless inference. Utilizing a 1 million token context window, it processed the entire Tornado framework's 344 files (650,000 tokens) in a single request and generated a patch passing maintainer tests in 72 seconds. Based on sale prices, the cost per request is approximately 69 cents, reduced to 3 cents when utilizing cache.

Alibaba Qwen4 Max Launches Serverless Inference Service via Together AI

Alibaba's Qwen4 Max, announced on November 16, 2026, is now available on Together AI's serverless inference platform. The model identifier is `Qwen/Qwen4-Max`, and Together AI applies a 30% discount from the launch date until November 22, 2026. This model is the flagship with the most powerful performance in the Qwen product line, with Alibaba stating it is suitable for "long agent tasks, especially coding across large repositories."

The architecture is a Sparse Mixture-of-Experts model, with 2.4 trillion parameters in total, of which 71 billion are activated per token. In the Together AI environment, it provides a 1 million token context window, accommodating both text and image inputs while outputting text.

Real-World Validation of the 1 Million Token Context Window: Full Analysis of the Tornado Repository

To validate the practical capabilities of Qwen4 Max, Together AI conducted a test by inputting the entire Tornado Python web framework repository into a single prompt. The test conditions are as follows:

"The bug report did not mention `tornado/iostream.py` at all, but the model pointed out that there was code handling errors in the same way that needed a patch there. Tornado maintainers also cited the same code in their fixes."

Detailed Test Results

MetricValueNote
First Token Arrival Time54 secondsStreaming response starts
Response Completion Time72 secondsFull patch and explanation generated
Generated PatchSingle patch`WebSocketProtocol13.write_message` modification
Maintainer Test Passed2/2All regression tests passed
Total Test Suite1,673All passed after patch application
Precedent Found`tornado/iostream.py`Reuse of `BaseIOStream.write` pattern

The model accurately identified that the `write_message` method in the websocket protocol layer wraps each write operation as a task, and when the connection is closed, the task fails with an exception that no one collects, causing Python to log "Task exception was never retrieved." The patch marked this exception as "collected" to prevent unnecessary logging while still allowing the caller to receive an error if `await` was used.

Pricing Structure and Caching Effect: Real Cost Analysis

Together AI automatically caches prompt inputs, applying significantly discounted rates to cached input tokens. The price list based on sale period (until 2026-11-22) and regular price is as follows:

CategorySale Price (30% Discount)Regular Price
Input Tokens (per 1M)$1.05$1.50
Cached Input Tokens (per 1M)$0.0525$0.075
Output Tokens (per 1M)$3.15$4.50

Actual Cost Breakdown

initial_request69
cached_re_request3
regular_initial98
regular_cached5

The caching effect resulted in a 95% reduction in input costs and an 85% reduction in latency, providing a decisive advantage in workflows that repeatedly analyze large codebases.

Technical Characteristics and Constraints: Streaming Required, Thinking Tokens Default Activation

There are constraints to be aware of when calling Qwen4 Max from Together AI.

  1. clone_and_secret_scan
  2. collect_all_files
  3. combine_bug_report
  4. streaming_request
  5. receive_thinking_stream
  6. receive_answer_stream
  7. validate_patch_application

Together AI has made the Python script used for testing public, with the main steps being local repository clone → secret information scan → collection of all git-tracked text files → combination with bug report → sending a single streaming request.

Benchmark Performance and Model Architecture

According to the Work360 benchmark results released by Alibaba, Qwen4 Max outperforms its predecessor Qwen3.8 Max across 721 industry tasks.

"These figures are based on Alibaba's announcement materials, and details should refer to those announcements."

The structure of 71 billion activated parameters out of 2.4 trillion appears to be designed to balance inference efficiency and model capacity. Maintaining the number of active parameters during large context processing is presumed to have positively impacted memory bandwidth and latency.

Implications for Developer Workflow

This test suggests that it is possible to digest the context at the entire repository level with a single call and generate patches at the maintainer level. If the document segmentation, embedding, searching, and re-ranking steps required by existing RAG (Retrieval-Augmented Generation) pipelines can be omitted, the development cycle will be significantly shortened.

However, several practical considerations remain.

As Alibaba has positioned Qwen4 Max for "long agent tasks," future integration cases with agent frameworks (LangGraph, AutoGen, etc.) will be noteworthy.

Verified figures

Our take

The combination of Qwen4 Max's 1 million token context and automatic caching fundamentally changes the economics of large-scale codebase analysis. If it can replace the entire RAG pipeline with a single call, it will alleviate bottlenecks in legacy migration, security audits, and technical debt resolution workflows within enterprises. However, thinking token charges and streaming-only constraints necessitate careful review of cost predictability and client compatibility during production deployment.

Open questions

Models mentioned

ProviderInputOutputContext window
Qwen: Qwen4 Max · Alibaba Qwen$1.425$4.2751,000,000

Source

Back to catalog