What is a self-hosted LLM?
A self-hosted LLM is an open-weight language model (Llama, Qwen, Mistral, DeepSeek, GLM) that you download and run on your own hardware using a serving runtime. Unlike a hosted API (OpenAI, Anthropic, Google), your prompts never leave your machine. You control the model, the data path, the uptime, and the access.Why self-host?
Vitalik Buterin’s April 2026 post details the backdoor and censorship risks of hosted models and why local serving matters for sovereignty.
Pick your runtime
Hardware fit
Memory is the constraint. Formula: params × bytes-per-weight + overhead.
Example calc: 32B params × 0.5 bytes (4-bit) = 16 GB weights + ~4 GB KV cache/runtime = ~20 GB total.
See the full hardware reference and model fit calculator for detailed sizing.
Run your first model
1
Install Ollama
2
Pull a model
3
Run it
http://127.0.0.1:11434/v1 — any OpenAI SDK can call it locally.
The missing layer: authenticated access
Here’s the wall every self-hosting guide stops at: your model works onlocalhost, but your laptop, teammate, coding agent, or n8n workflow can’t reach it securely.
- Binding to
0.0.0.0exposes the model with no authentication — anyone on the network can call it. - Port forwarding fails behind CGNAT (Starlink, apartment ISPs).
- Tunnels (Cloudflare, ngrok) add buffering, timeouts, and request caps.
1
Keep your model on localhost
Default binding. Don’t change it.
2
Pair the connector
3
Register a deployment
Give your model a public name (e.g.,
private-qwen3).4
Create scoped API keys
1 key per teammate or tool. Scope by model-name glob. Revoke instantly.
5
Call from anywhere
Migration from cloud APIs
If you’re currently using OpenAI, Anthropic, or another cloud API, migration is straightforward:- Pick an equivalent open-weight model. Llama 3.1 70B, Qwen3 72B, or DeepSeek-R1 match GPT-4 on most benchmarks.
- Serve it locally with Ollama or vLLM (see steps above).
- Point your existing code at the local endpoint. Change
base_urlfromhttps://api.openai.com/v1tohttps://api.tokios.com/v1(or your localhttp://127.0.0.1:PORT/v1). - Nothing else changes. The OpenAI SDK, Anthropic SDK, and all compatible clients work identically.
FAQ
What is a private LLM?
What is a private LLM?
A language model that runs on hardware you control. Your prompts, outputs, and data never leave your network. Open-weight models (Llama, Qwen, Mistral, DeepSeek) make this possible — you download the weights and serve them yourself.
Can I self-host ChatGPT?
Can I self-host ChatGPT?
Not ChatGPT itself (it’s proprietary), but you can self-host models with comparable quality — Llama 3.1 70B, Qwen3 72B, DeepSeek-R1 70B — and get a ChatGPT-like experience with Open WebUI or any OpenAI-compatible client.
How much does it cost to self-host an LLM?
How much does it cost to self-host an LLM?
Hardware: a 16 GB GPU (RTX 4080, ~$1,200) runs 8B models comfortably. A 24 GB RTX 4090 (~$1,600) handles 32B. After hardware, the marginal cost per token is electricity only. No subscription, no per-token billing.
Is self-hosting an LLM safe?
Is self-hosting an LLM safe?
Safer than hosted APIs for data privacy — nothing leaves your network. The risk is exposing the serving port without auth. Keep the model on localhost and use an authenticated endpoint (like Tokios) for remote access.
Can I run a private LLM offline / air-gapped?
Can I run a private LLM offline / air-gapped?
Yes. Ollama and llama.cpp work fully offline once the model is downloaded. For air-gapped environments, download the model file on a connected machine and transfer it. The Tokios connector requires outbound internet to reach
api.tokios.com — for fully air-gapped use, call the model’s localhost API directly.How do I give my team access to my self-hosted model?
How do I give my team access to my self-hosted model?
Create a separate
sk-tok-… API key per teammate in the Tokios dashboard. Scope each key to specific deployments. Revoke access instantly without touching the model or server. No shared passwords, no exposed ports. See Team access to local models.Team access
Full walkthrough for giving your team API access to your local models.
Bring your AI in-house
Migration guide for teams switching from cloud APIs to local inference.
Ollama remote access
The full guide to authenticated remote access for Ollama.
Quickstart
Pair a connector and register your first model.
Model fit guide
Find the right model for your exact hardware.
What is a local LLM?
Complete guide to running large language models locally.