vLLM
vLLM is a high-throughput inference server for open-weight models (Qwen, Llama, Mistral, DeepSeek, Gemma and more). It serves an OpenAI-compatible API, so Hrida.ai connects to it like any other OpenAI-compatible provider: a URL and an API key.
docs.vllm.ai · OpenAI-Compatible Guide · Network Diagrams
Before You Start
- A supported GPU. vLLM is built for NVIDIA GPUs (and AMD ROCm, Intel and TPU builds). CPU-only builds exist but are much slower. See the vLLM installation guide.
- Enough GPU memory for the model. As a rough guide, a 7–8B model needs about 16 GB in 16-bit weights, less with a quantized checkpoint (AWQ, GPTQ, FP8).
- A Hugging Face token if the model is gated (for example Llama). Pass it as
HF_TOKEN.
1 Start vLLM
Docker (recommended)
docker run -d --name vllm --gpus all --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e HF_TOKEN=<your-hf-token> \
vllm/vllm-openai:latest \
--model Qwen/Qwen2.5-7B-Instruct \
--served-model-name qwen2.5-7b \
--api-key <choose-a-key>pip
pip install vllm
vllm serve Qwen/Qwen2.5-7B-Instruct \
--host 0.0.0.0 --port 8000 \
--served-model-name qwen2.5-7b \
--api-key <choose-a-key>The first start downloads the weights, which can take a while. vLLM is ready when its log shows the server listening on port 8000. Check it with:
curl -H "Authorization: Bearer <choose-a-key>" http://localhost:8000/v1/models2 Add the Connection in Hrida.ai
- Go to ⚙️ Admin Settings → Connections → OpenAI.
- Click ➕ Add Connection.
- Enter the URL and key, then click Save.
| Setting | Value |
|---|---|
| URL | http://<vllm-host>:8000/v1, see the table below |
| API Key | The value you passed to --api-key (any text if you didn't set one) |
| Model IDs | Auto-detected from /v1/models: the --served-model-name you chose |
Which host to use depends on where the two run:
| Your setup | URL |
|---|---|
| Both in the same Docker Compose stack | http://vllm:8000/v1 |
| vLLM on the host, Hrida.ai in Docker | http://host.docker.internal:8000/v1 |
| Both on the same machine, no Docker | http://localhost:8000/v1 |
| vLLM on a separate GPU server | http://<gpu-server>:8000/v1 |
On Linux, host.docker.internal only resolves if the Hrida.ai container is started with --add-host=host.docker.internal:host-gateway. See Network Diagrams for each layout.
For Docker deployments you can skip the UI step:
OPENAI_API_BASE_URL=http://vllm:8000/v1
OPENAI_API_KEY=<choose-a-key>
ENABLE_OLLAMA_API=False # no Ollama server to look forTo add vLLM next to another provider, use the plural forms with ; separators: OPENAI_API_BASE_URLS and OPENAI_API_KEYS.
3 Start Chatting
Select the model in the chat model selector. Streaming works out of the box.
Docker Compose Example
Hrida.ai and vLLM in one stack:
services:
vllm:
image: vllm/vllm-openai:latest
container_name: vllm
command: >
--model Qwen/Qwen2.5-7B-Instruct
--served-model-name qwen2.5-7b
--api-key ${VLLM_API_KEY}
--max-model-len 32768
--enable-auto-tool-choice --tool-call-parser hermes
environment:
- HF_TOKEN=${HF_TOKEN}
volumes:
- huggingface:/root/.cache/huggingface
ipc: host
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
hrida-ai:
image: ghcr.io/hrida-ai/hrida-ai-studio:main
container_name: hrida-ai
ports:
- "3000:8080"
environment:
- OPENAI_API_BASE_URL=http://vllm:8000/v1
- OPENAI_API_KEY=${VLLM_API_KEY}
- ENABLE_OLLAMA_API=False
volumes:
- hrida-ai:/app/backend/data
depends_on:
- vllm
restart: unless-stopped
volumes:
huggingface:
hrida-ai:vLLM Options That Matter for Hrida.ai
| Option | Why it matters |
|---|---|
--served-model-name | The model ID users see in Hrida.ai. Without it, the full Hugging Face path is shown. |
--max-model-len | The context window. It defaults to the model's maximum. Lower it if the model doesn't fit in GPU memory, but keep it large enough for RAG and web search (16k or more). |
--enable-auto-tool-choice --tool-call-parser <name> | Needed for native function calling (tools, web search, terminals, agents). Pick the parser for the model family: hermes for Qwen 2.5, llama3_json for Llama 3.x, mistral for Mistral. |
--reasoning-parser <name> | Splits the model's thinking from its answer, so Hrida.ai shows it as a collapsible reasoning block. For example deepseek_r1 or qwen3. See Reasoning Models. |
--gpu-memory-utilization | Share of GPU memory vLLM may use (default 0.9). Lower it if other processes share the GPU. |
--tensor-parallel-size <n> | Splits one model across n GPUs for models that don't fit on one. |
--api-key | Requires a Bearer key on every request. Always set it when the port is reachable from other machines. |
The exact parser names depend on your vLLM version. Run vllm serve --help to list them.
More Than One Model
One vLLM server serves one model. To offer several, run one server per model on its own port (or GPU), and add each one as its own connection in Admin Settings → Connections → OpenAI. They all appear together in the model selector.
Embeddings for RAG
vLLM can also serve an embedding model, so documents and knowledge bases are embedded on your own hardware. Run a second vLLM server with an embedding model in pooling mode (--runner pooling in current releases; older releases used --task embed):
vllm serve BAAI/bge-m3 --runner pooling --port 8001 --api-key <choose-a-key>Then point Hrida.ai's embedding engine at it, in Admin Settings → Documents or with:
RAG_EMBEDDING_ENGINE=openai
RAG_OPENAI_API_BASE_URL=http://vllm-embed:8001/v1
RAG_OPENAI_API_KEY=<choose-a-key>
RAG_EMBEDDING_MODEL=BAAI/bge-m3Troubleshooting
- Connection verify fails, or no models appear. Check the URL ends in
/v1and the key matches--api-key. From inside the Hrida.ai container, runcurl http://vllm:8000/v1/models(with your host name) to test the network path. - The model never calls tools. Start vLLM with
--enable-auto-tool-choiceand the right--tool-call-parser, and turn on Native Function Calling for the model in Workspace → Models. - Answers stop early or retrieved documents are ignored.
--max-model-lenis too small for the prompt. Raise it, or lower the RAG Top K setting. - CUDA out of memory at start. Lower
--max-model-lenor--gpu-memory-utilization, use a quantized checkpoint, or add GPUs with--tensor-parallel-size.
For network problems between containers, see Connection Errors.