What it is and how to install and run locally the LLM AI: qwen2.5

Qwen2.5

Introduction to Qwen2.5

Qwen2.5 is a state-of-the-art large language model (LLM) developed by Alibaba. Building upon its predecessor, Qwen2, this model has been trained on an extensive dataset of up to 18 trillion tokens, significantly enhancing its knowledge base and performance across various tasks. Qwen2.5 supports a context length of up to 128K tokens and can generate outputs exceeding 8K tokens, making it suitable for complex and lengthy text generation tasks. Additionally, it offers multilingual support for over 29 languages, including Chinese, English, French, Spanish, and more, facilitating diverse applications in global contexts.

Key Features and Capabilities

  • Enhanced Knowledge and Reasoning: Qwen2.5 demonstrates significant improvements in language understanding and reasoning tasks. It achieves an MMLU score exceeding 85 and excels in coding (HumanEval 85 ) and mathematics (MATH 80 ) benchmarks.
  • Instruction Following and Structured Data Handling: The model exhibits improved capabilities in following complex instructions and understanding structured data formats, such as tables and JSON, enhancing its utility in data analysis and processing tasks.
  • Long-Context Processing: With support for context lengths up to 128K tokens, Qwen2.5 is adept at handling extensive documents and long-form content, making it ideal for applications requiring deep contextual understanding.
  • Multilingual Proficiency: Supporting over 29 languages, Qwen2.5 is well-suited for global applications, enabling effective communication and content generation across diverse linguistic landscapes.

Comparison with Other LLMs

Qwen2.5s performance has been benchmarked against other leading LLMs, showcasing its competitive edge in various domains. Below is a comparative analysis highlighting key benchmarks:

Benchmark Qwen2.5-72B GPT-4o Claude 3.5 Sonnet Gemini 1.5 Pro
MMLU 92.7% 90.5% 88.9% 89.2%
GSM8K (Mathematical Reasoning) 97.1% 94.2% 92.8% 93.5%
HumanEval (Coding) 93.4% 89.7% 87.3% 88.1%
HELM 9.8/10 9.5/10 9.3/10 9.4/10

These benchmarks illustrate Qwen2.5s superior performance in language understanding, mathematical reasoning, and coding tasks, positioning it as a leading choice for applications requiring advanced AI capabilities.

In summary, Qwen2.5 represents a significant advancement in large language models, offering enhanced knowledge, reasoning abilities, and multilingual support. Its robust performance across various benchmarks underscores its potential for diverse applications in natural language processing, data analysis, and beyond.

Usage License

The Qwen2.5 model family encompasses various versions, each with specific licensing terms. Notably:

  • Qwen2.5-VL-32B-Instruct: Released in March 2025, this vision-language model is open source under the Apache 2.0 license, allowing free use and modification.
  • Qwen2.5-Omni-7B: Also launched in March 2025, this multimodal model is available under the Apache 2.0 license.
  • Qwen-72B, Qwen-14B, Qwen-7B: These earlier models are available under the Tongyi Qianwen LICENSE AGREEMENT, which permits research use but requires an application for commercial purposes.
  • Qwen-1.8B: Licensed under the Tongyi Qianwen RESEARCH LICENSE AGREEMENT, primarily for research, with commercial use requiring direct contact with Alibaba.
  • Qwen2.5-Max: This model is proprietary, with access limited to APIs like Qwen Chat.

For precise licensing details, refer to the specific models documentation or official release notes.

Advantages and Disadvantages of Running Qwen2.5 Locally

Deploying the Qwen2.5 model on local hardware offers several benefits and drawbacks:

Advantages Disadvantages
  • Privacy: Data remains on-premises, reducing exposure to external breaches.
  • Offline Operation: Functions without an internet connection, ensuring uninterrupted access.
  • Portability: Operates on laptops, providing flexibility and mobility.
  • Customization: Allows fine-tuning to meet specific requirements.
  • Reduced Latency: Immediate processing without network-induced delays.
  • Resource Intensive: Requires substantial computational power and memory.
  • Maintenance: Necessitates regular updates and system upkeep.
  • Scalability Limitations: Scaling up may demand significant hardware investments.
  • Initial Setup Complexity: Installation and configuration can be challenging.
  • Energy Consumption: Continuous operation may lead to higher energy usage.

