Qwen2.5

Stale
GitHub Python No License

Description

Alibaba Qwen Team's open-source LLM series, offering dense and MoE models from 0.6B to 110B parameters with 100+ language support, tool calling, and reasoning — among the strongest open-source models available.

Key Features

  • Full-size coverage — Dense 0.6B–72B + MoE 30B-A3B, 235B-A22B for edge to supercomputer deployments
  • Thinking mode toggle — Seamlessly switch between deep reasoning and efficient chat modes
  • Million-token context — Native 256K token context, extensible to 1M tokens
  • Agent capability — Built-in tool calling and function calling for complex agent tasks
  • Multimodal support — Qwen2.5-VL series for image, video understanding and OCR
  • 100+ languages — Covers Chinese, English, and 100+ languages and dialects

Use Cases

💡 Enterprise knowledge Q&A: Build private knowledge base Q&A systems with RAG frameworks
💡 Code generation & review: High-precision code generation and bug fixing with Qwen2.5-Coder
💡 Multi-turn agent dialogue: Build AI agents with tool calling and complex reasoning capabilities
💡 Multimodal content understanding: Intelligent analysis and extraction from images, videos, and PDF documents

Quick Start

# Install Transformers
pip install transformers torch

# Load Qwen2.5-7B-Instruct
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", torch_dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Hello, please introduce yourself"}]
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=512)
print(tokenizer.decode(generated_ids[0][len(model_inputs.input_ids[0]):], skip_special_tokens=True))

Related Projects