If you're serving an open-weight LLM (Llama, Mistral, Qwen, and friends) at any real volume, you'll run into vLLM (https://docs.vllm.ai). Its PagedAttention memory management and continuous batching make it dramatically more throughput-efficient than naive transformers serving, and — the killer feature for integrators — it exposes an OpenAI-compatible API. That means your existing OpenAI SDK code points at your own server by changing one base URL. I run PandaStack; here's how to deploy it, with the GPU caveat stated up front because it's the whole ballgame.
The honest caveat first: GPUs
Real LLM inference wants a GPU. vLLM will technically run on CPU for tiny models, but for anything useful you need GPU compute. Check PandaStack's current compute tiers and GPU availability at https://docs.pandastack.io before planning a production deployment — don't assume, verify, because your model's VRAM requirement dictates everything. This guide gives you a container that's correct and portable; run it on GPU-backed compute wherever that lives. Everything below (the image, the OpenAI-compatible endpoint, the client code) is the same regardless of where the GPU sits.
Step 1: The vLLM OpenAI-compatible server
vLLM ships a server entrypoint that speaks the OpenAI API. You can run it directly:
python -m vllm.entrypoints.openai.api_server \
--model mistralai/Mistral-7B-Instruct-v0.3 \
--host 0.0.0.0 \
--port 8000That single command gives you /v1/chat/completions and /v1/completions endpoints compatible with the OpenAI SDK.
Step 2: Dockerfile
vLLM publishes official images, which is the sane starting point because building the CUDA stack yourself is a bad time:
FROM vllm/vllm-openai:latest
# Model can be baked in or pulled at runtime from HF (needs HF_TOKEN for gated models)
ENV MODEL=mistralai/Mistral-7B-Instruct-v0.3
EXPOSE 8000
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server", \
"--model", "mistralai/Mistral-7B-Instruct-v0.3", \
"--host", "0.0.0.0", "--port", "8000"]For gated models (like some Llama weights), pass a Hugging Face token as the HF_TOKEN environment variable — set it in PandaStack's encrypted env store, never in the image.
Step 3: Deploy on PandaStack
- 1Push the repo (or reference the image) to Git.
- 2https://dashboard.pandastack.io → New App → connect repo. PandaStack builds the Dockerfile with rootless BuildKit and deploys via Helm.
- 3Set environment variables:
HF_TOKEN(if needed), and any vLLM tuning flags. - 4Expose port 8000. Add a custom domain under Domains for a clean URL with automatic SSL.
Set a generous health check grace period — large models take a while to load into VRAM on startup, and you don't want the platform restarting the container mid-load. Point the health check at /health (vLLM exposes one) with a startup delay that fits your model's load time.
Step 4: Call it like OpenAI
The payoff — your client code barely changes:
from openai import OpenAI
client = OpenAI(
base_url="https://your-vllm.pandastack.io/v1",
api_key="not-needed-or-your-own-key",
)
resp = client.chat.completions.create(
model="mistralai/Mistral-7B-Instruct-v0.3",
messages=[{"role": "user", "content": "Explain PagedAttention in one sentence."}],
)
print(resp.choices[0].message.content)Same SDK, same request shape — you just own the server now.
Step 5: Put a proxy or gateway in front (recommended)
Exposing a raw inference server to the internet is risky and hard to meter. In front of vLLM, run a small gateway (or LiteLLM) that adds authentication, rate limiting, and usage logging. On PandaStack that's just a second container app talking to your vLLM app over the platform network. Your public traffic hits the gateway; the gateway talks to vLLM privately.
Honest tradeoffs
- GPU cost and availability is the real constraint. LLM serving isn't cheap, and idle GPUs burn money — verify PandaStack's current GPU/compute options and pricing at https://docs.pandastack.io and size your instance to your model's VRAM before committing.
- Cold starts hurt more here. Loading a multi-GB model into VRAM takes real time; keep the instance warm (don't scale to zero) for a latency-sensitive endpoint.
- Managed APIs (OpenAI, Anthropic) are simpler if you don't specifically need open weights, data locality, or fine-tuned models. Self-host vLLM when those requirements are real, not by default.
- vLLM iterates fast — pin the image tag and read the changelog before upgrading.
Wrap-up
vLLM gives you high-throughput, OpenAI-compatible serving for open LLMs. Containerize the official image, deploy it on GPU-backed compute via PandaStack, front it with an auth/rate-limit gateway, and point your OpenAI SDK at your own base URL. Just verify the GPU story first — that's the part that makes or breaks it.
Docs: https://docs.pandastack.io. Start free: https://dashboard.pandastack.io.