
Alibaba open-sources Qwen4, but its 12-cent API sets a high bar for self-hosting
Alibaba’s latest model combines a permissive commercial licence, sparse computation and a million-token context. Its memory requirements, reasoning costs and infrastructure economics complicate the case for replacing proprietary AI services.
Alibaba’s Qwen team on Friday released Qwen4-35B-A3B, the first open-weight model of its fourth-generation AI family, under the commercially permissive Apache 2.0 licence. The model accepts text, images and video, supports a native context window exceeding one million tokens and is available through Hugging Face and ModelScope. Its release gives enterprises an alternative to purchasing every inference request from a proprietary model provider.
Alibaba has not opened its frontier system. Qwen4-Max, the proprietary flagship released on 16 November, scores 43 on the same Artificial Analysis index and is priced at $1.50 input and $4.50 output per million tokens. The open model is a mid-tier sibling built to compete on cost.
The practical shift is that enterprises can increasingly choose who supplies the model, who runs inference and who takes the margin between the two. The sharpest test of that choice is price: on the assumptions set out below, Alibaba's own $0.12 blended API price is hard for a self-hosted GPU to beat.
For chief information officers finalising 2027 budgets, however, Qwen4 is more complicated than its name suggests. A model marketed around three billion active parameters contains substantially more than 35 billion parameters in its complete checkpoint. Its million-token context also imposes memory and processing costs that cannot be inferred from its parameter count.
These distinctions determine whether an enterprise should reserve additional GPUs, deploy the model on existing infrastructure or use its availability primarily to renegotiate commercial AI contracts.
Alibaba is competing for infrastructure revenue as well as model revenue
Qwen4 continues a competitive shift that accelerated with DeepSeek in late 2024. Alibaba had already established its open-model strategy through Qwen, Qwen2 and Qwen2.5 before introducing Qwen3 in April 2025, including a 30-billion-parameter model activating three billion parameters during inference.
DeepSeek V3 demonstrated the economics of sparse computation on a much larger scale in December 2024, with 671 billion parameters and 37 billion active. Its announced post-promotional API prices were $0.27 per million uncached input tokens and $1.10 per million output tokens.
DeepSeek R1 followed in January 2025 under the MIT licence, charging $0.55 and $2.19 respectively at launch.
Meta's Llama 4 extended the competition into multimodal inference in April 2025. Its Scout and Maverick models activated 17 billion parameters from respective totals of 109 billion and 400 billion, although Meta retained a custom commercial licence.
Historical API pricing records show Groq launching Maverick at $0.50 per million input tokens and $0.77 per million output tokens. A directly comparable first-day Qwen3 price could not be independently established.
Distribution has since become a competitive advantage. A study of open-model adoption covering October 2025 to September 2026 attributed 54% of tracked model downloads to Qwen. DeepSeek led a separate measurement of open-weight token consumption on OpenRouter, while Meta led text-generation requests on Cloudflare Workers AI in October.
Downloads, production requests and token consumption measure different things. None establishes enterprise market share.
The 35-billion-parameter model actually contains 57 billion parameters
The first qualification appears in Alibaba's own model card: alongside approximately 35 billion main parameters, Qwen4 contains another 20 billion parameters in its n-gram embedding table and approximately two billion in a multi-token prediction module designed to accelerate generation.
Hugging Face's technical introduction puts active parameters at approximately 3.8 billion per token rather than the rounded three billion in the model's name.
Each mixture-of-experts layer selects eight of its 256 routed experts, alongside a shared expert. Different tokens can activate different experts. The computational savings are genuine, but the remaining weights must still be accessible.
Assuming 57 billion parameters uniformly quantised, the theoretical weight memory is:
| Weight precision | Main 35B parameters | Complete 57B checkpoint |
|---|---|---|
| 4-bit | 17.5 GB | 28.5 GB |
| 8-bit | 35 GB | 57 GB |
| 16-bit | 70 GB | 114 GB |
These are decimal gigabytes and theoretical minimums, excluding quantisation metadata and runtime allocations.
The released GGUF files illustrate the difference. The four-bit main file occupies 32.9 GB; the eight-bit version occupies 49 GB. Optional prediction modules and the vision projector require additional memory.
There is, however, an architectural advantage: the embedding table retrieves selected entries rather than executing every parameter, so it can reside in ordinary system memory rather than expensive GPU memory.
The official FP8 checkpoint separates approximately 39.7 GB of model weights from 20.5 GB of embeddings. The latter can be offloaded to pinned host memory, provided the inference engine implements efficient transfers.
That makes a single-GPU deployment credible without making Qwen4 equivalent to a conventional three-billion-parameter model.
A million-token context consumes memory that cannot serve another customer
Qwen4's configuration file specifies 40 layers, including 30 linear-attention layers and ten sparse-attention layers.
Only the latter maintain conventional token-dependent key-value caches. Each has two key-value heads of dimension 256.
Assuming BF16 cache precision, each stored token requires:
Ten layers × two key-value tensors × two heads × 256 dimensions × two bytes = 20,480 bytes.
The linear-attention layers instead maintain recurrent state that does not grow proportionally with context length.
The vLLM integration released today reduces memory further through NVFP4 cache quantisation and an FP8 attention indexer.
A 128K-token session needs about 2.5 GiB of BF16 key-value cache; one million tokens needs about 20 GiB. vLLM's NVFP4 cache cuts the million-token figure to about 8 GiB.
View data
| Context length | Raw BF16 cache | Optimised NVFP4 cache |
|---|---|---|
| 128K | 2.5 | 1 |
| 256K | 5 | 2 |
| 1M | 20 | 8 |
The raw BF16 cache is about 2.5 GiB at 128K tokens, 5 GiB at 256K and 20 GiB at one million; vLLM's NVFP4 cache cuts those to roughly 1, 2 and 8 GiB.
These are cache sizes only; indexers, recurrent state, quantisation overhead and prediction-module allocations are excluded. The 1 and 2 GiB figures extrapolate vLLM's published eight-GiB million-token figure proportionally, so they are not independently measured allocations at each length.
On one 40 GiB cache budget, concurrency falls from about 40 sessions at 128K to five at one million tokens, an eightfold reduction. That is an illustrative allocation, not a measured vLLM limit.
Time to first token introduces another constraint. Assuming an effective prefill rate of 10,000 input tokens per second, processing a fresh 128K prompt takes approximately 13 seconds. A million-token prompt takes 105 seconds before accounting for queuing, generation or additional reasoning.
At 2,000 input tokens per second, the million-token prefill alone takes nearly nine minutes. Neither rate is an observed Qwen4 million-token benchmark; both are planning scenarios.
Sparse attention also selects approximately 2,048 historical tokens per query in its sparse layers. The ability to accept a million tokens consequently does not establish reliable retrieval, reasoning or cross-document synthesis across that entire window.
Independent evaluations show what prolonged reasoning costs
Alibaba says Qwen4 improves sustained agentic work and reduces the number of tokens required to complete tasks. Its published comparison supports parts of that claim.
Qwen4 scores 61.8 on DeepSWE against 42.2 for the dense Qwen3.8-27B. However, on GPQA it trails that dense model, scoring 86.9 against 89.2. On FrontierCode-AA, the larger Qwen3.8-Flash-Next scores 27.1 against Qwen4's 16.1. On Terminal Bench 4.1 it scores 21.2 against Flash-Next's 24.2, and on GPQA Flash-Next reaches 91.7.
The benchmark footnotes matter: four results originate from Artificial Analysis, while Work360 is Alibaba's internal evaluation. ChartoGraphy uses a specified minimum image-resolution setting. The release chart is not a uniform independent assessment.
Artificial Analysis independently assigns Qwen4 an Intelligence Index score of 25 at its highest reasoning setting. That evaluation consumed 175 million output tokens across the benchmark suite, with a reported weighted task cost of $0.55. At normal interactive batch sizes the model generates 330 to 514 tokens per second for a single request, according to Hugging Face and vLLM tests, so the 1,000-token-per-second planning assumption requires batching. A small active parameter count does not guarantee economical multi-step reasoning. Artificial Analysis also reports that Qwen4 generated 175 million output tokens in its index run, against a median of 95.9 million for open-weight models of 4 billion to 40 billion parameters, and lists an output speed of 219 tokens per second for the model's endpoint. At the article's 80:20 input-output mix and Alibaba's Singapore prices, the blended price advantage over the $0.18 quoted below for GPT-6 Luna would disappear if Qwen4 needed about 83% more output tokens for the same task, with input unchanged. Qwen4's roughly 82% excess over its class median is a different comparison, so it signals the risk without measuring it.
The most plausible production workloads are short internal conversations, classification, extraction, document summarisation and bounded tool calls. Long-document retrieval should combine selective retrieval with Qwen4 rather than automatically loading complete repositories.
Video processing benefits from local data control but introduces vision-encoder computation, frame sampling and additional context consumption. For autonomous agents, retries and erroneous tool calls can erase savings from cheaper individual tokens.
Difficult reasoning, unfamiliar software environments and high-consequence decisions remain candidates for larger or proprietary models.
Local inference must compete with Alibaba's 12-cent blended API
The strongest argument against purchasing GPUs comes from Alibaba's own price list. Its Model Studio pricing published today lists Singapore inference at $0.06 per million input tokens, $0.36 per million output tokens and $0.003 for cached input.
QwenCloud additionally documents managed tools, regional deployment and context limits below the checkpoint's native maximum.
Assume a workload comprising 80% input and 20% output tokens, with no cache hits. Alibaba's blended price is $0.12 per million tokens. With 70% of input tokens served from cache, it falls to approximately $0.088, excluding explicit cache-creation charges.
By comparison, OpenAI's published API rates for contexts below 272K imply $0.18 per million blended tokens for GPT-6 Luna and $3.60 for GPT-6.2 Sol using the same workload composition and uncached pricing. These are price comparisons, not assertions of equivalent capability. The local alternative requires much more than dividing hardware expenditure by theoretical token throughput.
Runpod's current rental listings put a 48 GB L40S at $1.09 an hour, a 96 GB RTX PRO 6000 Blackwell at $2.69 and a 141 GB H200 at $5.29.
Recent server-edition GPU purchase listings place the RTX PRO 6000 between approximately $15,000 and $18,900.
Assume $25,000 installed capital expenditure per GPU, including its share of the server, depreciated over three years without residual value. That costs $0.95 per calendar hour. Allow $0.12 for electricity and cooling, $0.20 for maintenance and $0.73 for allocated operations and support. The illustrative fully loaded cost becomes $2 an hour.
Assume 1,000 output tokens per second during productive operation, including the impact of processing four input tokens for every output token.
At 25% productive utilisation, self-hosting a Qwen4-35B-A3B GPU costs about $0.44 per million combined tokens against $0.12 on Alibaba's API. Self-hosting only undercuts the API near 93% utilisation.
View data
| Productive utilisation | Self-hosted, owned GPU | Alibaba Cloud API |
|---|---|---|
| 25% | 0.44 | 0.12 |
| 60% | 0.185 | 0.12 |
| 85% | 0.131 | 0.12 |
Under these assumptions, self-hosting costs $0.44 per million combined tokens at 25% utilisation, $0.185 at 60%, and $0.131 at 85%.
Even at 100% utilisation the assumed GPU costs about $0.111 per million combined tokens ($2 an hour divided by 18 million combined tokens). Alibaba's other published price points change the break-even sharply:
| Alibaba price scenario (80% input, 20% output) | Blended price per million tokens | Utilisation needed for a $2-an-hour GPU to match |
|---|---|---|
| Singapore, uncached | $0.120 | 92.6% |
| Frankfurt, Virginia or Beijing, uncached | $0.1134 | 98.0% |
| Singapore, 70% of input cached | $0.0881 | Not reachable (above 100%) |
| Beijing batch calls, uncached, at half price | $0.0567 | Not reachable (above 100%) |
Alibaba's Model Studio page lists $0.057 input and $0.339 output per million tokens in Frankfurt, Virginia and Beijing, $0.003 for cache-hit input, and half-price batch calls available only in Beijing. The cached scenario excludes explicit cache-creation charges ($0.075 per million tokens for a five-minute cache in Singapore), and batch pricing applies only to workloads that can tolerate deferred processing. These are scenario calculations from the article's assumed hardware cost and 1,000-token-per-second throughput, not measured production benchmarks.
The critical sensitivity is sustained, workload-adjusted throughput multiplied by productive utilisation, not peak GPU performance. Hugging Face's launch integration tests report approximately 2,660 aggregate output tokens per second on an H200 across 64 concurrent requests. That is an ecosystem-partner result, not an independent mixed-workload production test.
Even granting that throughput without additional prefill penalties, the $5.29 rental rate plus an assumed 25% operating burden produces a cost of approximately $0.23 per million combined tokens at 60% utilisation.
The tests do not establish equivalent performance for 64 concurrent million-token sessions.
An open licence does not remove enterprise deployment risk
The Apache 2.0 licence permits commercial use, modification and redistribution subject to its conditions, including preservation of applicable notices. It includes a patent grant with termination provisions but excludes general trademark rights.
It does not independently license the underlying training datasets, establish their provenance or provide comprehensive intellectual-property indemnification.
Day-one deployment support is unusually broad: Ollama and llama.cpp support quantised checkpoints, while Apple's MLX ecosystem offers local execution and, through oMLX, embedding-table offloading to storage. Production serving through vLLM and SGLang provides more appropriate batching and scheduling capabilities.
The remaining costs include security validation, dependency maintenance, model evaluation, monitoring, incident response and capacity reserved for failures. Alibaba's reference tokenizer also requires trusting repository-supplied code, creating another software-supply-chain consideration.
These responsibilities explain why proprietary and managed inference services can retain customers despite accessible weights.
The revenue opportunity shifts towards cloud providers and accelerator suppliers
Alibaba's strategy is consistent with its broader commercial position. Its November quarterly results reported 64% annual growth in external AI Cloud and Compute Services revenue and a cloud adjusted EBITA margin of 14.5%.
The company also plans to commercialise its Zhenwu V900 AI chip in the first quarter of 2027. Qwen4 already has documented support for other Alibaba Zhenwu accelerators.
Giving away model weights can stimulate consumption of Alibaba's cloud infrastructure, managed inference, enterprise software and domestic accelerator ecosystem without requiring exclusive model licensing.
For Nvidia, the effect is less straightforward. Efficient models reduce the compute required per task, but wider deployment could increase total accelerator demand. Memory capacity, bandwidth and inference software become increasingly important sources of differentiation. Neither outcome follows automatically from today's release.
The first-quarter decision
As an illustrative starting point, not a figure derived from evidence, enterprises could route 10 to 20% of inference traffic to a controlled Qwen4 pilot, prioritising repeatable, low-risk tasks rather than replacing frontier reasoning services. Reserve 48 GB-class hardware for short-context quantised testing and 80 to 96 GB accelerators with at least 64 GB host RAM for production evaluation.
Rent before purchasing, and reopen proprietary API commitments in December, requesting transferable spending, shorter commitments and workload-specific pricing.
By a review date set in advance (this article proposes 31 January 2027), require comparable task success, acceptable 95th-percentile latency and a defensible cost advantage. Under the $2-an-hour ownership scenario at 60% utilisation, beating Alibaba's uncached API requires approximately 1,545 effective output tokens per second at the assumed input-output ratio.
Failure to reach those thresholds invalidates the cost-led migration case. Data sovereignty may still justify local deployment. On Alibaba's cached or batch pricing, the cost case for owning hardware does not close at the assumed throughput, so any local deployment there would rest on data control, latency or customisation rather than price.
The next evidence will show whether the savings survive production
The decisive forthcoming measurements are independent quantisation-quality comparisons, long-context retrieval accuracy, mixed-workload throughput, speculative-decoding acceptance rates and cost per successfully completed enterprise task.
No market reaction can be measured yet. At 21:20 CET on Friday, 4 December, regular US equity trading was scheduled to remain open until 22:00 CET, and Asian exchanges, which do not trade on Saturday, next open on Monday, 7 December.
Qwen4 has made a credible alternative to proprietary inference more accessible. Whether it is cheaper depends on how effectively enterprises can operate it.
Related CTOL coverage