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, it is setting new benchmarks in performance, making it a strong contender in the ever-evolving landscape of large language models.
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’ll explore how Qwen2.5-Max is built, what sets it apart from the competition, and why it might just be the rival that DeepSeek V3 has been waiting for. Let’s understand the process of how to run Qwen2.5 models locally.
To run Qwen2.5 models locally, first of all, let’s install Ollama:
To download Ollama click here.
For Linux/Ubuntu users: curl -fsSL https://ollama.com/install.sh | sh
These are the qwen2.5 models available on Ollama
Let’s 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. Now let’s pull the model and provide the query.
Ollama pull qwen2.5:7b
pulling manifest
pulling 2bada8a74506... 100% ▕████████████████▏ 4.7 GB
pulling 66b9ea09bd5b... 100% ▕████████████████▏ 68 B
pulling eb4402837c78... 100% ▕████████████████▏ 1.5 KB
pulling 832dd9e00a68... 100% ▕████████████████▏ 11 KB
pulling 2f15b3218f05... 100% ▕████████████████▏ 487 B
verifying sha256 digest
writing manifest
success
We start by running the run command:
ollama run qwen2.5:7b
Prompt: Can you explain about vector databases in 30 words?
Vector databases store and query vectors (numeric arrays) efficiently, often
using approximations to speed up similarity searches in large datasets.
Prompt: Can you list a few?
Sure! Some popular vector databases include Amazon Aurora Vectorstore:
Pinecone, Weaviate, Milvus, and ChromaDB.
Press Ctrl+D to exit!
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.
For instance, they don’t have access to the latest events and can’t use tools like web search:
Prompt: What’s Today?
Today is [today's date], [month] [day], [year]. However, as an AI, I
don't have real-time capabilities to provide the exact current date
without accessing external data sources. If you're asking within the context
of our conversation, my system doesn’t update in real time, so it would
show the date when we last connected. Could you please specify which day
you are asking about if you need information related to a specific date?
ollama pull qwen2.5-coder:3b
pulling manifest
pulling 4a188102020e... 100% ▕███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 1.9 GB
pulling 66b9ea09bd5b... 100% ▕███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 68 B
pulling e94a8ecb9327... 100% ▕███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 1.6 KB
pulling 45fc3ea7579a... 100% ▕███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 7.4 KB
pulling bb967eff3bda... 100% ▕███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 487 B
verifying sha256 digest
writing manifest
success
We start by running the run command:
ollama run qwen2.5-coder:3b
Prompt: Give me code for the Fibonacci series
Certainly! Here's an example of how to generate the Fibonacci series in Python: ```python def fibonacci(n): fib_series = [0, 1] for i in range(2, n): next_fib = fib_series[i-1] + fib_series[i-2] fib_series.append(next_fib) return fib_series # Example usage: n = int(input("Enter the number of Fibonacci numbers to generate: ")) fib_sequence = fibonacci(n) print(f"Fibonacci series with {n} numbers:") print(fib_sequence) ``` In this code, the `fibonacci` function takes an integer `n` as input and returns a list containing the first `n` Fibonacci numbers. The function initializes a list `fib_series` with the first two Fibonacci numbers `[0, 1]`. It then uses a loop to calculate subsequent Fibonacci numbers by summing the last two numbers in the list and appends the result to the list. Finally, it returns the list containing the Fibonacci series.
Prompt: Give me code for Simple Calculator by Using Functions
Certainly! Below is an example of a simple calculator that uses functions in Python. This calculator can perform addition, subtraction, multiplication, and division:
```python
def add(x, y):
"""Returns the sum of x and y."""
return x + y
def subtract(x, y):
"""Returns the difference between x and y."""
return x - y
def multiply(x, y):
"""Returns the product of x and y."""
return x * y
def divide(x, y):
"""Returns the quotient of x divided by y."""
if y == 0:
return "Error! Division by zero."
else:
return x / y
def main():
print("Simple Calculator")
print("1. Add")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
while True:
choice = input("Enter your choice (1/2/3/4): ")
if choice in ['1', '2', '3', '4']:
try:
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print(f"{num1} + {num2} = {add(num1, num2)}")
elif choice == '2':
print(f"{num1} - {num2} = {subtract(num1, num2)}")
elif choice == '3':
print(f"{num1} * {num2} = {multiply(num1, num2)}")
elif choice == '4':
result = divide(num1, num2)
print(f"{num1} / {num2} = {result}")
except ValueError:
print("Invalid input. Please enter numbers.")
else:
print("Invalid choice. Please select a valid option.")
if __name__ == "__main__":
main()
```
This code defines four functions (`add`, `subtract`, `multiply`, and
`divide`) that perform the respective operations. The `main` function
provides a simple menu for the user to choose an operation and 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.
Similarly, whenever Ollama provides the Qwen2.5-Max, you can access it using the same method we have mentioned above.
Also read on Google Colab: How to Access Qwen2.5-Max?
I hope this article helped you with how to access and run Qwen2.5 models locally using Ollama, emphasizing Qwen2.5-Max’s, 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.