Deploy vLLM (OpenAI-compatible)
The prebuilt vLLM worker serves any Hugging Face model behind an OpenAI-compatible API. Point the official OpenAI SDK at your endpoint and change nothing else.
Deploy the worker
Use the image apipods/worker-vllm:v2.4.0. Model weights download on the first start; attach a network volume so they are cached at /volume/hf for every later worker.
curl -X POST https://api.apipods.com/v1/endpoints \
-H "Authorization: Bearer $APIPODS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "llama-3.3-70b",
"image": "apipods/worker-vllm:v2.4.0",
"gpuPoolIds": [
"H200",
"H100_SXM"
],
"gpuCount": 2,
"maxWorkers": 4,
"idleTimeoutInSec": 60,
"networkVolumeId": "vol_c7d2h4ke",
"env": {
"MODEL_NAME": "meta-llama/Llama-3.3-70B-Instruct",
"SERVED_MODEL_NAME": "llama-3.3-70b",
"MAX_MODEL_LEN": "32768",
"TENSOR_PARALLEL_SIZE": "2",
"GPU_MEMORY_UTILIZATION": "0.92",
"QUANTIZATION": "fp8",
"MAX_CONCURRENCY": "64",
"HF_HOME": "/volume/hf",
"HF_TOKEN": "{{ secrets.HF_TOKEN }}"
}
}'Note: Gated models need a Hugging Face token. Store it as a secret (
apipods secrets set HF_TOKEN) and reference it as {{ secrets.HF_TOKEN }}; see Environment variables & secrets.Configuration
| Variable | Default | Description |
|---|---|---|
MODEL_NAME | required | Hugging Face repo ID, or a path on the network volume. |
SERVED_MODEL_NAME | MODEL_NAME | The name clients pass as model. |
MAX_MODEL_LEN | model default | Maximum context length. Lower it to free memory for KV cache. |
TENSOR_PARALLEL_SIZE | gpuCount | GPUs to shard the model across. Keep equal to the endpoint's gpuCount. |
GPU_MEMORY_UTILIZATION | 0.92 | Fraction of GPU memory vLLM may use. |
QUANTIZATION | none | fp8, awq, gptq, or bitsandbytes. |
MAX_CONCURRENCY | 64 | Concurrent requests per worker (see Concurrency). |
HF_TOKEN | none | Token for gated or private models. |
Call it with the OpenAI SDK
The OpenAI-compatible base URL is https://run.apipods.com/v1/ep_llama70b/openai/v1. Use your Apipods API key as the API key. Supported routes: /chat/completions, /completions and /models, with stream: true.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://run.apipods.com/v1/ep_llama70b/openai/v1",
api_key=os.environ["APIPODS_API_KEY"],
)
stream = client.chat.completions.create(
model="llama-3.3-70b",
messages=[{"role": "user", "content": "Write a haiku about GPUs."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Native job API
The worker also accepts regular jobs on /run and /runsync, which is useful for large offline batches that should not hold an HTTP connection open:
{
"input": {
"messages": [
{
"role": "user",
"content": "Summarize this support ticket: ..."
}
],
"sampling_params": {
"temperature": 0.2,
"max_tokens": 256
}
}
}Sizing GPUs
| Model size | Precision | Suggested pools | gpuCount |
|---|---|---|---|
| 7B to 8B | BF16 | L40S, L4 | 1 |
| 13B to 32B | FP8 | L40S, RTX_PRO_6000 | 1 |
| 70B | FP8 | H200, H100_SXM | 2 |
| 70B | BF16 | H200, H100_SXM | 4 |
A 2-GPU worker on H200 costs $27.96/hr while running. Set idleTimeoutInSec to 30 to 120 seconds for chat traffic: a 70B model is expensive to cold start even with Warmstart.