How NeMo Guardrails connects to a vLLM server you run
NeMo Guardrails reaches a vLLM server you run through engine: openai with parameters.base_url pointing at the server's OpenAI-compatible API. Because vLLM exposes /v1/chat/completions and related endpoints, the built-in client in NeMo Guardrails can call it directly, with no LangChain dependency. The legacy engine: vllm_openai setting is only needed when the application runs under the LangChain framework, which is opt-in through the NEMOGUARDRAILS_LLM_FRAMEWORK=langchain environment variable. If your team is starting fresh, the openai engine is the path to plan around, and the configuration stays the same whether the vLLM server hosts your main application model or a safety model.
The same pattern covers safety models. NeMo Guardrails documents a Llama Guard integration in which the Llama Guard model is served with vLLM and configured as a model of type llama_guard, so input and output checks call a model you host rather than a cloud moderation service. Confirm the exact model entries against the Llama Guard integration guide for your NeMo Guardrails version, because the entry names and the rails that reference them are the parts most likely to change between releases. Plan the two model entries (application model and safety model) as separate endpoints with separate capacity, since a safety model that queues behind a busy generation server adds latency to every request.
DeployOpen plans and builds this integration inside your infrastructure: the vLLM serving layer, the NeMo Guardrails configuration folder, the model entries, and the network path between them. Ask your implementation partner to confirm which vLLM release you will run, since vLLM ships minor releases about every two weeks, and to test the configuration against that exact version. The point where most integrations fail is the authentication boundary, which the next section covers in detail.
What you need before configuring NeMo Guardrails with vLLM
Five prerequisites decide whether the guardrails host can reach a working model endpoint on the first attempt. Most setup failures trace back to one of them: the Python version, the vLLM server, network paths, accelerator capacity or licensing of the safety model.
NeMo Guardrails 0.25.0 and Python version
The current release is 0.25.0, published on 19 November 2026 under Apache-2.0. It requires Python 3.11, 3.12 or 3.13, so confirm the guardrails host or container image runs one of these versions before installing from PyPI. Pin the exact release in your build so the configuration you test is the one you deploy. Check the release notes for any change that affects your config.yml before you start.
A running vllm serve endpoint
Start the application model with vllm serve and record the exact model name it reports, because the model value in your guardrails configuration must match it. Confirm that the OpenAI-compatible chat completions route responds from a simple test request. Decide early whether the server runs with --api-key, since that choice changes the api_key setting you configure later. Confirm the vLLM version you run is compatible with the model architecture you chose.
Network path from the guardrails host
The guardrails host must reach the vLLM base URL over a route your security team has approved. Check DNS, firewall rules, and any service mesh or proxy between the two hosts. vLLM's security guidance recommends a reverse proxy that exposes only the endpoints meant for users, so confirm the path you expose includes the chat completions route and nothing administrative. Keep the vLLM server off public networks unless a reviewed design requires it.
Accelerator capacity for both models
Plan capacity for two workloads: the application model that answers users and the safety model that screens inputs and outputs, such as Llama Guard. Each runs on its own vLLM server or shares one, and each needs GPU or other accelerator memory sized for its weights and expected concurrency. vLLM supports NVIDIA CUDA, AMD ROCm and Intel XPU GPUs, so confirm your hardware is on that list. Ask your infrastructure team to size both before procurement, since guardrail checks add latency to every request.
Versions and licenses to confirm
Confirm that your vLLM version supports the model architecture you intend to serve, because support changes between releases and vLLM ships new minor versions about every two weeks. For Llama Guard, confirm that your organization has accepted the model's license terms on the model provider's site and that your use fits them. Record both the vLLM version and the model revision in your change records, so the guardrail test results can be tied to a known combination.
Llama Guard guideConfiguring the openai engine and base_url step by step
This sequence takes a team from a clean Python environment to a NeMo Guardrails configuration that sends chat requests to a self-hosted vLLM server, with a test request confirming each stage. It uses the built-in openai engine, so LangChain is not installed on this path.
Prepare a Python environment for NeMo Guardrails
The platform engineer creates an isolated virtual environment on Python 3.11, 3.12 or 3.13, which are the versions NeMo Guardrails 0.25.0 supports, and installs the nemoguardrails package from PyPI. Do not install LangChain or set NEMOGUARDRAILS_LLM_FRAMEWORK=langchain on this path, because the openai engine uses the built-in client. The step is done when the library imports cleanly in a Python shell and reports the expected version.
Start the vLLM server with your model
On the GPU host, the engineer runs vllm serve with the application model or the safety model, such as Llama Guard, and records the host, port and served model name. vLLM exposes OpenAI-compatible endpoints, so the server must be reachable from the machine that runs NeMo Guardrails. Confirm the model name in the server startup output, because the config must match it exactly. The step is done when the server log shows the model loaded and listening on its port.
Decide how the server handles authentication
The engineer checks whether the vLLM server was started with the --api-key option. If it was not, NeMo Guardrails still expects a non-empty api_key value, so a placeholder such as EMPTY is used. If the server does require a key, the team stores it in an environment variable and references it with api_key_env_var rather than writing it into config.yml. Confirm the choice with the team that operates the server, since vLLM documents that its own key protects only some endpoints. The step is done when the auth approach is written down for the config.
Create the model entry in config.yml
The engineer creates a configuration folder with a config.yml file that declares the main model with type main, engine openai, the served model name, and parameters.base_url pointing at the vLLM /v1 address. The api_key placeholder or environment variable reference goes under parameters. Optional Colang files and Python actions can sit in the same folder later. The step is done when the YAML parses and the model name matches the name shown by vLLM.
Load the configuration with the Python API
A developer loads the folder with the Python API, creating the rails object from the configuration path and sending a short test message through it. This confirms that NeMo Guardrails reads the config, resolves the openai engine and reaches the server without errors. Because the library deprecates LLMRails in favor of Guardrails as of 0.25.0, the team should use the class named in the current migration guide. The step is done when a response comes back from the model through the rails object.
Load the configuration with the guardrails server
For services that call over HTTP, the team starts the guardrails server against the folder that holds config.yml and keeps the server on an internal address. The server exposes an HTTP API, and the container image can be built from the provided Dockerfile. Check the server startup log for the loaded configuration and confirm that no engine errors are reported. The step is done when the server starts and reports the configuration as loaded.
Test the chat completions path
The engineer sends a chat request to the guardrails endpoint and, separately, a direct request to the vLLM /v1/chat/completions endpoint with the same model name. Comparing the two confirms that the failure, if any, lies in NeMo Guardrails configuration or in the server itself. A 200 response with a generated message from both paths closes this step. Keep these requests in a script so they can be rerun after every config change.
Record the working configuration
The team saves the final config.yml, the vLLM startup command and the test script in version control, with the placeholder or environment variable name documented but no secret values. Operators can then reproduce the setup when the model or the NeMo Guardrails version changes. The step is done when a second engineer can start the server and pass the same test from the repository alone.
How a request passes through guardrails to vLLM
The diagram starts with a client application sending a chat request to the NeMo Guardrails server inside the internal network. Input rails send the prompt to a Llama Guard model served by vLLM, using the openai engine and its base_url, and the verdict returns to the guardrails server. Only allowed prompts reach the application model on vLLM. Its reply then passes through output rails before the client receives it. Check that every hop stays inside the isolated network and that vLLM endpoints accept calls only from the guardrails server.
Requests and verdicts stay inside the internal network between Guardrails and vLLM.
Authentication choices and Llama Guard serving
Use this path when the vLLM server does not check any token, typically because it sits on a private network segment reachable only by the guardrails host. NeMo Guardrails still builds an OpenAI-style client, and that client expects an API key value to be present even when the server ignores it. Set parameters.api_key to a non-empty placeholder such as EMPTY. An empty value is the failure to avoid, because the client may stop before the request leaves the host.
- Placeholder, not a credential:
EMPTYis only a formality for the client library. It grants nothing and should never be mistaken for access control. - Network boundary: vLLM's security documentation says inter-node traffic is insecure by default, so the isolated network is the actual control. Confirm which hosts can reach the model port.
- Endpoint exposure: the
--api-keyoption is not set here, so confirm that/metrics,/healthand the control endpoints are not reachable from users or other networks. - Reverse proxy: vLLM recommends a proxy that allowlists only user-facing endpoints. Confirm whether one sits in front of the server.
- Audit question: ask the security team whether a placeholder key with a network-only boundary satisfies the access control evidence they need.
Before go-live, confirm the server's reachable address, the allowed source hosts and the exact endpoints exposed.
Use this path when the vLLM server is started with an API key, so every request to protected endpoints must carry a matching token. The NeMo Guardrails model entry then carries the real secret, either as parameters.api_key or, preferably, through an api_key_env_var that names an environment variable holding the value. Keeping the token out of config.yml lets the configuration be reviewed and versioned without exposing the secret.
- Environment variable: set
api_key_env_varto the name of a variable injected at runtime from your secrets store, so the value stays out of files and images. - Scope of protection: vLLM's
--api-keyoption does not cover/invocations,/pause,/resume,/abort_requests,/metricsor/health, so a token alone is not a full boundary. - Rotation: confirm who rotates the token, how often, and how the guardrails container picks up the new value without a rebuild.
- Logging: confirm that the token is not written to guardrail logs or traces, since those are often shared with other teams.
- Proxy layer: pair the token with a reverse proxy that allowlists user-facing endpoints.
Confirm the secret source, the rotation owner and that the variable name matches the deployed environment.
NeMo Guardrails' Llama Guard integration treats the safety classifier as its own model type, llama_guard, rather than as an ordinary chat model. The guide serves the Llama Guard model with vLLM and then declares it in the configuration under that type, so the guardrails rail knows to send classification prompts and read the safety verdict. The serving step and the configuration step are separate, and both must agree on the model name and endpoint.
- Model access: confirm your organization is permitted to download and use the Llama Guard weights under the terms that apply to them, and record the version you deploy.
- Serving: start the model with vLLM on a dedicated endpoint, separate from the application model where practical, so the safety path can be scaled and monitored on its own.
- Configuration: declare the entry with the
llama_guardtype and the endpoint details, then check that the rail is attached to the intended input or output flow. - Authentication consistency: apply the same token or placeholder decision to the safety endpoint as to the application endpoint, and document any difference.
- Verification: send known unsafe and benign test prompts and confirm the verdicts match the expected policy.
Before go-live, confirm the model version, the license record and the test results for both allowed and blocked prompts.
What changed from the legacy vllm_openai engine
The legacy vllm_openai engine was the route used under the LangChain framework, and it is not the path for the built-in client. For a vLLM server, configurations should now use engine: openai with parameters.base_url pointing at the vLLM endpoint. The built-in client handles the OpenAI-compatible calls directly, so no LangChain packages are needed. Set NEMOGUARDRAILS_LLM_FRAMEWORK=langchain only when your design genuinely depends on LangChain chains or tools, because that opt-in brings the LangChain dependency into the runtime. Keep the environment variable unset otherwise, and record the decision in the configuration review so auditors can see why the framework was chosen.
Review every existing config.yml that references vllm_openai, and check each one against the 0.22 migration guide and the 0.25 release notes. Confirm the engine name, the base_url value, and whether api_key is set as a non-empty placeholder for an unauthenticated server. Then test the change in a non-production environment with the same vLLM model version you will run in production. NVIDIA's NeMo Guardrails documentation is the reference for the current settings, so verify each key against it instead of copying older examples. Also confirm that your Python 3.11, 3.12 or 3.13 runtime matches the version 0.25.0 requires.
Plan for the API change in the 0.25.0 release. The LLMRails class is deprecated in favor of Guardrails, and removal is planned no earlier than 0.27.0. Find every call to LLMRails in your application code and any wrapper scripts, and move them to Guardrails using NVIDIA's 0.25 migration guide. Pin the NeMo Guardrails version in your build so the deprecation does not change behavior unexpectedly, and schedule a retest after each upgrade. Confirm with your own engineers which Colang version each configuration uses, because Colang 1.0 is the default and a Colang 2.x migration needs manual review of converted files.
Mapping config keys to vLLM server settings
This table pairs each NeMo Guardrails model setting with the vLLM server setting it must match, and names the endpoint each rail calls. Read each row from the config side first, then confirm the matching server value on the vLLM host. The main takeaway is that the model name, port and key must agree on both sides, and that the model name is set by your own deployment, so confirm it before you write the config.
| Config or server item | NeMo Guardrails config.yml | vLLM server side |
|---|---|---|
| Engine selection | engine: openai for the built-in client; engine: vllm_openai only under the LangChain framework | vLLM exposes an OpenAI-compatible API, so the standard openai engine path applies |
| Endpoint address | parameters.base_url set to the vLLM server address, including the port and the /v1 path | Port set when starting vllm serve; confirm the host and port your network exposes |
| Model name | model set to the name the application sends in requests | Served model name set at launch; confirm it matches the model field exactly in your deployment |
| Authentication | parameters.api_key set to a non-empty placeholder such as EMPTY when the server has no key | No --api-key option set on an unauthenticated server; if set, use its value here or in api_key_env_var |
| Secret placement | api_key_env_var names an environment variable that holds the key, keeping it out of config files | The same key value must be exported in the environment where the guardrails process runs |
| Llama Guard safety model | A model entry of type llama_guard pointing at the Llama Guard model served by vLLM | A separate vLLM server or served model name for Llama Guard; confirm the model is available in your deployment |
| Endpoint each rail calls | Chat-style rails use the chat completions path through the openai client | /v1/chat/completions and /v1/completions are served by the OpenAI-compatible server; confirm which your rails call |
| Access control scope | Guardrails process holds the key and calls the server directly | The --api-key option does not cover /metrics or /health; place a reverse proxy in front that allows only the user-facing endpoints |
Securing the vLLM endpoints behind guardrails
A vLLM server serves more than the chat routes NeMo Guardrails calls. The cards below cover the controls that keep the rest of the server closed, from the built-in API key option and a reverse proxy allowlist to node isolation, metrics protection and secret handling for the guardrails configuration.
Know what --api-key does not cover
The vLLM --api-key option protects the /v1, /v2, /inference and /cohere routes, but not /invocations, /pause, /resume, /abort_requests, /metrics or /health. Before you rely on it, list every route your server exposes and confirm which ones the key covers. Treat the key as one layer, not a complete access control, because the vLLM docs warn against relying on it alone.
Allowlist user-facing routes at a proxy
The vLLM docs recommend a reverse proxy that allowlists only the endpoints meant for users. For a guardrails setup, that usually means the chat and completion routes that NeMo Guardrails calls, and nothing else. Deny by default, so that a new endpoint added in a future vLLM release is blocked until someone reviews it. Test the proxy with requests to each control route to confirm they return errors to callers outside the platform team.
Isolate multi-node traffic
In a multi-node deployment, communication between nodes is insecure by default, with no authorization or encryption. The vLLM security docs say to protect it by placing the nodes on an isolated network. For a guardrails deployment, confirm that the node-to-node network is separate from the network where guardrails servers and applications connect, and that no user-facing route is reachable from it. Ask the team running the cluster to document the network design.
Protect the metrics endpoint
vLLM exposes Prometheus-format metrics at /metrics, covering request counts, token throughput, latency histograms and KV cache use. These figures show usage patterns and can reveal traffic volume and model load, so the endpoint should not be reachable by users. Scrape it only from the monitoring network, restrict it at the proxy, and confirm that your Prometheus configuration uses the access method your team has chosen.
Keep keys out of config files
NeMo Guardrails expects a non-empty value for parameters.api_key when the vLLM server does not enforce authentication, commonly a placeholder such as EMPTY. When the server does enforce a key, avoid writing the real token into config.yml, which is often committed to source control. Use an api_key_env_var entry on the model so the value is read from the environment at runtime, and inject it through your secrets tooling.
Review guardrails access to the server
The guardrails server or Python process is a client of vLLM, so its network path and credentials determine what it can reach. Confirm that the guardrails host can reach only the approved chat routes, that its vLLM key can be rotated without a code change, and that the same review covers the Llama Guard instance if it runs on vLLM too. Document these checks so they can be repeated after each vLLM upgrade, since new minor releases ship about every two weeks.
- Typical vLLM minor release cadence
- Two weeks
Failures when guardrails call vLLM and how to fix them
This table lists the failures teams most often hit when NeMo Guardrails calls a vLLM server, with the likely cause and the fix for each. Work down the rows in order, since a missing key or wrong base URL often produces errors that look like model problems.
| Failure | Likely cause | Fix |
|---|---|---|
| 401 or missing key error | The vLLM server runs with --api-key, or the model entry has no api_key, so the request is rejected. | Set the token or an api_key_env_var on the model entry. If the server does not enforce authentication, set parameters.api_key to a non-empty placeholder such as EMPTY. |
| Connection refused or 404 on requests | base_url is wrong, points at the wrong port, or omits the /v1 path that the OpenAI-compatible routes sit under. | Set parameters.base_url to the full address ending in /v1 and confirm the port with a direct request to the server from the guardrails host. |
| Model not found | The model name in the config does not match the name vLLM reports for the loaded model, often because of a path or alias used at launch. | Query the models list on the server and copy the exact served name into the model entry. |
| Llama Guard checks not running | The Llama Guard model is configured with the wrong type, or it is served as a general chat model rather than as the llama_guard type the integration expects. | Serve the Llama Guard model with vLLM and set its model type to llama_guard in the configuration, following the Llama Guard integration guide. |
| Engine not recognized or LangChain error | engine: vllm_openai was used without the LangChain opt-in, or the LangChain packages are missing from the runtime. | Use engine: openai with parameters.base_url for the built-in client. Use vllm_openai only under LangChain, after setting NEMOGUARDRAILS_LLM_FRAMEWORK=langchain and installing the packages. |
| Deprecation warnings after upgrading | The code still uses the LLMRails class or configuration patterns that changed in a newer release. | Move to the Guardrails class as described in the 0.25 migration guide, convert Colang 1.0 files where needed, and review the converted files manually. |
| Requests fail after a vLLM upgrade | A newer vLLM release changed defaults, endpoints or model support that the guardrails configuration relies on. | Pin the vLLM version in a test environment, rerun the rail checks against the new server, and confirm the endpoints in use still respond before promoting the upgrade. |
Questions teams ask before connecting NeMo Guardrails to vLLM
Does vLLM cost money to use?
vLLM has no paid edition. It is an open-source inference and serving engine licensed under Apache-2.0, so the software itself adds no license fee. The real cost comes from the accelerator capacity it runs on (GPUs or other accelerators), the surrounding infrastructure such as networking, storage, load balancing and monitoring, the implementation work to set it up, and the people who operate it over time. Ask any partner to separate one-time setup from recurring infrastructure and operations in the quote.
Is NeMo Guardrails free to use in production?
NeMo Guardrails is an open-source library licensed under Apache 2.0, so you can use, modify and deploy it without a license fee for the library itself. Your costs are the compute for the models it calls, the hosting it runs on and the people who configure and maintain it. Confirm with your legal team which license terms apply to any safety models or third-party components you add, because those can carry their own terms.
How long does it take to connect NeMo Guardrails to vLLM?
The duration depends mostly on how many models you serve and how many rails you need. A single application model behind one OpenAI-compatible endpoint is a much smaller job than an application model plus a separate Llama Guard server plus input, output and dialog rails that each need testing. Ask for a timeline built from a written scope, with separate milestones for model serving, configuration, testing and handover. Do not accept a duration that is not tied to that scope.
What does the scope of this work depend on?
Scope grows with two things: the number of models and the number of rails. Each vLLM model needs its own serving setup, endpoint, authentication and capacity planning. Each rail needs configuration, testing and a decision about where it runs. A Llama Guard model adds a second served model with its own resource needs. Agree the list of models, rails and environments in writing before work starts, because that list drives the effort.
What does our team need to provide for the work?
Expect to provide access to the accelerator hosts or cloud account where vLLM will run, the model files and the licenses that cover them, a network segment for the servers, and a named technical owner who can make decisions on configuration and security. You will also need someone who can review how guardrail decisions are logged and who approves changes. Confirm each of these items in the written scope so gaps are found before the build starts.
Can our own engineers set this up without a partner?
Yes, a capable platform team can do this in-house, because vLLM exposes OpenAI-compatible endpoints and NeMo Guardrails can call them with the built-in openai engine and a base URL. The harder parts are securing the endpoints, sizing accelerator capacity, validating safety model behavior and producing evidence for reviews. Be honest about whether your team has time and experience with those areas. A partner can take on part or all of that work under a fixed scope.
Is an unauthenticated vLLM server a security risk?
It can be. The vLLM security documentation says the --api-key option does not protect every endpoint, including /metrics, /health and /invocations, and recommends a reverse proxy that allowlists only the endpoints meant for users. Before connecting NeMo Guardrails, decide how the server is reached, which endpoints are exposed and how multi-node traffic is isolated, because the documentation says inter-node communication is insecure by default. Setting a placeholder API key in NeMo Guardrails does not secure the server itself.
Does any of this give us a compliance certification?
No. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments. What you can ask for is documented configuration, access control settings, audit logging and test results that your auditor can review.
How DeployOpen scopes and delivers this integration
DeployOpen plans and delivers the connection between NeMo Guardrails and your self-hosted vLLM servers inside your own infrastructure. Each engagement starts from a written, fixed scope that names the models, endpoints and rails involved before any configuration work begins.
How we scope
- Inventory which vLLM servers host the application model and any Llama Guard safety model, with their endpoints and authentication settings.
- Confirm whether each vLLM server enforces an API key, and which endpoints are reachable by users versus internal services only.
- Record the NeMo Guardrails version, Python runtime and whether the LangChain opt-in is needed, agreed in writing before work starts.
How we build
- Write the config.yml model entries using the openai engine and base_url for each vLLM server, with the placeholder API key or a secret reference as the design requires.
- Serve and configure Llama Guard on vLLM as a llama_guard model, then connect its input and output rails to the application configuration.
- Test each rail against your own sample prompts and responses, and check that blocked and allowed calls are logged as your reviewers expect.
How we hand over
- Deliver the configuration folder, Colang files, custom actions and deployment files, with a record of each setting and its reason.
- Document the vLLM network placement, reverse proxy allowlist and API key handling so your security team can review the setup.
- Provide a runbook covering version upgrades for NeMo Guardrails and vLLM, plus a retest checklist for each change.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the original build.
- Re-check the integration when NeMo Guardrails or vLLM releases change the engine settings or the server API.
- Confirm with your team which vLLM and NeMo Guardrails versions are in production before planning any upgrade window.

