llmhub — Turn a Home GPU into an Always-Available OpenAI-Compatible API
Status: maintained · Role: solo developer · Code: public · Updated: 2026-10
Why I built it
I have a GPU machine at home and a 2C4G cloud server. I wanted scripts, apps and bots to call local models at any time, but:
- The cloud server has no GPU and cannot run inference
- The home machine is not always on, and its public IP changes
- Exposing Ollama directly to the internet is a bad idea
llmhub takes a simple approach: models run at home; the server is only the front door.
1 | callers (scripts / apps / web / bots) |
Key design
- Zero inbound ports: public entry goes through Cloudflare Tunnel; the home machine connects out with an ssh reverse tunnel, so the security group barely needs opening
- Automatic fallback: one-api has two channels; when local Ollama goes down, cloud API takes over
- Unified auth and usage: every caller shares one gateway for rate limiting and statistics
- Secrets never enter the repo: real IPs, domains and keys are gitignored; only
*.exampletemplates are committed
Problems I hit
- Ollama defaults to a 4K context; coding agents send long prompts and get truncated, so
OLLAMA_CONTEXT_LENGTHmust be raised - qwen3 emits thinking output by default, taking 5–7 minutes per turn on long prompts; a forced
/no_thinkvariant made it an order of magnitude faster - Half-open reverse tunnels hold ports; sshd needs a
Matchblock to restrict forwarding plusClientAlivechecks
Limitations
- Depends on an always-on VPS and a stable tunnel; if home goes offline, calls fall back to the cloud
- Single-user configuration; no multi-tenancy or billing
- Local model quality and speed depend on the GPU; 7B/8B models are fine for light tasks, not a replacement for frontier APIs
- Any public service carries risk — at minimum add auth, rate limits and logging
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
