← 开源
QwenLM

QwQ

QwQ is the reasoning model series developed by Qwen team, Alibaba Cloud.

ModelsFoundation modelsPython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.2%
523
Star
28
Fork
+2
本周
3
贡献者
创建于 2025-03-11 · 更新于 2026-10-15 · 今日第 6834 名
主要开发者
hzhwcmhfryang-maxerjanmx

QwenLM/QwQ 排名第 6,834,有 523 个星标。

同类别比较

QwenLM/QwQ 排名第 6,834,此处有 8 个同类条目;mjhydri/BeatNet 排名第 6,832。

同类别比较
名称排名指标
JetAstra/SDAR6,815
语言:
Python
星标数:
531
分叉数:
43
简介:
SDAR (Synergy of Diffusion and AutoRegression), a large diffusion language model(1.7B, 4B, 8B, 30B)
NVlabs/GENMO6,820
语言:
Python
星标数:
528
分叉数:
56
End2End-Diffusion/REPA-E6,827
语言:
Python
星标数:
526
分叉数:
33
简介:
[ICCV 2025] Official implementation of the paper: REPA-E: Unlocking VAE for End-to-End Tuning of Latent Diffusion Transformers
mjhydri/BeatNet6,832
语言:
Python
星标数:
524
分叉数:
83
简介:
BeatNet is state-of-the-art (Real-Time) and Offline joint music beat, downbeat, tempo, and meter tracking system using CRNN and particle filtering. (ISMIR 2021's paper implementation).
buaacyw/code-world-model6,867
语言:
Python
星标数:
508
分叉数:
20
简介:
Code World Model Official Repo
lm-sys/FastChat6,892
语言:
Python
星标数:
39,547
分叉数:
4,782
简介:
An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.
lllyasviel/ControlNet6,897
语言:
Python
星标数:
34,126
分叉数:
3,020
简介:
Let us control diffusion models!
tatsu-lab/stanford_alpaca6,900
语言:
Python
星标数:
30,233
分叉数:
3,965
简介:
Code and documentation to train Stanford's Alpaca models, and generate the data.
关键参数与规格
关键参数与规格
参数值
语言Python
类别Models
子类别Foundation models
关键词Reasoning
星标数523
分叉数28
贡献者3
创建日期2025-03-11
更新日期2026-10-15
1 天星标数1
7 天星标数2
排名6,834
上次排名17,590
排名变化10,756
7 天星标排名8,892
上次 7 天星标排名11,573
7 天星标排名变化2,681
总星标排名18,681
上次总星标排名18,697
总星标排名变化16
国家China
README 摘录

QwQ 🖥️ Demo &nbsp&nbsp | &nbsp&nbsp💬 WeChat (微信) &nbsp&nbsp | &nbsp&nbsp🫨 Discord &nbsp&nbsp | &nbsp&nbsp📑 API &nbsp&nbsp Introduction QwQ is the reasoning-specialized model within the Qwen series. Unlike traditional instruction-tuned models, QwQ leverages advanced reasoning and critical thinking abilities to achieve superior performance on downstream tasks, especially those involving complex problem-solving. Our latest release, QwQ-32B, is a mid-sized model that competes effectively with top-tier reasoning models like DeepSeek-R1 and

o1-mini, delivering robust and competitive results. **Note:** Please review the Usage Guidelines before deploying QwQ models, especially if you encounter **endless repetitions or significant performance issues**. Performance To reproduce the results, please refer to our evaluation code. Quickstart with HuggingFace's transformers QwQ is based on Qwen2. 5, which has been in the latest Huggingface . We advise you to use the latest version of . With , you will encounter the following error: Here provides a code snippet with to show you

how to load the tokenizer and model and how to generate contents. Usage Guidelines To achieve optimal performance, we recommend the following settings: 1. **Enforce Thoughtful Output**: Ensure the model starts with "\ \n" to prevent generating empty thinking content, which can degrade output quality. If you use and set , this is already automatically implemented, but it may cause the response to lack the \ tag at the beginning. **Sampling Parameters**: **We recommend using Temperature=0. 95, MinP=0, TopK=40, and

no repetition penalty for optimal performance. ** Do **NOT** use Greedy decoding under any circumstances! You can adjust the TopK value between 20 and 40 to balance filtering out rare token occurrences and enhancing the diversity of the generated output. For supported frameworks, you can adjust the parameter between 0 and 2 to reduce endless repetitions. However, a higher value may occasionally result in language mixing and a slight decrease in performance. **No Thinking Content in History**: In multi-turn conversations

, the historical model output should only include the final output part and does not need to include the thinking content. This feature is already implemented in . **Standardize Output Format**: We recommend using prompts to standardize model outputs when benchmarking. **Math Problems**: Include "Please reason step by step, and put your final answer within \boxed{}. **Multiple-Choice Questions**: Add the following JSON structure to the prompt to standardize responses: "Please show your choice in the field with only the choice letter

, e. **Handle Long Inputs**: For inputs exceeding 8,192 tokens, enable YaRN to improve the model's ability to capture long-sequence information effectively. cpp To run the Qwen/QwQ-32B-GGUF model with Ollama, use the following command. cpp, you can run the model with the following command. This example uses the Q4_K_M quantization: You can also consult Unsloth's Guide to see if their approach meets your needs. ) Try QwQ with API If you face issues in deploying

