Self-hosted LLM: how to run AI models on your own computer
By Pull This RepoPosted 5 min read
Short answer
To run a self-hosted LLM, install Ollama, which is MIT licensed, with its one-line installer, then run a model such as ollama run gemma4. Add Open WebUI for a ChatGPT-style chat page in your browser. For more control use llama.cpp. LM Studio is a free desktop app, but it is not open source.
A self-hosted LLM is a large language model that runs on your own computer or server instead of a company's cloud. Your prompts never leave the machine, there is no subscription, and it keeps working offline. The easiest way in is Ollama, an MIT licensed runner, plus Open WebUI for a chat window. This guide covers how to install both, when to use llama.cpp or LM Studio instead, and which open-weight models to try, with every command and number read from the projects' own pages on 22 November 2026.
Which tools do you need for a self-hosted LLM?
| Tool | What it does | Licence | Stars on 22 Nov 2026 | Latest release |
|---|---|---|---|---|
| Ollama | downloads and runs models, with an API on port 11434 | MIT | 187,845 | v0.40.17 (10 Nov 2026) |
| Open WebUI | ChatGPT-style chat page for Ollama and other APIs | Open WebUI License (BSD-3 based, with a branding clause) | 159,258 | v0.13.4 (17 Nov 2026) |
| llama.cpp | the C/C++ inference engine many tools build on | MIT | 136,063 | v1.0.0 (13 Nov 2026) |
| LM Studio | desktop app with a model browser | free, own terms of use, not open source | not on GitHub | 0.4.28 listed for Windows |
For most people: Ollama to run models, Open WebUI to chat with them. Use llama.cpp if you want the engine itself, and LM Studio if you want a point-and-click app and do not mind closed source.
How do you install Ollama?
Ollama's README gives one command per system.
On macOS or Linux:
curl -fsSL https://ollama.com/install.sh | shOn Windows, in PowerShell:
irm https://ollama.com/install.ps1 | iexThere are also manual downloads (a .dmg and OllamaSetup.exe) and an official Docker image, ollama/ollama. Ollama's docs list macOS Sonoma (v14) or newer, and Windows 10 22H2 or newer, Home or Pro. On Windows the install needs no administrator rights and at least 4 GB of disk for the program, plus space for models, which the docs say can be tens to hundreds of GB.
Then pull and chat with a model:
ollama run gemma4The first run downloads the model. After that, Ollama also serves a local REST API at http://localhost:11434, which is how other apps, including agents, talk to it.
How do you add a chat interface with Open WebUI?
Open WebUI gives you a ChatGPT-style chat page in your browser that talks to Ollama or any OpenAI-compatible API. The official quick start uses Docker:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data -e WEBUI_SECRET_KEY=your-secret-key --name open-webui --restart always ghcr.io/open-webui/open-webui:mainSwap your-secret-key for the output of openssl rand -hex 32. Open http://localhost:3000 and create the first account, which becomes the administrator. Its README also lists a Python route:
pip install open-webui
open-webui serveThat one uses Python 3.12 and opens on http://localhost:8080. There is a :ollama image tag that bundles Ollama inside the same container, and --gpus all gives Nvidia cards to it if you have the Nvidia Container Toolkit.
One licence point: Open WebUI's licence forbids removing its branding on deployments with more than 50 users in any 30 day period, unless you have written permission or an enterprise licence. For a home setup that never matters.
When should you use llama.cpp instead?
llama.cpp is the engine underneath much of local AI, and it reached v1.0.0 on 13 November 2026. Use it directly if you want fine control over settings or a small footprint on a server. The README's quick start:
curl -LsSf https://llama.app/install.sh | shOn Windows PowerShell, irm https://llama.app/install.ps1 | iex. Then download and run a model straight from Hugging Face, or start an OpenAI-compatible API server:
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUFPre-built binaries, Docker images and build-from-source guides are on the GitHub page. llama.cpp runs models in the GGUF format.
Is LM Studio open source?
No. LM Studio's download page lists it for macOS, Windows and Linux at a price of zero, "available under the terms of use", and it says the app runs on llama.cpp and MLX under the hood. The engines are open source; the app is not. It is a fine choice if you want a polished app, but if open source matters to you, use Ollama or llama.cpp.
What are the best self-hosted LLM models to try?
These open-weight families all run in Ollama. Licences come from each model's Hugging Face card or Ollama page; sizes are Ollama download sizes. Ollama's pages give no official RAM figure except for gpt-oss.
| Model family | Licence | Ollama tags and download size | Notes from the model page |
|---|---|---|---|
| Gemma 4 (Google DeepMind) | Apache 2.0 | e2b 4.6 to 7.5 GB, e4b 6.6 to 9.5 GB, 26b 16 to 19 GB, 31b 19 to 20 GB | small tags designed for laptops; text and image input |
| Qwen 3.5 | Apache 2.0 | 0.8b 1.2 GB, 4b 3.3 to 4.0 GB, 9b 6.6 to 7.6 GB, 27b 17 to 20 GB, 122b 81 GB | widest size range here |
| gpt-oss | Apache 2.0 | 20b 14 GB, 120b 65 GB | 20b runs with as little as 16 GB of memory; 120b fits a single 80 GB GPU |
| DeepSeek-R1 | MIT (distills keep Qwen or Llama terms) | 1.5b 1.1 GB, 8b 5.2 GB, 14b 9.0 GB, 32b 20 GB, 671b 404 GB | reasoning model |
| Llama 3.1 (Meta) | Llama 3.1 Community License | 8b 4.9 GB, 70b 43 GB, 405b 243 GB | custom licence with its own conditions |
A simple rule from those numbers: the model file has to fit in memory with room left for your system. On a 16 GB laptop, start with a tag under about 8 GB, such as qwen3.5:4b or gemma4:e4b. If you have a GPU, the more of the model that fits in its VRAM, the faster it runs.
Can a self-hosted LLM power an agent?
Yes. Ollama's API is what most self-hosted agents connect to for local models. See our roundup of self-hosted AI agents for OpenClaw, OpenHands and n8n's starter kit. If you just want a free chat app and do not care where it runs, our list of free ChatGPT alternatives covers hosted options too. For a dedicated box to run it on, our guide to installing Proxmox turns a spare PC into a home server.
What is the catch?
- Smaller than the cloud. The models that fit on normal hardware are smaller than the biggest hosted ones, so expect more mistakes on hard tasks.
- Speed depends on hardware. Without a GPU, or on a large model, answers come slowly.
- Disk fills up. Each model is a multi-gigabyte download. Remove ones you no longer use with
ollama rm. - Cloud tags are not local. Ollama lists
cloudtags, such asgemma4:cloud, that run on its servers. Skip them if privacy is the point. - Licences vary. Apache 2.0 and MIT models are simple. Llama's licence has its own rules, so read it before commercial use.
Pull it. Stash it.
Questions people ask
What is the best self-hosted LLM?
There is no single best one; it depends on your memory. Gemma 4, Qwen 3.5 and gpt-oss are Apache 2.0 licensed open-weight families with sizes from about 1 GB to over 60 GB on Ollama. Start with a small tag, check the speed, then move up if your machine copes.
How much RAM do I need to run an LLM locally?
Roughly enough to hold the model file, plus room for your system. Ollama's library lists download sizes for each tag, and gpt-oss's page says its 20B model runs on systems with as little as 16 GB of memory. Most model pages give no official RAM figure, so test with smaller tags first.
Is Ollama free and open source?
Yes. The ollama/ollama repository is MIT licensed and runs models on macOS, Windows and Linux at no cost. Ollama also offers optional cloud models, marked with a cloud tag, which run on its servers rather than on your machine.
Is LM Studio open source?
No. LM Studio is a free download for macOS, Windows and Linux, offered under its own terms of use, but the app's source code is not published under an open source licence. It uses llama.cpp and MLX under the hood, which are open source.
Does a self-hosted LLM send my data anywhere?
Not when the model runs locally. The prompts and answers stay on your machine. The exception is any cloud model tag or web search tool you turn on, which sends your request out, so check what each model or plugin does.
Sources
- 1ollama/ollama
- 2Ollama library: gemma4 (read 2026-11-22)
- 3Ollama library: qwen3.5 (read 2026-11-22)
- 4Ollama library: gpt-oss (read 2026-11-22)
- 5Ollama library: llama3.1 (read 2026-11-22)
- 6Ollama library: deepseek-r1 (read 2026-11-22)
- 7open-webui/open-webui
- 8Open WebUI docs: Quick Start (read 2026-11-22)
- 9ggml-org/llama.cpp
- 10LM Studio download page (read 2026-11-22)
- 11Hugging Face model cards: Gemma 4, Qwen 3.5, Llama 3.1 (read 2026-11-22)
More repos like this
Get tomorrow's repo in your feed
One free, open source repo a day as a short video, shown working, with the catch named. Pull it. Stash it.







