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

Run Llama models locally with Ollama and LM Studio on your own computer

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.

  1. 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.
  2. Pull a model. Run ollama run llama3.2. This downloads the 3B model and opens a chat. For the 1B model, use ollama run llama3.2:1b. For Llama 3.1 8B, use ollama run llama3.1:8b. The first run downloads the model. Later runs start fast.
  3. Chat in the terminal. Type your prompt and press Enter. Type /bye to exit. Use ollama list to see downloaded models. Use ollama ps to see running models. Use ollama stop to stop one.
  4. 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.
  5. 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

FeatureOllamaLM Studio
InterfaceCommand line, plus a desktop appDesktop app with a chat window
Best forDevelopers, scripts, and serversVisual users and quick chats
Model sourceOllama model libraryBuilt-in Hugging Face browser
Local APIlocalhost:11434, OpenAI-compatible /v1localhost:1234, OpenAI and Anthropic compatible
Enginesllama.cpp, plus MLX on Apple Siliconllama.cpp, plus MLX on Apple Silicon
CostFree, MIT-licensedFree 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.

ModelSizeDownloadContextGood for
Llama 3.2 1B1B1.3 GB128KLight tasks and edge devices
Llama 3.2 3B3B2.0 GB128KGeneral chat on a laptop
Llama 3.1 8B8B4.9 GB128KStronger general use
Llama 3.1 70B70B43 GB128KPowerful GPU or multi-GPU setups
Llama 4 Scout17B activeLarge10MLong-context work on strong hardware
Llama 4 Maverick17B activeLarge1MFlagship 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

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.