How to Run AI Locally for Free
Run open AI models on your own computer for free with Ollama, LM Studio or llama.cpp: install commands, which model fits your RAM, and the catch.
- Time
- 15 minutes plus the model download
- You need
- A Mac with Apple Silicon, or a Windows or Linux PC · 8 GB of free memory for a small model; 16 GB or more is more comfortable · Free disk space for the model file (about 0.5 to 20 GB)
- Last checked
You can run an open AI model on your own computer for free: no account, no API key, no rate limit, and your prompts never leave the machine. Three tools cover almost everyone: Ollama (terminal and local API), LM Studio (desktop app) and llama.cpp (the engine underneath much of this, for people who want full control). Every number and command below comes from each vendor's own site, checked on 2026-10-21.
What you get
- Ollama: open source under the MIT license, for macOS, Windows and Linux. You pull a model by name from its library and chat with it in the terminal or call it from code on
http://localhost:11434. Ollama recommends 8 GB of available VRAM, or unified memory on a Mac; without enough VRAM it falls back to system RAM, which is slower. - LM Studio: a desktop app with a chat window, model search and download (from Hugging Face) and a local server. The Free plan costs $0 and covers running local models; the app's terms license it for personal and internal business use. It is not open source, and some features are paid (Bionic+ at $20 a month and Pro at $100 a month add its hosted agent features). LM Studio "can operate entirely offline" once you have model files.
- llama.cpp: open source under the MIT license; a command-line runner and an OpenAI-compatible server for GGUF model files from Hugging Face.
All three run the model on your hardware, so the cost is your electricity and disk space.
Which model fits your computer
A model's download size is roughly the memory it needs to run, plus extra for the conversation: longer context windows need more memory. Local downloads are usually quantized: each weight is stored in fewer bits, for example about 4 instead of 16 in the q4_K_M tags, which is why a 12-billion-parameter Gemma 4 download is 8 GB and not 24 GB (its bf16 tag). How a 30 GB model fits on a laptop shows the trade-off in five minutes.
Download sizes in the Ollama library (ollama.com/library, checked 2026-10-21). Qwen3 rows are the default tags as listed; Gemma 4 rows are the 4-bit (q4_K_M) tags. Name the 4-bit Gemma 4 tag, because the short one (gemma4:e2b) is listed at 4.6 to 7.5 GB depending on the build:
| Model | Download | Context | A computer with |
|---|---|---|---|
qwen3:0.6b | 523 MB | 40K | any |
qwen3:1.7b | 1.4 GB | 40K | 8 GB |
qwen3:4b | 2.5 GB | 256K | 8 GB |
gemma4:e2b-it-q4_K_M | 4.6 GB | 128K | 8 GB |
qwen3:8b | 5.2 GB | 40K | 16 GB |
gemma4:e4b-it-q4_K_M | 6.6 GB | 128K | 16 GB |
gemma4:12b-it-q4_K_M | 8.0 GB | 256K | 16 GB |
qwen3:14b | 9.3 GB | 40K | 16 GB |
gemma4:26b-a4b-it-q4_K_M | 18 GB | 256K | 32 GB |
gemma4:31b-it-q4_K_M | 20 GB | 256K | 32 GB |
The last column is our rule of thumb (the file plus room for the system and the conversation), not a vendor figure. Each model has its own license on its model page; check it before you use one in a product. Ollama tags ending in cloud (such as gemma4:cloud) run on Ollama's servers, not on your computer.
Steps
Ollama
- Install it. On macOS or Linux:
curl -fsSL https://ollama.com/install.sh | sh. On Windows, in PowerShell:irm https://ollama.com/install.ps1 | iex. Or download the app from ollama.com/download. - Run a model:
ollama run gemma4:e2b(Ollama's own first example; the download is about 7.2 GB). The first run downloads it, then a chat starts in the terminal; type/byeto leave. - Pick a size from the table above, for example
ollama run qwen3:4bon an 8 GB laptop. - On Linux, if the server is not running, start it with
ollama serve.
LM Studio
- Check the requirements: on a Mac, Apple Silicon (M1 to M4) and macOS 14 or newer (Intel Macs are not supported; 16 GB of RAM is recommended, 8 GB Macs should stay with small models). On Windows, an x64 CPU with AVX2 or an ARM Snapdragon X Elite, with 16 GB of RAM and 4 GB of dedicated VRAM recommended. On Linux, Ubuntu 20.04 or newer, x64 or ARM64.
- Download the installer for your system from lmstudio.ai.
- Search for a model inside the app and download it, then load it and chat.
llama.cpp
- Install it. On macOS or Linux:
curl -LsSf https://llama.app/install.sh | sh. On Windows, in PowerShell:irm https://llama.app/install.ps1 | iex. Prebuilt binaries are also on the GitHub releases page. - Chat with a small model straight from Hugging Face:
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF. - Serve it as an OpenAI-compatible API:
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF.
Use it from your code
- Ollama listens on
http://localhost:11434, for examplecurl http://localhost:11434/api/chat. - LM Studio: open the Developer tab and switch on Start server, or run
lms server startin a terminal. It offers OpenAI-compatible endpoints, among others. - llama.cpp: the server listens on
127.0.0.1:9931by default and has OpenAI-compatible chat completions, responses and embeddings routes.
Because these speak the OpenAI API, most SDKs and tools work by changing the base URL to your local address.
Limits and the catch
- Smaller models know less. What fits in 8 to 16 GB is a few billion parameters; it chats, summarises and writes code snippets well, but it misses facts and multi-step reasoning that the large cloud models handle. Why the free model feels dumber explains why.
- Speed depends on your hardware. A recent Mac or a PC with a GPU is fast enough to chat; on CPU only, expect slow answers, and Ollama warns that falling back to system RAM is slower.
- Disk and memory. Models are gigabytes each, and while one runs it holds that memory.
- You maintain it. Updates, model choice and licenses are your job.
When a free cloud tier is better
Use a cloud free tier when you need a bigger model than your computer can hold, when your laptop is slow, or when you want to try many models quickly:
- Free AI APIs with no credit card compares the free API tiers.
- Free OpenRouter models and a free Gemini API key give large models for free, within rate limits.
- Free GPUs for AI gives you Kaggle and Hugging Face GPUs for models too big for your machine.
Keep local when the data must not leave your computer, when you are offline, or when rate limits get in the way.
If it doesn't work
- The model is very slow or the computer freezes: pick a smaller model or tag from the table, close other apps, and keep the context short.
ollamasays it cannot connect: start the server (ollama serveon Linux, or open the Ollama app on macOS and Windows).- LM Studio does not start on an Intel Mac: Intel Macs are not supported; use Ollama or llama.cpp instead.
- LM Studio on Windows fails on an older PC: x64 CPUs need AVX2 support.
Understand it
A few minutes of play-along, no sign-up.
- Why can I run Llama on my laptop but not GPT? · Open weights vs closed API models, and model licenses · 5 min
- Why does a 7B model need 16 GB of RAM? · Model memory: parameters × bytes, plus the KV cache · 5 min
Frequently asked questions
- Is it really free to run AI locally?
- Yes. Ollama and llama.cpp are open source under the MIT license, and LM Studio has a $0 Free plan for running local models. You pay only in hardware, disk space and electricity.
- How much RAM do I need to run AI locally?
- Roughly the size of the model file plus room for the conversation. Small 4-bit models such as qwen3:4b (2.5 GB) run on an 8 GB laptop; 12-14B models want 16 GB; 26-31B models want 32 GB. Ollama recommends 8 GB of available VRAM or Mac unified memory.
- Ollama or LM Studio?
- Ollama if you like the terminal or want a local API for your code; LM Studio if you want a desktop app with model search and a chat window. Both can serve an OpenAI-compatible API. LM Studio is not open source and does not support Intel Macs.
- Does a local model send my data anywhere?
- No: the model runs on your computer. LM Studio says it can operate entirely offline once the model files are downloaded. Ollama tags ending in cloud are the exception: they run on Ollama’s servers.
Sources
Steps and limits were checked against these official pages.
- docs.ollama.com/quickstart
- github.com/ollama/ollama
- ollama.com/library/gemma4/tags
- ollama.com/library/qwen3
- lmstudio.ai/docs/app
- lmstudio.ai/docs/app/system-requirements
- lmstudio.ai/docs/developer/core/server
- lmstudio.ai/pricing
- lmstudio.ai/app-terms
- github.com/ggml-org/llama.cpp
- github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md
More guides
- How to Get a Free Gemini API Key
- How Students Can Get ChatGPT Plus Free
- How Students Can Get Google Gemini (AI Pro) Free
- How to Use an AI Coding Agent for Free
- How to Get a Free GPU for AI
- How to Apply for AI Startup Credits
- How to Get Free Claude API Credits
- How to Get a Free Groq API Key
- Free AI Image Generation: In the Browser and by API
- Free OpenAI API Access in 2026: What's Actually Free
- Free Embeddings and Reranking APIs in 2026
- Free Text-to-Speech APIs in 2026
- Free Speech-to-Text APIs in 2026
- Free AI Video Generators in 2026
- Free Image Generation APIs in 2026
- Free Web Search APIs for LLM Agents in 2026
- Free Vector Databases for RAG in 2026
- Free DeepSeek API in 2026: What Is Actually Free
- OpenRouter Free Models: Limits, Credits and API Setup
- Free Hugging Face Inference: Credits, ZeroGPU and Spaces
- Free AI APIs With No Credit Card in 2026
- Track Free-Tier Changes Automatically
- Free Vision APIs: Read Images and Screenshots for Free
- Free Reasoning Model APIs: Thinking Models for Free
- Free AI courses