vLLM is a model server built for throughput. Start it on a rented GPU and you get an API that speaks the same protocol as the common hosted chat APIs, so existing code and tools work after you change one address. This guide shows how to start it with a model such as Qwen, how to choose a GPU, how to call it, and how to keep the bill small.
Why a rented GPU for this
You get an endpoint you control: your prompts go to your own server, you choose the model, and you pay by the second only while the server runs. There is nothing to install on your own computer. The trade-off is that you manage uptime and cost yourself, which this guide covers.
Step 1: Estimate the memory
The model weights must fit in GPU memory (VRAM), with room left for the cache vLLM keeps for each request. A quick estimate:
- At 16-bit, about 2 GB per billion parameters. An 8B model is about 16 GB of weights.
- Add 20 to 30 percent for the framework and cache, more for long prompts or many users at once.
So an 8B model at 16-bit wants a 24 GB GPU, such as the RTX 4090 or RTX 3090. A 14B model wants 32 GB or more, and a 70B model needs 48 GB even at 4-bit, or several GPUs at 16-bit. How much VRAM do you need? goes through the maths with examples.
Step 2: Pick a template
Apidly has several vLLM templates:
- vLLM (OpenAI-compatible) starts vLLM with a model you choose through an environment variable. Its default is the small Qwen2.5-1.5B-Instruct so a first test is quick and cheap. It needs at least 16 GB.
- Other model servers, such as Ollama and Text Generation Inference, are in the templates list if you prefer a different tool.
Start with vLLM if you want an OpenAI-style API and to choose the model yourself: start a vLLM server.
Step 3: Deploy
- Open Deploy, sort by Price, low to high and filter by the VRAM you estimated.
- Pick the vLLM (OpenAI-compatible) template.
- Under Environment variables, set
MODELto a Hugging Face model name, for exampleQwen/Qwen2.5-7B-Instruct. SetMAX_MODEL_LENto the longest prompt plus answer you need, in tokens. A lower value needs less memory for the cache. - For a model that asks you to accept a licence, add your Hugging Face token as
HF_TOKENand mark it secret. See Secrets. - On the review step check the Per hour price and select Start my server.
At the time of writing the template does not run on RTX 50-series and other Blackwell GPUs. Deploy marks those, so choose another GPU.
Step 4: Wait for the model to load
The server is billed from Running, but the API answers only after vLLM has downloaded and loaded the model. That takes a few minutes the first time, longer for bigger models. Open the server, go to the Connect tab, copy the address of port 8000 and the API key, and check:
curl -i http://SERVER_ADDRESS/health200 OK means it is ready. Connection refused means keep waiting. If it never becomes ready, read If a server fails to start for the usual causes, such as a model that does not fit or a missing access token.
Step 5: Call it
The key on the Connect tab is generated for your server. Send it as a bearer token.
curl http://SERVER_ADDRESS/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_KEY" \
-d '{"model": "Qwen/Qwen2.5-7B-Instruct", "messages": [{"role": "user", "content": "Give me three names for a coffee shop."}]}'From Python with the openai package, only the base address and key change:
from openai import OpenAI
client = OpenAI(base_url="http://SERVER_ADDRESS/v1", api_key="YOUR_KEY")
reply = client.chat.completions.create(
model="Qwen/Qwen2.5-7B-Instruct",
messages=[{"role": "user", "content": "Give me three names for a coffee shop."}],
)
print(reply.choices[0].message.content)The model value must match the name from GET /v1/models. Any tool that lets you set a custom base address, such as a chat front end or an agent framework, works the same way. The step-by-step vLLM API tutorial also shows JavaScript.
Step 6: Fix the usual problems
- Out of memory when loading. The weights plus cache do not fit. Lower
MAX_MODEL_LEN, choose a smaller or 4-bit quantised model, or use a GPU with more VRAM. - Gated model error. Accept the licence on the model's page, then add your token as
HF_TOKEN. - Slow first request. The model is warming up. Later requests are faster.
- Requests are refused. Check that you send the key. Never put the key in code you publish.
Step 7: Stop paying when you are not using it
A model server idles quietly and still costs the same per second. Use the tools that exist for this:
- Stop the server when you finish. Compute billing ends; the disk with the downloaded model stays, so the next start is faster.
- Add an Automation rule on the server: stop after a running time, stop when the GPU has been idle for a number of minutes, or stop at a spending limit. You get an email when a rule acts. See Automation.
- Watch Billing for what each server cost, and set a monthly budget. Control costs shows how.
Billing is per second, so short experiments are cheap. For the exact rules, read Billing by the second, explained, and check live pricing for current rates, which change with supply.
If you need scale-to-zero instead
A dedicated server fits steady use. If traffic is rare and spiky, a serverless endpoint that starts workers on demand may suit you better; see Serverless. For choosing hardware more broadly, read How to pick a GPU for LLM inference, and see the LLM inference use case.
Try what this guide shows
Start one of these templates on a rented GPU server. You see the price per hour before you start, and you pay by the second.
- Language modelsOpens in your browser
vLLM (OpenAI-compatible)
High-throughput LLM inference server exposing an OpenAI-compatible API on port 8000.
- Minimum GPU memory
- 16 GB
- Default disk
- 100 GB
- Language modelsOpens in your browserRecommended
Open WebUI + Ollama (private chat)
A ChatGPT-style chat website that runs open models on your own GPU, with Ollama set up for you.
- Minimum GPU memory
- 8 GB
- Default disk
- 80 GB
- Language modelsOpens in your browser
LiteLLM gateway (one API for many models)
One OpenAI-style address in front of your own models and other providers, protected by a key.
- Minimum GPU memory
- No minimum
- Default disk
- 20 GB
Try it on a real GPU server
Create a free account and add a balance from $10. Servers are billed by the second, and the review step shows the price per hour before you request one.
Related guides
- How to pick a GPU for LLM inferenceA practical way to choose a GPU plan for running a language model, starting from memory.
- How much VRAM do you need for LLMs and images?Work out how much GPU memory your model needs before you rent: a simple formula for language models, image models and fine-tuning, with worked examples.
- How billing by the second worksHow compute and storage are charged by the second on Apidly Cloud, with worked examples.