Tutorials / Prompting Meta AI and Llama Models / Running a Llama model on your own computer

Running a Llama model on your own computer

11 min read bash
Course contents (20 lessons)
  1. Getting to know Meta AI and Llama
  2. What Meta AI is and where you can use it
  3. Meta AI versus Llama: the assistant and the models
  4. Your first chat with Meta AI
  5. Prompt basics that work
  6. The anatomy of a good prompt
  7. Context, tone, length and follow-ups
  8. Everyday uses
  9. Writing and replying to messages
  10. Captions, posts and bios
  11. Planning and study help
  12. Customer replies for a small business
  13. Images, groups and privacy
  14. Writing image generation prompts
  15. Group chats, etiquette and privacy
  16. Working with Llama models directly
  17. Running a Llama model on your own computer
  18. System prompts and chat templates
  19. Parameters: temperature, top_p and max tokens
  20. Few-shot examples and structured JSON output
  21. Advanced prompting
  22. Prompting Llama for code
  23. Retrieval-augmented prompting: answering from your own documents
  24. Evaluating and comparing answers
  25. Safety, limits and a final project
  26. Safety, limits and responsible use
  27. Final project: build a study buddy assistant

Why run a model locally

There are three good reasons. Your text stays on your machine, so you can work with private notes. You can use it without an internet connection. And you can control everything: the system prompt, the settings, the model version. The price you pay is setup time and hardware limits.

Look back at the list you wrote in the second lesson. Is there a task there that needs privacy or control? That is your first local project.

The tools, described generally

Several free programs let you download and chat with open-weight models. Two common ones are:

  • Ollama: a command-line tool with a background service. You pull a model by name and run it. It also offers a local web API that other programs can call.
  • LM Studio: a desktop application with a window. You search for a model, download it and chat with it in a normal interface. It is friendly if you dislike the terminal.

Both change often, and their screens and options will look different from any description. Follow the official install instructions on their websites. Do not install from random links or unofficial mirrors.

What your computer needs

The main limit is memory. A model has to fit in RAM, or in the graphics card's memory if you have one. Bigger models need more. You do not need a special machine for small models, but a very old laptop will be slow.

Model size (rough idea)What to expect
Small (a few billion parameters)Runs on many modern laptops. Fast. Fine for rewriting and simple questions. Makes more mistakes.
MediumNeeds more RAM or a decent graphics card. Better reasoning and instructions.
LargeNeeds a strong workstation or a server. Best quality of the open models.

You will also see the word quantised. This means the model's numbers were stored with less precision to save memory. A quantised model is smaller and faster, with a small loss in quality. For most home use, a quantised version is the right choice. The tools usually pick a sensible one for you.

A first session with Ollama

After installing Ollama from its official site, these are the basic commands. Model names change over time, so check the model library on the Ollama site for the current Llama names. I use llama3.2 below as an example name.

ollama pull llama3.2
ollama run llama3.2
ollama list

The first command downloads the model. The second starts a chat in your terminal. The third lists models on your machine. Type your prompt and press Enter. To leave the chat, type /bye.

Your first prompts

Explain in 4 sentences what a firewall does, for someone who has never used a server.

Start with a task you can judge yourself. Then try something that tests the limits:

What is the exact population of Faisalabad today?

A local model has no internet access. It will answer from its training data, which has an end date, and it may sound sure while being out of date. This is a good moment to learn that a model's knowledge is a snapshot, not a live search.

Using LM Studio

In a desktop app the flow is: search for a Llama model, pick a size that fits your memory (the app usually warns you), download, open a chat and type. There is normally a panel where you can write a system prompt and change settings such as temperature. We cover both in the next lessons.

Safety when downloading

  • Use the official library of the tool or the model's official page.
  • Read the model's licence before building anything commercial.
  • Keep the tool updated.
  • Do not expose a local model's network port to the internet without proper security.

The common mistake

The common mistake is downloading the biggest model that "fits" and then wondering why the computer freezes. Start small. A fast small model that you actually use is better than a large one that makes you wait a minute per sentence.

Try it yourself

Install one of the tools from its official site. Download a small Llama model. Ask it the same three prompts you used earlier with Meta AI: the inflation explanation, the polite message rewrite and the bakery names. Compare the answers. Write two lines about what is better and what is worse than the app assistant.

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account