How to Run Llama Models Locally With Ollama and LM Studio
Run Llama models locally with Ollama or LM Studio. This guide covers install steps, model sizes, hardware needs, and local APIs for your own machine.
By Galactic News Editorial · Published 2026-11-11T01:25:50+00:00 · Updated 2026-11-11T01:25:50+00:00
How to Run Llama Models Locally With Ollama and LM Studio
You can run Llama models locally on your own computer. No cloud account is needed. No per-token bill arrives. Two tools make the setup simple: Ollama and LM Studio. Ollama is a command-line tool. LM Studio is a desktop app with a chat window. Both download open-weight Llama models and run them on your hardware. This guide covers both paths. It shows the install steps, the model sizes that fit common hardware, and how to call the model from your own code.
What You Need Before You Run Llama Models Locally
Llama is Meta's family of open-weight language models. You download the weights and run them on your own machine. The weights are free to download under the Llama Community License. Official weights live on Hugging Face under the meta-llama organization. You must accept the license there before you download the official files.
Hardware decides which model you can run. Memory is the main limit. Ollama's own guidance puts 7B models at 8GB of RAM, 13B models at 16GB, and 33B models at 32GB. A GPU helps a lot. Apple Silicon Macs run models well through unified memory. A modern CPU can run small models, but it will be slow.
Disk space matters too. Model files range from about 1GB to hundreds of GB. Llama 3.2 1B is a 1.3GB download. Llama 3.2 3B is about 2.0GB. Llama 3.1 8B is about 4.9GB. The 70B version is about 43GB. The 405B version is about 243GB. Most home setups should start with the 1B, 3B, or 8B models.
Llama 4 is the newest generation. Scout and Maverick are mixture-of-experts models with 17B active parameters each. Scout offers a 10M-token context window. Maverick offers a 1M-token context window. Both are large models. Most local setups will find Llama 3.1 or Llama 3.2 more practical.
How to Run Llama Models Locally With Ollama
Ollama is the fastest path for developers. One command downloads a model and opens a chat. Follow these steps.
- Install Ollama. Download it from the Ollama website. On Linux, run the install script:
curl -fsSL https://ollama.com/install.sh | sh. On macOS, download Ollama.dmg and drag it to Applications. On Windows, run OllamaSetup.exe. Docker users can run the official ollama/ollama image. - Pull a model. Run
ollama run llama3.2. This downloads the 3B model and opens a chat. For the 1B model, useollama run llama3.2:1b. For Llama 3.1 8B, useollama run llama3.1:8b. The first run downloads the model. Later runs start fast. - Chat in the terminal. Type your prompt and press Enter. Type
/byeto exit. Useollama listto see downloaded models. Useollama psto see running models. Useollama stopto stop one. - Call the model from code. Ollama serves a local API on http://localhost:11434. It listens only on 127.0.0.1 by default. Your prompts stay on your machine. The chat endpoint is /api/chat. Ollama also offers an OpenAI-compatible API under /v1. That means existing OpenAI client code often works with one change: the base URL.
- Set the context length if needed. Ollama sets the default context length from available VRAM. To raise it, create a Modelfile or set OLLAMA_CONTEXT_LENGTH. A longer context uses more memory, so raise it only as far as your hardware allows.
curl http://localhost:11434/api/chat -d '{
"model": "llama3.2",
"messages": [{"role": "user", "content": "Hello!"}]
}'
The same request works from Python with the ollama package. Use chat(model='llama3.2', messages=[...]) and read the reply from the response object. Keep the server bound to localhost. The local API has no auth by default, so do not expose port 11434 to the internet.
How to Run Llama Models Locally With LM Studio
LM Studio is the friendly path. It is a desktop app with a chat window and a built-in model browser. Follow these steps.
- Download LM Studio. Get the installer from the LM Studio website. It runs on macOS, Windows, and Linux. Macs need Apple Silicon and macOS 14 or newer. Intel Macs are not supported. Windows needs an x64 CPU with AVX2 support or an ARM chip. Linux ships as an AppImage for Ubuntu 20.04 or newer.
- Find a model. Open the Discover tab and search for a model. LM Studio browses Hugging Face from inside the app. Pick a GGUF file. The Q4_K_M quant is a common pick. Choose a file smaller than your free memory.
- Download and load it. Download the model, then pick it in the chat tab. The app shows load settings such as context length and GPU offload. Start chatting. You can attach documents to a chat and use them offline.
- Serve the model to your tools. Open the Developer tab and start the local server. It speaks the OpenAI API at http://localhost:1234/v1. It also speaks the Anthropic API. That lets editors and coding agents point at your local model. Official SDKs exist for Python and JavaScript.
- Know the engines. LM Studio runs models with llama.cpp on every platform. Apple Silicon Macs can also use MLX. The desktop app is free for personal and business use. Paid plans cover cloud features only. Core local features work offline once models are downloaded.
Ollama vs LM Studio: Which One Should You Pick?
Both tools run the same models. They differ in how you work with them. The table below sums up the choice.
| Feature | Ollama | LM Studio |
|---|---|---|
| Interface | Command line, plus a desktop app | Desktop app with a chat window |
| Best for | Developers, scripts, and servers | Visual users and quick chats |
| Model source | Ollama model library | Built-in Hugging Face browser |
| Local API | localhost:11434, OpenAI-compatible /v1 | localhost:1234, OpenAI and Anthropic compatible |
| Engines | llama.cpp, plus MLX on Apple Silicon | llama.cpp, plus MLX on Apple Silicon |
| Cost | Free, MIT-licensed | Free desktop app for home and work |
Pick Ollama if you live in the terminal or build apps against a local API. Pick LM Studio if you want a window, a model browser, and a chat view. Many developers install both. They use LM Studio to explore models and Ollama to serve them.
Picking the Right Llama Model for Your Hardware
Match the model to your memory. A model that fits on disk can still be too large to load. Use the table below as a starting point.
| Model | Size | Download | Context | Good for |
|---|---|---|---|---|
| Llama 3.2 1B | 1B | 1.3 GB | 128K | Light tasks and edge devices |
| Llama 3.2 3B | 3B | 2.0 GB | 128K | General chat on a laptop |
| Llama 3.1 8B | 8B | 4.9 GB | 128K | Stronger general use |
| Llama 3.1 70B | 70B | 43 GB | 128K | Powerful GPU or multi-GPU setups |
| Llama 4 Scout | 17B active | Large | 10M | Long-context work on strong hardware |
| Llama 4 Maverick | 17B active | Large | 1M | Flagship local use on strong hardware |
Start small. A 3B model that answers fast beats a 70B model that never loads. Move up only when your hardware has room to spare.
Common Problems and Fixes
- The model runs on CPU, not GPU. Check
ollama ps. It shows GPU or CPU use. A split means the model plus its context did not fit in VRAM. Pick a smaller model or a shorter context. - Out of memory. The model file fits on disk but not in RAM. Drop to a smaller size or a lower quant.
- Slow replies on CPU. Small models on CPU are slow. That is normal. A GPU or an Apple Silicon chip changes the speed a lot.
- License gate on Hugging Face. Official Meta weights need license acceptance first. Accept the license on the model page, then download.
- Cloud tags in Ollama. Model tags ending in "cloud" run on Ollama's servers, not your machine. Check the tag before you run it.
Bottom Line
Start with Ollama if you build with code. Start with LM Studio if you want a chat window. Use Llama 3.2 3B on a laptop. Use Llama 3.1 8B on a machine with a decent GPU. Keep prompts local by binding the server to localhost. Check the model license before you ship anything built on it.