Skip to main content
A self-hosted LLM (also called a private LLM or locallm) runs on hardware you own — your prompts, weights, and data never leave your network. Install a runtime (Ollama is the fastest start), pull an open-weight model, and you have a private AI in 2 commands. The step most guides skip: giving that model a secure, authenticated endpoint so your team, tools, and agents can call it from any device without exposing a port. Last verified: 2026-10-24

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

Start with Ollama. It handles model downloads, quantization, and GPU offloading automatically. Graduate to vLLM when you need concurrent-request throughput.

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

You now have a private LLM. Your prompts never left your machine.
Ollama also serves an OpenAI-compatible API at 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 on localhost, but your laptop, teammate, coding agent, or n8n workflow can’t reach it securely.
  • Binding to 0.0.0.0 exposes 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.
The Tokios connector adds the missing layer: an authenticated, HTTPS, OpenAI- and Anthropic-compatible endpoint — without opening a port.
1

Keep your model on localhost

Default binding. Don’t change it.
2

Pair the connector

Approve in the dashboard.
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

You’ve got a private LLM running. Now give it a secure, authenticated endpoint your team and tools can call from anywhere.

Migration from cloud APIs

If you’re currently using OpenAI, Anthropic, or another cloud API, migration is straightforward:
  1. Pick an equivalent open-weight model. Llama 3.1 70B, Qwen3 72B, or DeepSeek-R1 match GPT-4 on most benchmarks.
  2. Serve it locally with Ollama or vLLM (see steps above).
  3. Point your existing code at the local endpoint. Change base_url from https://api.openai.com/v1 to https://api.tokios.com/v1 (or your local http://127.0.0.1:PORT/v1).
  4. Nothing else changes. The OpenAI SDK, Anthropic SDK, and all compatible clients work identically.
Your app code doesn’t change. Your prompts don’t change. Your workflow doesn’t change. The only difference: your data stays on your network. See Bring your AI in-house for the full migration walkthrough.

FAQ

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.
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.
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.
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.
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.
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.