Skip to main content

Overview

vLLM is a high-throughput inference engine for LLMs with PagedAttention. It exposes an OpenAI-compatible API and is one of the most widely deployed self-hosted inference backends. Cognisafe intercepts all vLLM traffic transparently — no changes to your vLLM deployment required.

Quick start

Run vLLM

vLLM’s OpenAI-compatible server listens on http://localhost:8000/v1.

Proxy configuration

SDK setup

vLLM uses the full model name as the model field (e.g. meta-llama/Llama-3.1-8B-Instruct). Make sure your application code uses the same name that vLLM was started with.

Multi-model deployment

vLLM supports serving multiple models via the --served-model-name flag or by running multiple instances. A common pattern is to deploy one vLLM instance per model and route via Cognisafe:
Run a Cognisafe proxy per upstream, or use a load balancer in front of a single proxy.

Kubernetes deployment

API key enforcement

By default, vLLM accepts any API key. To enforce a specific key:
Set this key as VLLM_API_KEY in your environment and configure the Cognisafe proxy to forward it:
Restrict network access to the vLLM service using a Kubernetes NetworkPolicy — only allow ingress from the Cognisafe proxy pod. This ensures all traffic goes through Cognisafe and cannot bypass it.

Air-gapped safety scoring

vLLM works well as a local scoring backend. Run a second vLLM instance with a safety-focused model:
Llama Guard 3 is the recommended open-source scoring model — it is specifically fine-tuned for safety classification across the MLCommons hazard taxonomy, which maps closely to OWASP LLM categories.