{"id":61459,"date":"2025-02-01T05:00:43","date_gmt":"2025-02-01T05:00:43","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/how-to-run-qwen2-5-models-locally-in-3-minutes\/"},"modified":"2025-02-01T05:00:43","modified_gmt":"2025-02-01T05:00:43","slug":"how-to-run-qwen2-5-models-locally-in-3-minutes","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=61459","title":{"rendered":"How to Run Qwen2.5 Models Locally in 3 Minutes?"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>With the growing popularity of DeepSeek, Mistral Small 3, and Qwen2.5 Max, we are now surrounded by models that not only reason like humans but are also cost-efficient. Qwen2.5-Max is quickly gaining attention in the AI community as one of the powerful <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/12\/mixture-of-experts-models\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mixture-of-Experts (MoE)<\/a> outperforming DeepSeek V3. With its advanced architecture and impressive training scale, it is setting new benchmarks in performance, making it a strong contender in the ever-evolving landscape of large language models.<\/p>\n<p>At its core, Qwen2.5 models are built on an extensive dataset of up to 18 trillion tokens, allowing them to excel across a diverse range of tasks. Available in multiple sizes, they provide flexibility in balancing computational efficiency and performance, with the 7B variant being a particularly popular choice for its resource-conscious yet capable design. In this article, we\u2019ll explore how Qwen2.5-Max is built, what sets it apart from the competition, and why it might just be the rival that <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/01\/rag-system-using-deepseek\/\" target=\"_blank\" rel=\"noreferrer noopener\">DeepSeek V3<\/a> has been waiting for. Let\u2019s understand the process of how to run Qwen2.5 models locally.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-key-features-of-qwen2-5-models\">Key Features of Qwen2.5 Models<\/h2>\n<ul class=\"wp-block-list\">\n<li>Multilingual Support: The models support over 29 languages, making them versatile for global applications.<\/li>\n<li>Extended Context Length: They can handle long contexts of up to 128K tokens, which is beneficial for complex queries and interactions.<\/li>\n<li>Enhanced Capabilities: Improvements in coding, mathematics, instruction following, and structured data understanding allow for more sophisticated applications.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-working-with-qwen2-5-using-ollama\">Working With Qwen2.5 Using Ollama<\/h2>\n<p>To run Qwen2.5 models locally, first of all, let\u2019s install Ollama:<\/p>\n<p>To download Ollama click <a href=\"https:\/\/ollama.com\/download\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">here<\/a>.<\/p>\n<pre class=\"wp-block-code\"><code>For Linux\/Ubuntu users: curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-available-qwen2-5-models\">Available Qwen2.5 Models<\/h3>\n<p>These are the qwen2.5 models available on Ollama<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"248\" height=\"346\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134633.816.webp\" alt=\"Available Qwen2.5 Models\" class=\"wp-image-218800\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134633.816.webp 248w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134633.816-215x300.webp 215w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134633.816-150x209.webp 150w\" sizes=\"(max-width: 248px) 100vw, 248px\"\/><\/figure>\n<\/div>\n<p>Let\u2019s download the 7 Billion parameter model which is around 4.7 GB. You can download the models with less parameters if you want to run lighter models.\u00a0Now let\u2019s pull the model and provide the query.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-inference-with-qwen2-5-7b\">Inference with Qwen2.5:7b<\/h2>\n<pre class=\"wp-block-code\"><code>Ollama pull qwen2.5:7b<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-pulling-the-model\">Pulling the Model<\/h4>\n<pre class=\"wp-block-code\"><code>pulling manifest \npulling 2bada8a74506... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f 4.7 GB                         \npulling 66b9ea09bd5b... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f   68 B                         \npulling eb4402837c78... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f 1.5 KB                         \npulling 832dd9e00a68... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f  11 KB                         \npulling 2f15b3218f05... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f  487 B                         \nverifying sha256 digest \nwriting manifest \nsuccess<\/code><\/pre>\n<p>We start by running the run command:\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>ollama run qwen2.5:7b<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"197\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134918.398.webp\" alt=\"Output\" class=\"wp-image-218802\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134918.398.webp 680w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134918.398-300x87.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T134918.398-150x43.webp 150w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\"\/><\/figure>\n<\/div>\n<h4 class=\"wp-block-heading\" id=\"h-questions-for-qwen2-5-7b\">Questions for Qwen2.5:7b<\/h4>\n<p><strong>Prompt:<\/strong> Can you explain about vector databases in 30 words?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<pre class=\"wp-block-preformatted\">Vector databases store and query vectors (numeric arrays) efficiently,\u00a0 often<br\/>using approximations to speed up similarity searches in large\u00a0datasets.<\/pre>\n<p><strong>Prompt:<\/strong> Can you list a few?<\/p>\n<pre class=\"wp-block-preformatted\">Sure! Some popular vector databases include Amazon Aurora Vectorstore:<br\/>Pinecone, Weaviate, Milvus, and ChromaDB.<\/pre>\n<p><strong>Press Ctrl+D to exit!<\/strong><\/p>\n<p>We can see that the model is running on local hardware and is answering the questions only with its existing knowledge. The models running locally are more secure but they have their own disadvantages.<\/p>\n<p>For instance, they don\u2019t have access to the latest events and can\u2019t use tools like web search:<\/p>\n<p><strong>Prompt:<\/strong> What\u2019s Today?<\/p>\n<pre class=\"wp-block-preformatted\">Today is [today's date], [month] [day], [year]. However, as an AI, I<br\/>don't\u00a0have real-time capabilities to provide the exact current date<br\/>without\u00a0accessing external data sources. If you're asking within the context<br\/>of\u00a0our conversation, my system doesn\u2019t update in real time, so it would<br\/>show\u00a0the date when we last connected. Could you please specify which day<br\/>you\u00a0are asking about if you need information related to a specific date?<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"314\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568.webp\" alt=\"Output\" class=\"wp-image-218803\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568.webp 1600w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568-300x59.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568-768x151.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568-1536x301.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/unnamed-2025-01-31T135034.568-150x29.webp 150w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\"\/><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-inference-with-qwen2-5-coder-3b\">Inference with Qwen2.5-coder:3b<\/h2>\n<pre class=\"wp-block-code\"><code>ollama pull qwen2.5-coder:3b<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-pulling-the-model-0\">Pulling the Model<\/h4>\n<pre class=\"wp-block-code\"><code>pulling manifest \npulling 4a188102020e... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f 1.9 GB                         \npulling 66b9ea09bd5b... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f   68 B                         \npulling e94a8ecb9327... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f 1.6 KB                         \npulling 45fc3ea7579a... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f 7.4 KB                         \npulling bb967eff3bda... 100% \u2595\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f  487 B                         \nverifying sha256 digest \nwriting manifest \nsuccess <\/code><\/pre>\n<p>We start by running the run command:\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>ollama run qwen2.5-coder:3b<\/code><\/pre>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1839\" height=\"966\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25.webp\" alt=\"Output\" class=\"wp-image-218804\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25.webp 1839w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25-300x158.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25-768x403.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25-1536x807.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/01\/image-25-150x79.webp 150w\" sizes=\"auto, (max-width: 1839px) 100vw, 1839px\"\/><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-questions-for-qwen2-5-7b-0\">Questions for Qwen2.5:7b<\/h4>\n<p><strong>Prompt:<\/strong> Give me code for the Fibonacci series<\/p>\n<pre class=\"wp-block-preformatted\">Certainly! Here's an example of how to generate the Fibonacci series in Python:\n\n```python\n\ndef fibonacci(n):\n\n\u00a0\u00a0\u00a0\u00a0fib_series = [0, 1]\n\n\u00a0\u00a0\u00a0\u00a0for i in range(2, n):\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0next_fib = fib_series[i-1] + fib_series[i-2]\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0fib_series.append(next_fib)\n\n\u00a0\u00a0\u00a0\u00a0return fib_series\n\n# Example usage:\n\nn = int(input(\"Enter the number of Fibonacci numbers to generate: \"))\n\nfib_sequence = fibonacci(n)\n\nprint(f\"Fibonacci series with {n} numbers:\")\n\nprint(fib_sequence)\n\n```\n\nIn this code, the `fibonacci` function takes an integer `n` as input and\n returns a list containing the first `n` Fibonacci numbers. The function\n initializes a list `fib_series` with the first two\u00a0Fibonacci numbers `[0,\n 1]`. It then uses a loop to calculate subsequent Fibonacci numbers by\n summing the last two numbers in the list and appends the result to the list.\n Finally, it returns the list containing the Fibonacci series.<\/pre>\n<p><strong>Prompt:<\/strong> Give me code for Simple Calculator by Using Functions<\/p>\n<pre class=\"wp-block-preformatted\">Certainly! Below is an example of a simple calculator that uses functions in Python. This calculator can perform addition, subtraction, multiplication, and division:<p>```python<\/p><p>def add(x, y):<\/p><p>\u00a0\u00a0\u00a0\u00a0\"\"\"Returns the sum of x and y.\"\"\"<\/p><p>\u00a0\u00a0\u00a0\u00a0return x + y<\/p><p>def subtract(x, y):<\/p><p>\u00a0\u00a0\u00a0\u00a0\"\"\"Returns the difference between x and y.\"\"\"<\/p><p>\u00a0\u00a0\u00a0\u00a0return x - y<\/p><p>def multiply(x, y):<\/p><p>\u00a0\u00a0\u00a0\u00a0\"\"\"Returns the product of x and y.\"\"\"<\/p><p>\u00a0\u00a0\u00a0\u00a0return x * y<\/p><p>def divide(x, y):<\/p><p>\u00a0\u00a0\u00a0\u00a0\"\"\"Returns the quotient of x divided by y.\"\"\"<\/p><p>\u00a0\u00a0\u00a0\u00a0if y == 0:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return \"Error! Division by zero.\"<\/p><p>\u00a0\u00a0\u00a0\u00a0else:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return x \/ y<\/p><p>def main():<\/p><p>\u00a0\u00a0\u00a0\u00a0print(\"Simple Calculator\")<\/p><p>\u00a0\u00a0\u00a0\u00a0print(\"1. Add\")<\/p><p>\u00a0\u00a0\u00a0\u00a0print(\"2. Subtract\")<\/p><p>\u00a0\u00a0\u00a0\u00a0print(\"3. Multiply\")<\/p><p>\u00a0\u00a0\u00a0\u00a0print(\"4. Divide\")<\/p><p>\u00a0\u00a0\u00a0\u00a0while True:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0choice = input(\"Enter your choice (1\/2\/3\/4): \")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if choice in ['1', '2', '3', '4']:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0num1 = float(input(\"Enter first number: \"))<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0num2 = float(input(\"Enter second number: \"))<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if choice == '1':<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(f\"{num1} + {num2} = {add(num1, num2)}\")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0elif choice == '2':<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(f\"{num1} - {num2} = {subtract(num1, num2)}\")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0elif choice == '3':<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(f\"{num1} * {num2} = {multiply(num1, num2)}\")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0elif choice == '4':<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result = divide(num1, num2)<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(f\"{num1} \/ {num2} = {result}\")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0except ValueError:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(\"Invalid input. Please enter numbers.\")<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else:<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(\"Invalid choice. Please select a valid option.\")<\/p><p>if __name__ == \"__main__\":<\/p><p>\u00a0\u00a0\u00a0\u00a0main()<\/p><p>```<\/p><p>This code defines four functions (`add`, `subtract`, `multiply`, and<br\/>`divide`) that perform the respective operations. The `main` function<br\/>provides a simple menu for the user to choose an operation\u00a0and then prompts them to enter two numbers. It calls the appropriate function based on the user's choice and handles division by zero with an error message.<\/p><\/pre>\n<p><em>Similarly, whenever Ollama provides the Qwen2.5-Max, you can access it using the same method we have mentioned above.<\/em><\/p>\n<p><em>Also read on Google Colab: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/01\/qwen2-5-max\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Access Qwen2.5-Max?<\/a><\/em><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>I hope this article helped you with how to access and run <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/12\/qwen2-5-math\/\" target=\"_blank\" rel=\"noreferrer noopener\">Qwen2.5<\/a> models locally using Ollama, emphasizing Qwen2.5-Max\u2019s, 128K context length, and multilingual capabilities. It details model installation, inference commands, and example queries. Running locally enhances data security but lacks real-time updates and web access. The guide covers both Qwen2.5:7b and Qwen2.5-coder:3b, showcasing coding capabilities like Fibonacci and calculator scripts. Ultimately, Qwen2.5 balances efficiency, security, and AI performance making it a strong alternative to DeepSeek V3 for various AI applications.<\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/pankaj9786\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_Lb7Lh0T.webp\" width=\"48\" height=\"48\" alt=\"Pankaj Singh\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>                Hi, I am Pankaj Singh Negi &#8211; Senior Content Editor | Passionate about storytelling and crafting compelling narratives that transform ideas into impactful content. I love reading about technology revolutionizing our lifestyle.                 <\/p>\n<\/p><\/div>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>With the growing popularity of DeepSeek, Mistral Small 3, and Qwen2.5 Max, we are now surrounded by models that not only reason like humans but are also cost-efficient. Qwen2.5-Max is quickly gaining attention in the AI community as one of the powerful Mixture-of-Experts (MoE) outperforming DeepSeek V3. With its advanced architecture and impressive training scale, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":61460,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[31984,11610,8558,33999,2753],"dealstore":[],"offerexpiration":[],"class_list":["post-61459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-locally","tag-minutes","tag-models","tag-qwen2-5","tag-run"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=61459\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"With the growing popularity of DeepSeek, Mistral Small 3, and Qwen2.5 Max, we are now surrounded by models that not only reason like humans but are also cost-efficient. Qwen2.5-Max is quickly gaining attention in the AI community as one of the powerful Mixture-of-Experts (MoE) outperforming DeepSeek V3. With its advanced architecture and impressive training scale, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=61459\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-01T05:00:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=61459#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"How to Run Qwen2.5 Models Locally in 3 Minutes?\",\"datePublished\":\"2025-02-01T05:00:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459\"},\"wordCount\":588,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp\",\"keywords\":[\"Locally\",\"Minutes\",\"Models\",\"Qwen2.5\",\"Run\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=61459#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=61459\",\"url\":\"https:\/\/fivemor.com\/?p=61459\",\"name\":\"How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp\",\"datePublished\":\"2025-02-01T05:00:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=61459#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=61459\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=61459#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=61459#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Run Qwen2.5 Models Locally in 3 Minutes?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=61459","og_locale":"en_US","og_type":"article","og_title":"How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network","og_description":"With the growing popularity of DeepSeek, Mistral Small 3, and Qwen2.5 Max, we are now surrounded by models that not only reason like humans but are also cost-efficient. Qwen2.5-Max is quickly gaining attention in the AI community as one of the powerful Mixture-of-Experts (MoE) outperforming DeepSeek V3. With its advanced architecture and impressive training scale, [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=61459","og_site_name":"Som2ny Network","article_published_time":"2025-02-01T05:00:43+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=61459#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=61459"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"How to Run Qwen2.5 Models Locally in 3 Minutes?","datePublished":"2025-02-01T05:00:43+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=61459"},"wordCount":588,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=61459#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp","keywords":["Locally","Minutes","Models","Qwen2.5","Run"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=61459#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=61459","url":"https:\/\/fivemor.com\/?p=61459","name":"How to Run Qwen2.5 Models Locally in 3 Minutes? - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=61459#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=61459#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp","datePublished":"2025-02-01T05:00:43+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=61459#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=61459"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=61459#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Qwen2.5-Math-A-Multimodal-language-model-with-enhanced-Mathematical-Reasoning-.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=61459#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"How to Run Qwen2.5 Models Locally in 3 Minutes?"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/61459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61459"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/61459\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/61460"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61459"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=61459"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=61459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}