QwQ, we encourage you to test our API service provided by Alibaba Cloud Model Studio. Citation If you find our

常见问题

记录了多少星标和分叉?

QwenLM/QwQ 有 523 个星标和 28 个分叉。

仓库排名是多少?

QwenLM/QwQ 排名第 6,834。

记录的语言和类别是什么?

QwenLM/QwQ 有 523 个星标,语言为 Python,类别为 Models。

哪个仓库排名最接近?

QwenLM/QwQ 与 mjhydri/BeatNet 比较,后者排名第 6,832,有 524 个星标。

README

QwQ

 ![](https://qianwen-res.oss-cn-beijing.aliyuncs.com/QwQ/QwQ_logo.png) 





    💜 [Qwen Chat](https://chat.qwen.ai/)&nbsp&nbsp | &nbsp&nbsp🤗 [Hugging Face](https://huggingface.co/Qwen/QwQ-32B)&nbsp&nbsp | &nbsp&nbsp🤖 [ModelScope](https://modelscope.cn/organization/qwen)&nbsp&nbsp | &nbsp&nbsp📑 [Blog](https://qwenlm.github.io/blog/qwq-32b/)&nbsp&nbsp  

🖥️ Demo&nbsp&nbsp | &nbsp&nbsp💬 WeChat (微信)&nbsp&nbsp | &nbsp&nbsp🫨 Discord&nbsp&nbsp | &nbsp&nbsp📑 API&nbsp&nbsp

Introduction

QwQ is the reasoning-specialized model within the Qwen series. Unlike traditional instruction-tuned models, QwQ leverages advanced reasoning and critical thinking abilities to achieve superior performance on downstream tasks, especially those involving complex problem-solving. Our latest release, QwQ-32B, is a mid-sized model that competes effectively with top-tier reasoning models like DeepSeek-R1 and o1-mini, delivering robust and competitive results.

Note: Please review the Usage Guidelines before deploying QwQ models, especially if you encounter endless repetitions or significant performance issues.

Performance

To reproduce the results, please refer to our evaluation code.

Quickstart with HuggingFace's transformers

QwQ is based on Qwen2.5, which has been in the latest Huggingface transformers. We advise you to use the latest version of transformers.

With transformers<4.37.0, you will encounter the following error:

KeyError: 'qwen2'

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.

from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/QwQ-32B"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many r's are in the word \"strawberry\""
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=32768
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Usage Guidelines

To achieve optimal performance, we recommend the following settings:

  1. Enforce Thoughtful Output: Ensure the model starts with "\n" to prevent generating empty thinking content, which can degrade output quality. If you use apply_chat_template and set add_generation_prompt=True, this is already automatically implemented, but it may cause the response to lack the \ tag at the beginning. This is normal behavior.

  2. Sampling Parameters:

    • We recommend using Temperature=0.6, TopP=0.95, MinP=0, TopK=40, and no repetition penalty for optimal performance.
    • Do NOT use Greedy decoding under any circumstances! It will lead to endless repetitions.
    • You can adjust the TopK value between 20 and 40 to balance filtering out rare token occurrences and enhancing the diversity of the generated output.
    • For supported frameworks, you can adjust the presence_penalty parameter between 0 and 2 to reduce endless repetitions. However, a higher value may occasionally result in language mixing and a slight decrease in performance.
  3. No Thinking Content in History: In multi-turn conversations, the historical model output should only include the final output part and does not need to include the thinking content. This feature is already implemented in apply_chat_template.

  4. Standardize Output Format: We recommend using prompts to standardize model outputs when benchmarking.

    • Math Problems: Include "Please reason step by step, and put your final answer within \boxed{}." in the prompt.
    • Multiple-Choice Questions: Add the following JSON structure to the prompt to standardize responses: "Please show your choice in the answer field with only the choice letter, e.g.,\"answer\": \"C\"." in the prompt.
  5. Handle Long Inputs: For inputs exceeding 8,192 tokens, enable YaRN to improve the model's ability to capture long-sequence information effectively.

    For supported frameworks, you could add the following to config.json to enable YaRN:

    {
        ...,
        "rope_scaling": {
            "factor": 4.0,
            "original_max_position_embeddings": 32768,
            "type": "yarn"
        }
    }
    

    For deployment, we recommend using vLLM. Please refer to our Documentation for usage if you are not familiar with vLLM. Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, potentially impacting performance on shorter texts. We advise adding the rope_scaling configuration only when processing long contexts is required.

Ollama and Llama.cpp

To run the Qwen/QwQ-32B-GGUF model with Ollama, use the following command.

ollama run hf.co/Qwen/QwQ-32B-GGUF:Q4_K_M # select one from Q8_0; Q6_K; Q5_K_M; Q5_0; Q4_K_M; Q4_0; Q3_K_M; Q2_K.
# For modelscope User
ollama run modelscope.cn/Qwen/QwQ-32B-GGUF:Q4_K_M

If you're using Llama.cpp, you can run the model with the following command. This example uses the Q4_K_M quantization:

./llama-cli \
    --model QwQ-32B-GGUF/qwq-32b-q4_k_m.gguf \
    --threads 32 \
    --ctx-size 32768 \
    --seed 1234 \
    --temp 0.6 \
    --min-p 0.0 \
    --top-k 40 \
    --top-p 0.95 \
    -no-cnv \
    --samplers "top_k;top_p;min_p;temperature;" \
    --prompt "<|im_start|>user\nHow many r's are in the word \"strawberry\"<|im_end|>\n<|im_start|>assistant\n\n"

You can also consult Unsloth's Guide to see if their approach meets your needs. (Thanks to the Unsloth team!)

Try QwQ with API

If you face issues in deploying QwQ, we encourage you to test our API service provided by Alibaba Cloud Model Studio.

from openai import OpenAI
import os

# Initialize OpenAI client
client = OpenAI(
    # If the environment variable is not configured, replace with your API Key: api_key="sk-xxx"
    # How to get an API Key:https://help.aliyun.com/zh/model-studio/developer-reference/get-api-key
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)

reasoning_content = ""
content = ""

is_answering = False

completion = client.chat.completions.create(
    model="qwq-32b",
    messages=[
        {"role": "user", "content": "Which is larger, 9.9 or 9.11?"}
    ],
    stream=True,
    # Uncomment the following line to return token usage in the last chunk
    # stream_options={
    #     "include_usage": True
    # }
)

print("\n" + "=" * 20 + "reasoning content" + "=" * 20 + "\n")

for chunk in completion:
    # If chunk.choices is empty, print usage
    if not chunk.choices:
        print("\nUsage:")
        print(chunk.usage)
    else:
        delta = chunk.choices[0].delta
        # Print reasoning content
        if hasattr(delta, 'reasoning_content') and delta.reasoning_content is not None:
            print(delta.reasoning_content, end='', flush=True)
            reasoning_content += delta.reasoning_content
        else:
            if delta.content != "" and is_answering is False:
                print("\n" + "=" * 20 + "content" + "=" * 20 + "\n")
                is_answering = True
            # Print content
            print(delta.content, end='', flush=True)
            content += delta.content

Citation

If you find our paper and code useful in your research, please consider giving a star :star: and citation :pencil: :)

@misc{qwq32b,
    title = {QwQ-32B: Embracing the Power of Reinforcement Learning},
    url = {https://qwenlm.github.io/blog/qwq-32b/},
    author = {Qwen Team},
    month = {March},
    year = {2025}
}

@article{qwen2.5,
      title={Qwen2.5 Technical Report}, 
      author={An Yang and Baosong Yang and Beichen Zhang and Binyuan Hui and Bo Zheng and Bowen Yu and Chengyuan Li and Dayiheng Liu and Fei Huang and Haoran Wei and Huan Lin and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Yang and Jiaxi Yang and Jingren Zhou and Junyang Lin and Kai Dang and Keming Lu and Keqin Bao and Kexin Yang and Le Yu and Mei Li and Mingfeng Xue and Pei Zhang and Qin Zhu and Rui Men and Runji Lin and Tianhao Li and Tianyi Tang and Tingyu Xia and Xingzhang Ren and Xuancheng Ren and Yang Fan and Yang Su and Yichang Zhang and Yu Wan and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zihan Qiu},
      journal={arXiv preprint arXiv:2412.15115},
      year={2024}
}
排名相邻
同类项目