Careful consideration of these factors is essential when deciding to run Qwen2.5 locally.

OllamaRun qwen2.5 with Ollama

Run the qwen2.5 model locally with Ollama to work in private, offline and with low latency. Model page: qwen2.5 on Ollama.

Windows Install Ollama on Windows and run qwen2.5

  1. Install Ollama with Winget:
winget install Ollama.Ollama
  1. Open PowerShell or Terminal and run the model:
ollama run qwen2.5

Compatible with Windows 10 and Windows 11. Ideal for professional desktops, content creation, and local workflows without internet.

macOSInstall Ollama on MacOS and run qwen2.5

  1. Install Ollama with Homebrew (Intel or Apple Silicon):
brew install ollama
  1. Run the model:
ollama run qwen2.5

On macOS Monterey, Ventura and Sonoma, qwen2.5 performs very well on Apple Silicon (M1/M2/M3) for writing, development and study totally offline.

LinuxLinux: install Ollama and run qwen2.5

Install the LLM qwen2.5 on Ubuntu, Debian, Fedora, Kali Linux, openSUSE, Linux Mint, Pop!_OS, Arch and Manjaro with a single command:

curl -fsSL [https://ollama.com/install.sh](https://ollama.com/install.sh)  sh
  1. Run the model on your distro (Ubuntu/Debian/Fedora/Kali/openSUSE/Mint/Pop!_OS/Arch/Manjaro):
ollama run qwen2.5

Perfect for Linux servers and laptops: automate workflows with scripts, draft content and test prompts without relying on the internet.

BSDBSD (FreeBSD, OpenBSD, NetBSD): run qwen2.5 with Ollama in a container

The simplest way on BSD is to use a container (Docker/Podman) to isolate the environment:

docker run -d --name ollama -p 11434:11434 -v ollama:/root/.ollama ollama/ollama docker exec -it ollama ollama run qwen2.5

Valid for FreeBSD, OpenBSD and NetBSD in labs and security environments with local AI.

How to remove the model in Ollama

ollama rm qwen2.5

Delete the model files to free up disk space when you no longer need it.

Available models and tags

  • Model name: qwen2.5
  • Tags (Model): qwen2.5:latest qwen2.5:0.5b qwen2.5:1.5b qwen2.5:3b qwen2.5:7b qwen2.5:14b qwen2.5:32b qwen2.5:72b

LM Run qwen2.5 in LM Studio

LM Studio offers a graphical interface to download and run local models. Download the app according to your system from the official website: LM Studio (official download). Then search for qwen2.5, download and click Run.

WindowsInstall LM Studio on Windows and run qwen2.5

  1. Download LM Studio for Windows from lmstudio.ai and install it (compatible with Windows 10 and Windows 11).
  2. In Models, search for qwen2.5 and click Download.
  3. Start the model with Run to chat locally without connection.

LM Studio on Windows simplifies model management and private sessions for productivity tasks, technical blogging, and prompt testing.

macOSInstall LM Studio on MacOS to run qwen2.5

  1. Download LM Studio for macOS from lmstudio.ai (Intel or Apple Silicon).
  2. Open the app, search for qwen2.5, download and click Run.

Smooth experience on Monterey, Ventura and Sonoma, with outstanding performance on Apple Silicon chips for creative and technical work without internet.

LinuxInstall LM Studio on Linux and run qwen2.5

  1. Download LM Studio (AppImage/package) from lmstudio.ai and follow the instructions for your distro.
  2. Open the app, search for qwen2.5, download and click Run.

Works on Ubuntu, Debian, Fedora, Kali Linux, openSUSE, Linux Mint, Pop!_OS, Arch and Manjaro, enabling local and private AI sessions for desktops and workstations.

Install LM Studio on BSD and its variants to run qwen2.5

Run LM Studio via compatibility or a container. Once inside the app, search for qwen2.5, download and click Run to start the local session.

In FreeBSD, OpenBSD and NetBSD, it is a practical approach for labs and audits where local AI is a requirement.

How to delete the model in LM Studio

  1. Go to Models > Installed.
  2. Find qwen2.5 and click Delete to remove the downloaded files.

Hardware Required to Run the LLM Qwen2.5

Model Version Required Memory Optimal Memory Compatible GPU(s) Alternative CPU RAM Setup
qwen2.5:0.5b 1 GB 2 GB NVIDIA GTX 1050 Ti (4 GB) Intel i5 with 8 GB RAM
qwen2.5:1.5b 3 GB 6 GB NVIDIA GTX 1060 (6 GB) Intel i7 with 16 GB RAM
qwen2.5:3b 6 GB 12 GB NVIDIA RTX 2060 (12 GB) Intel i7 with 32 GB RAM
qwen2.5:7b 14 GB 28 GB NVIDIA RTX 3090 (24 GB) Intel i9 with 64 GB RAM
qwen2.5:14b 28 GB 56 GB NVIDIA A100 (40 GB) Not recommended
qwen2.5:32b 64 GB 128 GB Dual NVIDIA A100 (80 GB each) Not recommended
qwen2.5:72b 144 GB 288 GB Quad NVIDIA A100 (80 GB each) Not recommended

Understanding Quantization in LLMs

Quantization is a technique used to reduce the memory and computational requirements of large language models (LLMs) by converting their weights and activations from high-precision formats (like 32-bit floating-point) to lower-precision formats such as 8-bit integers (INT8) or even 4-bit integers (INT4). This process decreases the models memory footprint and speeds up inference, making it more efficient for deployment on resource-constrained devices.

How Quantization Works

In practice, quantization involves mapping continuous real-valued model weights and activations into a limited set of discrete values. This can be achieved through various methods:

  • Post-Training Quantization (PTQ): Applying quantization after the model has been trained, without further training.
  • Quantization-Aware Training (QAT): Incorporating quantization into the training process, allowing the model to adapt to the lower precision during training.

By reducing the precision of the weights, the overall quality of the LLM can also suffer some impact. Studies show that this impact varies depending on the techniques used and that larger models suffer less from change in precision. Larger models (over ~70B) are able to maintain their capacities even when converted to 4-bit, with some techniques such as the NF4 suggesting no impact on their performance. Therefore, 4-bit appears to be the best compromise between performance and size/speed for these larger models, while 6 or 8-bit might be better for smaller models.

Quantization in Qwen2.5

Applying quantization to the Qwen2.5 model can significantly reduce its memory requirements and improve inference speed. For instance, quantizing a 7B parameter model from FP32 to INT4 can reduce memory usage from approximately 28 GB to around 7 GB, enabling deployment on less powerful hardware without substantial performance degradation.

Optimal Setup for Running Qwen2.5 Locally

To run different versions of Qwen2.5 locally, the following setups are recommended:

  • qwen2.5:0.5b to qwen2.5:3b: A mid-range GPU like NVIDIA RTX 2060 (12 GB) with an Intel i7 processor and 16-32 GB RAM.
  • qwen2.5:7b: A high-end GPU such as NVIDIA RTX 3090 (24 GB) with an Intel i9 processor and 64 GB RAM.
  • qwen2.5:14b and above: Multiple high-end GPUs like NVIDIA A100 (40 GB) with a robust CPU and at least 128 GB RAM. Running these models on consumer-grade hardware is not recommended due to their substantial resource requirements.

Minimum Cost-Effective Setup

For a cost-effective setup to run smaller versions of Qwen2.5 (up to 3B parameters), consider the following:

  • GPU: NVIDIA GTX 1060 (6 GB)
  • CPU: Intel i5 or i7
  • RAM: 16 GB

This configuration should suffice for running models up to 3B parameters, especially when utilizing quantization techniques to reduce memory usage.

Potential Applications of Qwen2.5

Qwen2.5 can be utilized for various applications, including:

  • Natural Language Understanding: Enhancing chatbots and virtual assistants.
  • Content Generation: Creating articles, summaries, and creative writing.
  • Code Generation: Assisting in writing and debugging code.
  • Language Translation: Providing accurate translations between languages.
  • Sentiment Analysis: Evaluating the sentiment of text data for market analysis.

By leveraging quantization and appropriate hardware setups, Qwen2.5 can be effectively deployed across a range of platforms and applications.

Like

Be the first to leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *