GPUStack · LLM inference · Cloudflare Tunnel · Docker · NVIDIA
Overview
This turns a single GPU host into an inference service for LLM, VLM, embedding, and rerank models. The GPUStack v2.1.2 server and worker run as Docker Compose containers, exposed through a Cloudflare Tunnel so the host opens no inbound ports. The public interface is OpenAI-compatible, so existing code using the openai SDK connects with almost no changes.Core features
- server and worker as two containers, brought up with a single
docker compose up - Cloudflare Tunnel for public access; the host firewall opens no inbound ports
- Two hostnames, split by purpose: the API uses a CF Access Service Token, the Web UI uses an email allowlist
- OpenAI-compatible endpoint (
/v1/chat/completions), usable directly with the openai SDK - Models deployed from the Web UI, sourced from HuggingFace, Ollama, or a local path
Architecture
The server and worker talk over an internal bridge network, and inference containers attach to the worker via host networking, so the outside only ever reaches the Cloudflare layer.Quick start
1
Prerequisites (fresh machine only)
2
Set environment variables
3
Configure the Cloudflare Tunnel
In Zero Trust → Tunnels, create a tunnel and point the Public Hostname service URL at the container name
http://gpustack:80, not localhost.4
Start and verify
Notes
In practice
This fits a lab machine or any host without a public IP where you want self-hosted LLM/VLM inference, a programmatic API for other services to call, and no need to open inbound firewall ports or rent cloud GPUs.Links
- GitHub: felimet/gpustack-api
- GPUStack docs: docs.gpustack.ai