Language models (LLM) have become an integral part of the work of a modern developer. ChatGPT, Claude, Gemini — all these services work in the cloud, and you need the Internet to use them. But what if you want to have your own model that works right on your computer? Let's figure out when this makes sense and what it will take.
Why do you need a local LLM at all?
Before diving into the technical details, it is worth understanding what problems the local model solves. First, it's privacy. All your requests remain on your computer, do not go anywhere and are not analyzed by third-party services. This is critical if you are working with confidential company data or personal customer information.
Secondly, independence from the Internet. Cloud services may be unavailable due to network problems, maintenance, or other reasons. The local model always works as long as your computer is working. Third, it has no restrictions. Many cloud services have limits on the number of requests per day or require payment for active use. With the local model, you only pay for electricity.
But there is a downside. Local models require powerful hardware, they are slower than cloud-based counterparts, and their response quality is often inferior to top commercial solutions. You will also have to deal with the installation and configuration yourself.
What hardware will you need?
This is where the fun begins. Language models come in different sizes, and the larger the model, the smarter it is, but the more resources it requires. The size of the model is measured in parameters: 7B (7 billion), 13B, 70B and so on.
For comfortable work with the model on 7B parameters, you will need a video card with at least 8 GB of video memory. This could be, for example, an NVIDIA RTX 3060 or an AMD equivalent. If you want to run a model with 13B parameters, it is advisable to have 16 GB of video memory. 70B+ models already require professional cards or multiple GPUs.
It is advisable to have 16 GB of RAM, and preferably 32 GB, especially if you plan to work with large contexts. The processor is not so critical, any modern multi-core chip will do. You will also need disk space: the models themselves weigh from 4 GB to several tens of gigabytes, depending on the size and format.
If you do not have a powerful graphics card, you can run the model on the processor, but it will work much slower. Instead of a few seconds, it may take a minute or more to respond.
Popular tools for running an LLM
The easiest way to start experimenting with local models is to use ready-made solutions with a graphical interface. Ollama is a great choice for beginners. This is a console tool that allows you to download and run models with just two commands. You installed Ollama, executed the ollama run llama3 command, and in a minute you already have a working model that you can communicate with directly in the terminal.
For those who want a beautiful web interface, there is LM Studio. This is a desktop application with a convenient GUI, where you can select a model from the catalog, download it in a couple of clicks and immediately start using it. The interface is similar to ChatGPT, so it will be easy to figure out.
If you have already worked with Python, you may be interested in the llama.cpp library. This is a more advanced tool that gives more control over the parameters of the model and its behavior. Many other solutions, including Ollama, are based on it.
Which models are worth trying?
As of 2025, there are many open models that can be run locally. Meta's Llama family remains one of the most popular. Llama 3 in versions 8B and 70B shows excellent results in most tasks. The model excels at code generation, answering questions, and creative tasks.
Another interesting option is Mistral. The models in this line are more compact than the Llama of similar quality, which allows them to run on more modest hardware. Mistral 7B can run even on mid-range gaming laptops.
For specialized tasks, such as working with code, it is worth paying attention to CodeLlama or DeepSeek Coder. These models are specifically trained on program code and are better at writing and analyzing programs.

Practical example of a launch
Let's see how to run a local model in practice with Ollama. First you need to install the program itself. For Linux and macOS, just run the command from the official website, for Windows there is an installer. After installation, open the terminal and execute the ollama run llama3 command. Ollama will automatically download the model if it is not already on your computer and launch an interactive chat.
Now you can ask questions directly in the terminal. Try writing "Write a Python function to sort an array" and look at the result. The model will generate the code and even explain how it works.
If you want to use the model in your Python scripts, Ollama provides a simple API. Here is a minimal example:
import requests
import json
def ask_llm(prompt):
response = requests.post('http://localhost:11434/api/generate',
json={
'model': 'llama3',
'prompt': prompt
},
stream=True)
for line in response.iter_lines():
if line:
data = json.loads(line)
if 'response' in data:
print(data['response'], end='')
ask_llm("Explain what recursion is")This code sends a request to the locally running model and outputs the response as it is generated.
Optimization and fine-tuning
Once you are comfortable with the basic use, you can start experimenting with the parameters. One of the key parameters is temperature. It controls the "creativity" of the model. A value of 0.1 will give more predictable and conservative answers, while 0.9 will give more diverse and creative, but sometimes less accurate answers.
The top_p parameter works in a similar way, but uses a different mechanism. If temperature controls the randomness of token selection, then top_p limits the set of tokens from which the next word is selected.
You can also configure the context — the number of tokens that the model "remembers" from the previous conversation. The more context, the more memory is required, but the model understands long dialogues better.
Workflow integration
A local LLM can be integrated into almost any development tool. Many modern code editors, such as VS Code, support plugins for working with local models. For example, the Continue extension allows you to use Ollama to autocomplete code and answer questions directly in the editor.
You can create your own Telegram bot that will communicate through your local model. Or write a script to automatically generate documentation for the code. The possibilities are limited only by your imagination and the power of your computer.
Is it worth it?
There is no definite answer — it all depends on your tasks and capabilities. If you already have a powerful computer with a good video card, it's worth a try. You will gain experience with the ML infrastructure, understand how language models are structured from the inside, and get a tool that works without an Internet connection.
If the main goal is simply to use AI in work, and there is no hardware, then cloud services will be more convenient and efficient. They give better quality answers, work faster and do not require technical knowledge to set up.
But even if you don't plan to use local models all the time, it's worth trying at least to broaden your horizons. Install Ollama, run a small model and experiment. Perhaps you will find a use for it in your projects, or maybe you will just gain new knowledge about how modern AI technologies work.
Do you want to deepen your knowledge of Python and learn how to work with various technologies?
We invite you to the platform Code, where we create courses and materials specifically for beginner developers. And we also have a cool Telegram channel with a friendly community where you can ask questions, share experiences and find like-minded people. Join us!
