// guide

Serve an OpenAI-compatible API with vLLM

vLLM's OpenAI-compatible server is an HTTP server that implements OpenAI's Completions API, Chat API and more, so an OpenAI client talks to your own model by changing its base_url to the vLLM server's /v1 address.

Updated

Published

On this page

What is the vLLM OpenAI-compatible server?

vllm serve MODEL starts vLLM's HTTP server. The vLLM documentation (external site) lists these endpoints:

PathPurpose
/v1/completionsCompletions API
/v1/chat/completionsChat Completions API
/v1/chat/completions/batchChat Completions batch API
/v1/responsesResponses API
/v1/embeddingsEmbeddings API
/v1/audio/transcriptionsTranscriptions API
/v1/audio/translationsTranslation API

The documented start command with an API key is vllm serve NousResearch/Meta-Llama-3-8B-Instruct --dtype auto --api-key token-abc123.

How do I start the server and call it from my machine?

  1. Start the server on the instance with vllm serve MODEL and the --api-key option.

  2. On NVIDIA Brev, forward the server's port to your own machine with brev port-forward my-instance --port 8000:8000.

  3. Create an OpenAI client whose base_url is the server's /v1 address on port 8000 of your own machine.

  4. Set the client's api_key to the key given to --api-key.

  5. Send requests to one of the endpoints in the table above, such as /v1/chat/completions.

The vLLM documentation's Python example creates an OpenAI client whose base_url is the server's /v1 address on port 8000 and whose api_key is the key given to --api-key.

The Brev CLI connectivity reference (external site) describes brev port-forward as forwarding a TCP port from your instance to your own machine over SSH; its example is brev port-forward my-instance --port 8888:8888.

For a vLLM server on port 8000, the same form is --port 8000:8000. With the port forwarded, port 8000 on your machine reaches the server on the instance, and the client's base_url points at that port's /v1 path.

How do I set a vLLM API key and call it?

  1. Start the server with --api-key YOUR_KEY, or set the VLLM_API_KEY environment variable instead.

  2. In the OpenAI client, set api_key to the same value and base_url to the server's /v1 address.

  3. Without the key, requests to /v1 endpoints are refused; with it, they are served.

Pick your own long random value for the key, keep it out of your code, and pass it to the client from an environment variable. The option and the variable are documented in the vLLM OpenAI-compatible server (external site) page.

Which vllm-openai Docker image do our Launchables use?

As of 2026-11-28, our vLLM Launchables pin the image vllm/vllm-openai:v0.33.0.

ItemOpen WebUI + vLLM LaunchableOpen Notebook on Nemotron Launchable
Imagevllm/vllm-openai:v0.33.0vllm/vllm-openai:v0.33.0, pinned by digest
GPU1x NVIDIA L40S 48GB1x NVIDIA L40S 48GB
Instance typeAWS g6e.xlargeAWS g6e.xlarge
Priceabout $2.25/hr (Brev deploy page, 2026-12-03)about $2.26/hr (Brev console, 2026-11-19)
Default modelQwen/Qwen3-8Bnvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8
API port8000, bound to the instance8000, bound to the instance

What did our test of a vLLM API show?

Our fresh-deploy test of the Open Notebook on Nemotron Launchable on AWS g6e.xlarge, 2026-11-15, called its vLLM chat API on the instance:

  • /v1/models listed the chat model 28.0 minutes after create.

  • A chat completion asking for "OK" returned "content":"OK" with finish_reason stop.

  • After a stop and start, the model was listed and chat answered again about 9.3 minutes after start.

How do I keep the API private?

Three controls work together:

  • Bind the API to the instance. In the Open WebUI + vLLM Launchable, the vLLM API is bound to the instance itself and is not exposed publicly; you reach it through the port forward.
  • Set an API key. The --api-key option, or the VLLM_API_KEY environment variable, authenticates requests to endpoints under the /v1, /v2, /inference and /cohere path prefixes.
  • Choose how a port is exposed. On NVIDIA Brev, Secure Links protect HTTP services with Brev authentication, and TCP/UDP ports are exposed to all IP addresses or only to the deployer's IP address (NVIDIA Brev Launchables (external site)).

How do I run it on NVIDIA Brev?

Deploy the Open WebUI + vLLM Launchable. It runs vLLM v0.33.0 (image vllm/vllm-openai:v0.33.0) with Qwen/Qwen3-8B on one NVIDIA L40S 48GB GPU, and Open WebUI as a chat interface on the same API. The deploy steps are in how to deploy a Launchable on NVIDIA Brev.

Next steps for a vLLM API on NVIDIA Brev:

What if vLLM will not start because of GPU memory?

If the server stops at startup with ValueError: No available memory for the cache blocks, read what we saw with two vLLM servers on a shared GPU. It covers two vLLM servers on one GPU, the --gpu-memory-utilization share and the settings the vLLM docs name.

Built your own vLLM stack? Can NightKeeper package it as a Launchable?

NightKeeper packages your repository as an NVIDIA Brev Launchable, proves it on a fresh GPU and keeps it running. Point NightKeeper at your repository, review the pull request whose GitHub Actions workflow smoke-tests the stack on a fresh NVIDIA Brev instance, then create the Launchable in the Brev console with the settings NightKeeper provides. Your Brev API key stays in your repository's GitHub secrets. NightKeeper never sees it.

Create your Launchable or read about NightKeeper.

Sources: where do these facts come from?

How was this page made?

9owls published this page. The server, endpoint and API key facts come from the vLLM documentation, and the port-forward facts from the NVIDIA Brev documentation, read on the dates above. The image, GPU and price rows come from our Launchable records, each with its own date. The test values come from our fresh-deploy test on 2026-11-15. Found an error? Tell us on the company page.

What changed on 2026-11-28: added the API key steps, the pinned image and hardware table, our recorded test values and the link to the cache-blocks error page.

All guides