Qwen: Open Weights, DashScope, and Licences Counted Per Model
Qwen is Alibaba's family of language models, and it reaches users through three channels at once: as weights on Hugging Face, as a paid API in the Model Studio service, and as libraries on PyPI. Each channel carries different legal terms and different traps, so it pays to separate them before someone on the team says that Qwen is Apache 2.0.
Three Things Called Qwen
The first is the Qwen organisation on Hugging Face and the weights that live there. The family is broad in both size and purpose. On the text side the freshest entries are Qwen/Qwen3.8-27B from 14 August 2026 and Qwen/Qwen3.8-2.4T-A95B from 12 August 2026, next to older but still heavily downloaded Qwen/Qwen3.6-35B-A3B and Qwen/Qwen3.5-397B-A17B. Separate lines cover code (Qwen/Qwen3-Coder-Next, Qwen/Qwen3-Coder-30B-A3B-Instruct), vision (Qwen/Qwen3-VL-235B-A22B-Instruct, Qwen/Qwen3-VL-8B-Thinking), embeddings and reranking (Qwen/Qwen3-Embedding-0.6B, Qwen/Qwen3-Reranker-4B), and speech recognition (Qwen/Qwen3-ASR-1.7B-hf). That is this family's genuine advantage over the competition: one vendor covers text, code, images, embeddings, and speech, not just chat.
The size range is real too, not marketing. Qwen/Qwen3.5-0.8B fits on a laptop, Qwen/Qwen3.8-27B fits on a single card with enough memory, and Qwen/Qwen3.8-2.4T-A95B needs a cluster. The config.json of the latter reports num_hidden_layers of 92, hidden_size of 8192, num_experts of 512 with num_experts_per_tok of 10, max_position_embeddings of 262144, and vocab_size of 248320. One detail deserves attention: model_type in Qwen/Qwen3.8-27B is qwen3_5, meaning the architecture has not changed since the 3.5 release even though the number in the name moved forward. The number in a model name describes the release, not the architecture.
The second thing is the API. Alibaba serves the models through a service historically called DashScope, which today appears in the documentation as Alibaba Cloud Model Studio. The DashScope name survives in the SDK, in environment variables, and in some addresses, so you will meet both terms inside the same project.
The third thing is the packages. dashscope on PyPI is at version 1.27.1 released on 21 August 2026, and qwen-agent is at 0.0.34 from 16 February 2026. These are two different animals: the first is a service client, the second is an agent framework that only calls the model underneath.
Open Weights: The Licence Is a Field in the Model Card
The most common mistake with this family is assuming that because one model is Apache 2.0, the whole family is too. It is not. The licence is a field on a specific repository and you have to check it for every model you actually download.
| Hugging Face repository | Last modified | license field | license_name field | Contents of LICENSE |
|---|---|---|---|---|
Qwen/Qwen3.8-27B | 2026-08-14 | apache-2.0 | none | Apache 2.0 |
Qwen/Qwen3.8-2.4T-A95B | 2026-08-12 | other | qwen3.8-max | Qwen3.8-Max License |
Qwen/Qwen3-Coder-Next | 2026-02-03 | apache-2.0 | none | Apache 2.0 |
Qwen/Qwen2.5-Coder-3B-Instruct | 2025-01-12 | other | qwen-research | Qwen Research License |
Qwen/SAE-Res-Qwen3-8B-Base-W64K-L0_50 | 2026-05-13 | other | qwen | Apache 2.0 |
The last row is interesting for a different reason than the others. The model card declares a custom licence named qwen and links to the LICENSE file in the repository, but the downloaded file contains the full, unmodified Apache 2.0 text. Metadata and file disagree. On research models from the SAE series this is more likely an oversight than intent, but it shows why the card field alone is not enough.
The largest open model in the family has a custom licence and you have to read it. The Qwen3.8-Max License starts like MIT: it permits using, copying, modifying, publishing, distributing, sublicensing, selling, deploying, hosting, and fine tuning the weights. Then it adds two conditions. First: if a commercial product built on these weights has more than 100,000,000 monthly active users or more than 20,000,000 dollars in monthly revenue, the model name must be prominently displayed in the interface. Second: if the licensee runs a Model as a Service or AI Work Assistant business and the aggregate revenue of the licensee and its affiliates exceeds 50,000,000 dollars in any consecutive twelve months, a separate licence from Qwen is required before any commercial use. The licence defines both terms: Model as a Service means giving a third party access to inference or fine tuning in a way that lets them exercise meaningful control over inputs, parameters, or training data, and AI Work Assistant means a standalone product for AI assisted coding or office productivity, with Qoder and QwenWork named explicitly as examples. An internal use carve out exists, but it stops applying once you make the model, its outputs, or its capabilities available to a third party.
For most teams neither threshold matters. For an AI platform vendor it does, and that is exactly the distinction to show your legal team instead of writing "open source model" in the documentation. A separate category is the models marked qwen-research. The Qwen RESEARCH LICENSE AGREEMENT dated 19 September 2024 grants rights for non commercial purposes only, defined as research or evaluation, and explicitly requires requesting a licence for commercial use. The trap is that such a model can sit in the same series as an Apache 2.0 one: Qwen/Qwen2.5-Coder-3B-Instruct is research only, while the neighbouring Qwen/Qwen2.5-Coder-7B-Instruct is Apache 2.0.
The check takes a dozen seconds and belongs in your weight download script. The licence text of the largest model sits in its Hugging Face repository.
# the field in the model card
curl -s https://huggingface.co/api/models/Qwen/Qwen3.8-2.4T-A95B \
| python3 -c "import json,sys;c=json.load(sys.stdin)['cardData'];print(c.get('license'),c.get('license_name'))"
# the actual contents of the licence file in the repository
curl -sL https://huggingface.co/Qwen/Qwen3.8-2.4T-A95B/raw/main/LICENSE | head -3DashScope and Model Studio: Which Address, Which Region
The API has three surfaces: the native DashScope one under /api/v1, an OpenAI compatible one under /compatible-mode/v1, and an Anthropic compatible one under /apps/anthropic. The second is the most common integration path, because it lets you use an ordinary OpenAI client and swap only base_url.
Region matters, and this is the single most practical piece of information in this article. The recommended models documentation, in its 11 August 2026 version, gives addresses in the form https://{WorkspaceId}.<region>.maas.aliyuncs.com/compatible-mode/v1 and lists six regions: cn-beijing, cn-hongkong, ap-southeast-1 (Singapore), ap-northeast-1 (Tokyo), eu-central-1 (Frankfurt), and us-east-1 (Virginia). Not every model is everywhere. qwen3.8-max appears in all six, but kimi-k2.7-code and MiniMax-M2.5 only in Beijing, and ZHIPU/GLM-5.2 only in Singapore.
Here is a mismatch that is easy to walk into. The dashscope SDK at version 1.27.1 defaults to China: dashscope/common/env.py sets api_region to cn-beijing and builds the addresses https://dashscope.aliyuncs.com/api/v1, wss://dashscope.aliyuncs.com/api-ws/v1/inference, and https://dashscope.aliyuncs.com/compatible-mode/v1. You override them with DASHSCOPE_HTTP_BASE_URL, DASHSCOPE_WEBSOCKET_BASE_URL, and DASHSCOPE_COMPATIBLE_BASE_URL. The key is read from DASHSCOPE_API_KEY or from the file pointed to by DASHSCOPE_API_KEY_FILE_PATH. If you do not set this, traffic goes to the Chinese endpoint by default, which with personal data becomes a problem earlier than performance does.
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url="https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/compatible-mode/v1",
)
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[{"role": "user", "content": "List three common database migration mistakes."}],
stream=True,
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")The native client exposes parameters the OpenAI compatible mode does not have. The Generation.call signature in package 1.27.1 accepts, among others, result_format, incremental_output, enable_thinking, thinking_budget, enable_search, search_options, parallel_tool_calls, repetition_penalty, seed, and workspace. The last one corresponds to the workspace identifier from the address.
import dashscope
from dashscope import Generation
dashscope.base_http_api_url = "https://dashscope-intl.aliyuncs.com/api/v1"
response = Generation.call(
model="qwen3.7-plus",
messages=[{"role": "user", "content": "Summarise this log in three bullet points."}],
result_format="message",
enable_thinking=True,
thinking_budget=2048,
enable_search=False,
incremental_output=True,
)
print(response.output.choices[0].message.content)The package dependencies are specific and worth knowing before you install into a small image: aiohttp, requests, websocket-client, cryptography, certifi, typer>=0.9.0, rich>=13.0.0, httpx>=0.27.0, httpx-sse>=0.4.0, prompt-toolkit>=3.0, pydantic>=2.0, tenacity, PyYAML>=6.0, and textual>=0.50. The last two, along with typer and rich, serve a built in console interface you will not touch during a plain API call. The openai and anthropic clients are optional and live in the acli-openai and acli-anthropic extras.
This package's licence is exemplary and holds no surprise. PyPI declares Apache 2.0 and the classifier License :: OSI Approved :: Apache Software License, the wheel contains dashscope-1.27.1.dist-info/licenses/LICENSE with the full Apache 2.0 text, plus NOTICE and LICENSE.certifi next to it, and inside sit 311 .py files, meaning real code. Three sources, one answer.
Pricing: Same Model Name, Two Different Rates
Model Studio pricing is published separately for the international deployment and for mainland China, in dollars in both cases. The difference is not cosmetic.
| Model | Input range | Singapore, input per 1M | Singapore, output per 1M | Beijing, input per 1M | Beijing, output per 1M |
|---|---|---|---|---|---|
qwen3.7-max | up to 1M tokens | 2.50 USD | 7.50 USD | 1.65 USD | 4.951 USD |
qwen3.7-plus | up to 256K tokens | 0.40 USD | 1.60 USD | 0.276 USD | 1.101 USD |
qwen3.7-plus | 256K to 1M | 1.20 USD | 4.80 USD | 0.826 USD | 3.301 USD |
qwen3.6-flash | up to 256K tokens | 0.25 USD | 1.50 USD | 0.165 USD | 0.99 USD |
The Chinese rate for qwen3.7-max is 66 percent of the international one on the input side and practically the same on the output side. For qwen3.7-plus the ratio is about 69 percent, so there is no single multiplier that converts the whole price list. Note the arithmetic of the table itself as well: in Singapore output is exactly three times the input (2.50 and 7.50), while in Beijing three times 1.65 gives 4.95, and the vendor lists 4.951. Similarly qwen3.6-27b in Beijing is priced at 0.412564 USD and 2.475384 USD, that is to six decimal places, while neighbouring rows carry three. This does not change the bill, but it shows the table is generated from an exchange rate rather than set by hand, and that when converting a budget you should take numbers from the invoice rather than the documentation.
Three mechanisms change the bill. The Batch API costs 50 percent of the real time inference price, on both input and output. Context caching discounts input only: creating an explicit cache costs 125 percent of the standard input rate, and a cache hit costs 10 percent. The discounts do not stack, so for a single request you pick one of the two. On top of that comes the free quota: next to every international deployment row the documentation lists 1,000,000 tokens valid for 90 days from activating Model Studio. The document states explicitly that no free quota exists in the other deployment scopes.
There is one more discrepancy better known than guessed. The recommended models page from 11 August 2026 lists qwen3.8-max and qwen3.7-flash, while the billing page, last updated on 15 July 2026, contains no row for either. The models are in the catalogue and have assigned rate limits, but their prices have not been published yet. If you are planning a budget for the newest flagship, as of today there is nothing to compute and you have to check the console. Verify rates against the Model Studio billing documentation.
Rate Limits Punish Pinning a Version
Limits are applied at the root account level and aggregate the traffic of all RAM users, workspaces, and API keys. Two per minute values count, RPM and TPM, and the documentation notes the service may also enforce per second limits computed as RPM divided by 60 and TPM divided by 60. Error messages distinguish the cases: Requests rate limit exceeded means RPM, Allocated quota exceeded means TPM, and Request rate increased too quickly is a protection against sudden traffic spikes that can fire even below both limits.
| Model identifier | Region | RPM | TPM |
|---|---|---|---|
qwen3.8-max | Singapore | 600 | 1,000,000 |
qwen3.8-max | Virginia | 30,000 | 5,000,000 |
qwen3.7-plus | Singapore | 15,000 | 5,000,000 |
qwen3.7-plus-2026-05-26 | Singapore | 60 | 1,000,000 |
qwen3.7-flash | Virginia | 15,000 | 5,000,000 |
qwen3.7-flash-2026-07-15 | Virginia | 60 | 1,000,000 |
Two things from this table are worth remembering. First, the same model identifier gets 600 requests per minute in Singapore and 30,000 in Virginia, fifty times more. Region is not only a matter of latency and compliance, it is a matter of real throughput. Second, pinning a specific release costs you. The qwen3.7-plus alias has 15,000 RPM, while the dated snapshot qwen3.7-plus-2026-05-26 has only 60. The documentation says it outright: stable or latest versions have higher rate limits than dated snapshot versions. That puts users in front of an uncomfortable choice between reproducible behaviour and throughput, and it is a drawback, not a feature. Separately, note that calls made through the Batch API are not subject to this rate limiting. Current values live on the Model Studio rate limiting page.
qwen-agent: The Code Is There, the Registry Licence Is Not
Version 0.0.34 of qwen-agent, released on 16 February 2026, has no license field, no license_expression field, and no licence classifier in its PyPI metadata. The classifiers list is empty. A check from three sources, however, gives a calmer picture than the first impression suggests.
pip download qwen-agent==0.0.34 --no-deps -d /tmp/qa
unzip -o -q /tmp/qa/qwen_agent-0.0.34-py3-none-any.whl -d /tmp/qa/x
ls /tmp/qa/x/qwen_agent-0.0.34.dist-info/licenses
grep -E "^License-File" /tmp/qa/x/qwen_agent-0.0.34.dist-info/METADATA
find /tmp/qa/x/qwen_agent -name "*.py" | wc -lThe wheel weighs 7,136,923 bytes, unpacks to roughly 11 MB and 91 .py files, so the code is real rather than a placeholder. Inside dist-info sits a licenses subdirectory holding a LICENSE file with the full 202 line Apache 2.0 text, and METADATA records License-File: LICENSE. The QwenLM/Qwen-Agent repository has a LICENSE file with the same text, and every source file opens with an Apache header. The conclusion is that only the registry declaration is missing. For a human that is a nuance, for a licence compliance scanner it is a package without a licence, so you have to handle it manually in the tool's rules.
One versioning trap comes along with it. The GitHub releases feed ends at v0.0.26 from 29 May 2025, while PyPI carries 0.0.34 from February 2026. You cannot establish the version from GitHub releases here, because it simply is not there. The package registry is the only reliable source, so take the version from the PyPI project page.
from qwen_agent.agents import Assistant
bot = Assistant(
llm={
"model": "qwen3.7-plus",
"model_server": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
"api_key": os.environ["DASHSCOPE_API_KEY"],
"generate_cfg": {"top_p": 0.8},
},
system_message="Answer concisely.",
function_list=["code_interpreter"],
files=["./docs/manual.pdf"],
)
for response in bot.run(messages=[{"role": "user", "content": "What does chapter 3 say?"}]):
print(response)The model_server key also accepts the shorthand 'dashscope', but in the code it expands to https://dashscope.aliyuncs.com/compatible-mode/v1, the Chinese host. If you work in a European region, give the full address rather than the shorthand.
Qwen Against DeepSeek and Llama
| Criterion | Qwen | DeepSeek | Llama |
|---|---|---|---|
| Modality coverage | text, code, vision, embeddings, speech | mostly text, the vision variant marked experimental | text and vision |
| Weight licence | depends on the model: Apache 2.0, custom, or research | MIT for the current generation | community licence with conditions |
| Size range | from under one billion to trillions of parameters | narrow, a few large releases | medium |
| API regions | six regions, including Frankfurt and Virginia | a single vendor endpoint | no first party vendor API |
| Pinning a release | possible, but with a lower RPM limit | stable aliases, no snapshot choice | version follows the downloaded weights |
The first difference concerns licensing. DeepSeek, covered at length in the piece on DeepSeek, releases its current generation of weights under MIT, one licence for everything. With Qwen you have to check model by model, and some entries carry a custom licence with revenue thresholds or a research licence with no commercial rights. In exchange Qwen offers something DeepSeek does not: a complete set of supporting models, from embeddings and reranking to speech recognition, inside the same family and under the same organisation.
The second difference is operational. DeepSeek exposes a single endpoint, Qwen six regions including Frankfurt, which can be decisive when data residency requirements apply. Price and throughput depend on the chosen region, though, so comparing rates without naming a region makes no sense.
The third open weight family, Llama, has a community licence with conditions covering the whole family, without fragmentation across variants, but also without such a wide range of sizes and modalities. If you need one answer for your legal team about an entire family, Llama is simpler. If you need a model of a specific size or a task beyond chat, Qwen has more entries to pick from.
You download weights through Hugging Face, and run them locally through Ollama for a comfortable start on a single machine or through vLLM when you need throughput and batch processing. If you would rather not sign a contract with Alibaba, Qwen models are often available through intermediaries; a sensible entry point is then OpenRouter, and the provider switching layer is easiest to build on LiteLLM.
Common Mistakes
The first is assuming a single licence for the family. You download weights, write "Apache 2.0" in the documentation, and half a year later it turns out one of the models was research only. Check the license field and the contents of LICENSE for each repository separately.
The second is leaving the default region in the SDK. The dashscope library starts at cn-beijing with the Chinese host, and qwen-agent expands the 'dashscope' shorthand to the same address. If you process personal data of European Union users, set DASHSCOPE_COMPATIBLE_BASE_URL or pass the full regional address before the first deployment, not after the audit.
The third is pinning a dated snapshot without checking the limit. Moving from qwen3.7-plus to qwen3.7-plus-2026-05-26 looks like an increase in reproducibility, and in practice cuts the limit from 15,000 to 60 requests per minute. It shows up in production, on the first serious burst of traffic.
The fourth is computing a budget from one pricing table. Rates differ between Singapore and Beijing, some rows carry a limited time promotion note, and the newest models have no published rates at all. For a budget take the numbers for your region and confirm them in the console.
The fifth is treating qwen-agent as a stable API. The 0.0.x numbering is not an accident, and the gap between the last GitHub release and the PyPI version shows that the release process is not a priority here. Pin an exact version for production and expect an upgrade to require code changes.
The sixth is skipping the question of a vendor outside the European Union. The Frankfurt region solves part of the data residency problem, but it does not change who administers the infrastructure and which law governs it. That is a conversation to hold before deployment, not after.
FAQ
Is Qwen open source?
Partly. Most published weights are Apache 2.0, which is an open source licence. The largest model in the family, Qwen/Qwen3.8-2.4T-A95B, carries a custom licence with revenue thresholds, and models marked qwen-research permit non commercial use only. The answer depends on which model you download.
Can I use an ordinary OpenAI client?
Yes. Model Studio exposes an OpenAI compatible surface at /compatible-mode/v1 and an Anthropic compatible surface at /apps/anthropic. You swap base_url and the key. Vendor specific parameters such as thinking_budget or enable_search require the native dashscope client or the extra_body field.
Which region should I pick?
Frankfurt (eu-central-1) if data residency has legal weight. Virginia (us-east-1) if throughput matters, because RPM limits there can be many times higher than in Singapore for the same model. Beijing offers the lowest rates, but that is the mainland China deployment.
Why does qwen-agent have no licence on PyPI?
Because the package metadata declaration is missing, not the licence itself. The wheel carries dist-info/licenses/LICENSE with the full Apache 2.0 text, the QwenLM/Qwen-Agent repository has the same file, and source files carry Apache headers. Compliance scanners will report this as a missing licence and you have to add an exception by hand.
Can I pin a specific model release in the API?
You can, because the vendor publishes dated identifiers such as qwen3.7-plus-2026-05-26. The price matches the alias, but the requests per minute limit can be hundreds of times lower. That is a real cost of reproducibility to factor into the decision.
Is it worth running Qwen locally instead of through the API?
It depends on the size. Models up to a few tens of billions of parameters run sensibly on a single card, and running them through vLLM or Ollama removes the region, limit, and data egress problems at once. The largest variants need a cluster, and then the API usually works out cheaper than maintaining hardware.