How an existing OpenAI SDK application reaches NeMo Guardrails without a rewrite
If an application already calls a model through the OpenAI Python SDK and needs guardrails in the path, the change is usually the base URL. The NeMo Guardrails server exposes an OpenAI-compatible REST API for chat completions and model listing, so a client built with OpenAI(base_url=") sends its requests to the guardrails server instead of directly to the model provider. The application keeps its message structures, its call patterns and its SDK version, while the server applies the rails defined in its configuration before and after the model call. The only client-side change to plan for is the endpoint, not the application logic.
For each request, the server loads the selected guardrail configuration, runs the input rails on the user's messages, forwards the permitted request to the underlying model, and then runs the output rails on the response before returning it to the caller. Configurations are selected per request with config_id, which lets one server host several configurations, for example one for a customer-facing assistant and another for an internal tool, with the calling application deciding which applies. Confirm in the server overview how config_id is passed through the SDK call and what happens when it is omitted or names an unknown configuration, because a silent fallback to a default configuration is a control gap you would need to test for.
Plan around the open-source guardrails server, which you run in infrastructure you control, as the integration target. NVIDIA has retired the NeMo Guardrails microservice, so new deployments should not be built against its container or its endpoints. Before you cut traffic over, confirm the server version you run against the release notes, since the request validation behavior has changed between releases and affects which payloads your existing clients can send.
What the team needs before pointing a client at the server
A client that already uses the OpenAI SDK can reach NeMo Guardrails with a base URL change, but the server still needs a Python runtime or container, model credentials and a clear network path. These cards cover what to confirm before the first request, and which pieces of the older microservice route should be left out of new work.
Python version for the library
The 0.25.0 release of NeMo Guardrails requires Python 3.11, 3.12 or 3.13. Confirm the interpreter on the host or build image before installing the nemoguardrails package from PyPI, and pin the version so a later upgrade is a deliberate change. If you run the server from a container, the same check applies to the base image you choose.
Dockerfile for a server image
The NeMo Guardrails project provides a Dockerfile that builds a server image from your configuration folder. Your team should decide whether it builds images in its own pipeline or pulls a tagged image from an internal registry, and who owns the base image patching. Plan the config.yml, Colang files and any Python actions as build inputs so each image is reproducible.
Release pinning and the 0.24.1 baseline
The release before 0.25.0 was 0.24.1. Clients that were tested against earlier behavior should be checked against the release you pin, because message validation became stricter from 0.24.0 onward. Record the exact version in your deployment manifest and read the release notes before moving to a newer one.
Release notesModel provider credentials
The configuration decides which model endpoints the server calls, so the server needs the credentials for each one, such as the provider API key the config.yml references. Store these in your secrets manager and inject them at runtime rather than baking them into images. Confirm which account pays for guardrail model calls, since self-check rails can make extra requests per message.
Network path from application to server
Each application must reach the guardrails server on the address you publish, usually a service name inside your cluster or a private host on your network. Confirm that the server can reach the model providers or self-hosted models in its configuration, and that egress rules allow it. Decide whether TLS terminates at a gateway or inside the server, because the base URL the SDK uses must match that choice.
OpenAI SDK version and payload shape
Since 0.24.0 the Chat Completions endpoint rejects unexpected fields, invalid role and content combinations, and unsupported audio requests before it loads a configuration. Inventory each client's OpenAI SDK version and the exact message fields it sends, then test them against a staging server. Failures here look like client errors, so give application teams the rejected-payload examples in advance.
Do not build on the NGC microservice
NVIDIA sunset the NeMo microservices as of October 1, 2026, with no new releases and no continued support for the NGC container. Do not use that container as the base for new work. Start from the open-source library or server, and ask NVIDIA or your account team about the status of any existing microservice deployment before you migrate it.
- Sunset date
- Oct 1, 2026
How a chat request travels from the application to the model
The request starts in an application that uses the standard OpenAI SDK, with only its base URL pointed at the guardrails server. The server checks the message payload first, so non-standard payloads are rejected before any configuration loads, then reads the config_id to select which configuration applies. Input rails run before the call to the model provider, and output rails run on the response before it returns. Check the trust boundary, because the request crosses from the application network into the server network and the model endpoint is reached from the server side.
Request path from an OpenAI SDK client through the guardrails server to the model.
How to switch an OpenAI SDK client to the guardrails server
This sequence puts the NeMo Guardrails server between an existing OpenAI SDK application and the model, so the application keeps its SDK calls and only its base URL and configuration selection change. Each step ends with a check you can run before moving on.
Install a release that includes the 0.24 validation changes
The platform engineer installs the nemoguardrails package in a Python environment that meets the library's Python requirement. The current release, 0.25.0, requires Python 3.11, 3.12 or 3.13. Pin the version explicitly so the server build and the client tests run against the same release, and do not rely on whatever version a container base image happens to include. The step is done when the installed version prints as 0.24.0 or later, which is the release that made the Chat Completions endpoint stricter about message validation. Confirm the version your team pins against the release notes before you start.
Create the configuration folder
The engineer creates one folder per guardrail configuration. Each folder holds a config.yml file that names the main model and the rails to apply, plus any Colang files and optional Python actions the rails need. Keep the folder under version control with the application code so that a change to a rail is reviewed like any other code change. The step is done when the folder loads without errors in a local check, such as starting the server against it and reading the startup log. If your team is starting from Colang 1.0 files written earlier, plan a review of the converted configuration, since NVIDIA says converted configurations still need manual review.
Start the server or build the container image
The platform engineer starts the guardrails server against the configuration folder, or builds the server image from the Dockerfile that the NeMo Guardrails project provides and runs it with the folder mounted or copied in. Model provider credentials go in environment variables or a secrets store, not in the configuration folder. The server listens on a host and port you choose. The step is done when the server log shows it has started and loaded the configuration without validation errors. Confirm the startup flags and the container build arguments in the server documentation for your version.
Point the client at the server base URL
The application team changes the base URL in the OpenAI SDK client so requests go to the guardrails server, including the /v1 path. In the Python SDK this is the base_url argument, for example OpenAI(base_url=") for a local test server. The API key value is passed through according to your server's authentication setup. No other application code needs to change for the first test. The step is done when the client can reach the server, which you confirm in the next step rather than assuming it from the code.
Select the configuration with config_id
The application team sets the configuration the request should use. The server exposes a config_id request field for this purpose, which tells it which folder of rails to apply to the call. Check the exact field name, where it sits in the request body or headers, and how the SDK passes it in the server documentation for your version before writing code, because the field name is the part most likely to differ between releases. The step is done when a request with the chosen config_id returns a response and the server log records that the expected configuration was applied.
Check that the model listing call works
The engineer runs a model listing call through the same OpenAI SDK client, using the new base URL. This confirms that the SDK can authenticate, reach the /v1 routes, and receive the OpenAI-compatible response shape from the server. A failure here usually points to a wrong base URL, a missing /v1 path or a server that is not listening on the address the client uses, so fix those before running chat tests. The step is done when the call returns the model list without errors.
Test a request that passes the rails
The application team sends a benign chat completion through the client with the selected config_id. The request should pass input rails, reach the model, and return through the output rails with a normal answer. Run a small set of representative prompts that your application really sends, not only a single greeting. The step is done when these requests return answers without unexpected blocks and the server log shows the rails ran. Record the results so a later configuration change can be compared against them.
Test a request that the rails block
The engineer sends prompts that a rail in the configuration should block, such as an off-topic request or a sample injection string, and confirms the server returns the blocked response defined in the configuration. The engineer also sends a payload that the 0.24 validation rejects, such as an unexpected field or an invalid role and content combination, to confirm the client gets a clear error instead of a model response. The step is done when both kinds of test produce the expected outcome. Keep these test cases in your repository so they run again after every upgrade.
Why payloads that worked before 0.24.0 can now fail
Since 0.24.0, the Chat Completions endpoint of the NeMo Guardrails server validates each message against its role before it loads a configuration. A request that an OpenAI SDK client sent successfully to the server on an earlier version can now return an error before any rail runs. The endpoint rejects internal event messages, unexpected fields, unsupported audio requests and invalid combinations of role and content. Changing only the base_url will not reveal these failures, because the request shape is what gets checked, not the destination.
The teams most exposed are those with wrapper code between their application and the SDK. Check for custom headers or metadata placed inside message objects, helper functions from older SDK versions that add fields to each message, and any code path that sends content in a shape the role does not allow. Also check for audio parts, since audio requests are unsupported and are rejected. Each of these is a plausible source of a rejected request, and none of them appears in the base URL change itself. Confirm the exact rejection messages in the NeMo Guardrails release notes for the version you plan to run.
Before cutover, capture a representative sample of production traffic, including the less common request types, and replay it against the target server version in a staging environment. Record every rejected request and group the failures by cause, then fix the client or wrapper rather than loosening the server. Repeat the replay after each change to the client code and after any SDK upgrade, since a helper update can reintroduce a field the server now refuses. Treat a clean replay as the acceptance criterion for the migration.
How OpenAI SDK fields map to guardrails server behavior
This table takes each setting an OpenAI SDK application already sends and shows what the guardrails server does with it, with config_id as the one added selector. Read the right-hand column as the list of points to confirm in the documentation for the exact release you deploy, since the release notes describe validation changes but not every field's handling.
| Client setting | What the server does | Confirm in the docs for your version |
|---|---|---|
| Base URL | Points the SDK at the guardrails server's OpenAI-compatible API, for example an address ending in /v1, so requests pass through the rails before reaching the model. | The exact base path the server exposes and whether it matches the path your SDK version appends. |
| API key | Sent by the SDK as a bearer credential. Whether the server checks it depends on how the server is deployed and secured. | Whether the server enforces authentication, and where any key or gateway check is configured. |
| Model name | Identifies the requested model in the request. The guardrails configuration determines which model actually answers the call. | How the model field interacts with the configuration loaded and whether it is passed through or ignored. |
| config_id (added selector) | The extra field that tells the server which guardrails configuration folder to load for this request. It is the main change a team makes beyond the base URL. | The exact field name, where it is placed in the request body, and how the server behaves when it is missing or unknown. |
| Messages with roles and content | Each message is checked against its role. Since 0.24.0 the Chat Completions endpoint rejects invalid role and content combinations before a configuration loads. | Which roles are accepted and which content shapes are valid for the version you run. |
| Internal event messages | Rejected by the Chat Completions endpoint since 0.24.0, so payloads must not carry internal guardrails event entries from the client. | Whether any internal message types your application builds are affected, and how to remove them. |
| Unexpected or extra fields | Rejected since 0.24.0, so custom metadata or vendor-specific keys added to the request body can cause errors. | Your full list of extra body fields, tested one at a time against the target release. |
| Audio requests | Unsupported audio requests are rejected since 0.24.0. | Whether any client path sends audio input or output parameters and must be removed or routed elsewhere. |
Choosing between the server, the Python API and a managed gateway
Running the guardrails server as its own process or container is the closest match to the base URL change described on this page. The application keeps its OpenAI SDK client and points it at the server, which loads configurations from a folder and exposes chat completions and model listing endpoints. You can start the server from a container built with the Dockerfile in the NeMo Guardrails repository, or from a Python environment on Python 3.11, 3.12 or 3.13.
- Code change: the application sets
base_urlto the server address, such as ` and selects a configuration in the request. - Configuration folder: each guardrail configuration sits in its own folder with a
config.ymlfile, optional Python actions and Colang files. - Ownership: the platform team operates the server, so application teams can ship without changing safety settings.
- Shared endpoint: several applications can point at one server, which concentrates logging and tuning in one place.
- Scaling: a single server process is one point to size and monitor, so plan replicas and health checks before production.
Check the server overview for the current startup options and configuration selection before you write client code.
The Python API fits teams that control the application code and want guardrails to run inside the same process as their logic. Calls go through the library directly, so there is no HTTP hop and no OpenAI-compatible endpoint to expose. The trade-off is that every service that needs guardrails must load the library, install its dependencies and manage its own configuration files.
- In-process calls: the application loads a configuration folder and passes messages to the rails, which keeps the guardrail step inside the application's own tracing and error handling.
- Dependency footprint: each service that imports the library carries its Python version and package requirements, and the current release requires Python 3.11, 3.12 or 3.13.
- Configuration distribution: every deployment must receive the same configuration files, so keep them in source control and version them with the application.
- Non-OpenAI clients: code that does not use the OpenAI SDK can call the API directly without adapting to the chat completions format.
- API changes: the 0.25.0 release deprecates the LLMRails class in favor of Guardrails, so review the migration guide before writing new code.
Confirm which classes your pinned version exposes and whether your OpenAI SDK clients need the server at all before you choose this path.
Some teams already run an API gateway or inference proxy that handles authentication, routing and logging for model traffic. Placing the guardrails server behind that layer keeps one entry point for applications, but it adds a second hop and a second set of forwarding rules. The answers depend on your gateway product, so confirm each point in that product's documentation before you route production traffic.
- Header forwarding: confirm that the gateway passes the
Authorizationheader and any custom headers your configuration selection depends on to the guardrails server unchanged. - Timeouts: guardrail checks can make model calls of their own, so compare the gateway's upstream and idle timeouts with the longest expected request, including streamed responses.
- Body size limits: confirm the maximum request body the gateway accepts, since long chat histories can exceed default limits.
- Retries: a gateway that retries failed upstream calls can resend a request that a rail already processed, so check whether retries apply to POST requests.
- Logging: make sure gateway logs do not duplicate or expose message content that the guardrail logs already capture.
Test each setting with a blocked request, a slow request and a streamed response before you rely on the path.
NVIDIA's NeMo Helix repository is a separate open source control plane licensed under Apache 2.0. Its documentation runs NeMo Guardrails as an inference gateway middleware plugin that applies guardrail configurations to model endpoints, which is a different architecture from the standalone server described on this page. Evaluate it as its own project in NVIDIA-NeMo/nemo-helix, and do not treat it as a replacement for the setup described here.
- Architecture: Helix places guardrail configuration in a control plane in front of model endpoints, so decide whether a gateway-level plugin matches your traffic model.
- Microservice status: NVIDIA's NeMo microservices container was sunset as of October 1, 2026, so existing deployments built on it need a migration decision.
- Maturity review: check the release history, supported deployment modes and the license of each component before adoption.
- Layer ownership: a Helix deployment and a standalone server could both sit in the request path, so map which layer owns each rail.
- Vendor contact: NVIDIA's archived documentation asks existing NeMo Microservices users to contact their account team, so raise your path with them early.
Run a proof of concept against your own endpoints before you decide whether a control plane belongs in your stack.
How to secure the guardrails server path
Once the guardrails server sits between your OpenAI SDK clients and the model, every request and every model credential passes through it. The six controls below cover who can reach the server, where keys live, how traffic is protected, what gets logged, how configurations change, and how strictly payloads are checked, with a verification step for each.
Authenticate access in front of the server
Confirm what the guardrails server enforces natively before you rely on it, and assume the gateway in front of it must supply client authentication. Any caller that can reach the port can send prompts that consume your model quota and reach your model provider. Verify this by sending a request without credentials from a host outside the allowed network and confirming it is refused at the gateway, not after the model call. Ask your platform team to document which identity each application uses and how keys are rotated.
Server overviewKeep provider keys in the server
Model provider API keys belong in the server environment, never in application code or client configuration. If an OpenAI SDK client holds the provider key, the guardrails layer is bypassed and the key is exposed to every developer and build artifact that ships the client. Verify by searching client repositories, container images and frontend bundles for provider key patterns, and by confirming the server reads its key from a secret store or the process environment.
Terminate TLS and restrict network paths
Prompts, completions and any credentials passed between the application and the server travel in plain text unless you terminate TLS. Place the server on a private network segment and allow inbound traffic only from the application workloads that need it. Verify with a network scan from an unapproved subnet and by checking that the server is not reachable on a public address. Confirm the certificate chain your SDK clients trust and who renews it.
Set log retention for prompts
Logging helps you debug blocked requests, but prompts and blocked content often contain personal data or sensitive business information. Decide which fields are logged, who can read them, and how long they are kept before the server goes live, and apply the same rules to traces and metrics exporters. Verify by sending a test prompt containing a marker string and confirming where it appears in logs, then checking that retention deletes it on schedule. Ask your compliance team to sign off on the retention period.
Review configurations as code
The config.yml file, Colang flows and any Python actions decide what the server allows and blocks, so a silent edit can weaken every application behind it. Store them in version control, require review before merge, and deploy only tagged versions. Verify by changing a rail in a test branch and confirming the change appears in a diff, requires approval, and that the deployed server reports which configuration version it loaded. Use config_id values that map to reviewed folders, not free-form paths.
Limit the blast radius of payloads
Since 0.24.0 the Chat Completions endpoint rejects internal event messages, unexpected fields and invalid role and content combinations before it loads a configuration. This narrows what a crafted payload can do, but any client that sends validated but unusual content still reaches your rails. Verify by sending malformed payloads from a test client and confirming each is rejected with a logged error, and by checking that a rejected request never triggers a model call. Plan the review of any SDK upgrade that changes accepted fields.
Release notesWhy calls fail after the base URL change
This table lists the failures teams most often hit when pointing OpenAI SDK clients at the guardrails server, with the likely cause, the check to run and the fix to confirm in the documentation. Work through the rows in order, because a model listing that succeeds rules out the base URL and points to the model provider or the configuration instead.
| Symptom | Likely cause and check | Fix to confirm |
|---|---|---|
| Requests rejected after upgrading to 0.24.0 or later | The Chat Completions endpoint now rejects unexpected fields, internal event messages and invalid role and content combinations before loading a configuration. Check the rejected payload for extra fields or non-standard message shapes. | Strip non-standard fields and send only standard role and content messages. Confirm the exact validation rules in the release notes. |
| Base URL missing the /v1 path | The client appends paths to the base URL, so a URL without /v1 sends requests to the wrong route. Check that the client is built with a base URL ending in /v1. | Set the base URL to the server address with /v1, as shown in the server overview, and confirm with a model listing call. |
| config_id not found | The server loads configurations from a folder, so the requested config_id must match a configuration directory the server was started with. Check the folder mounted into the server or container and the spelling of the ID. | Align the config_id with the folder name and confirm the folder path passed to the server in the documentation. |
| Python version mismatch on 0.25.0 | The 0.25.0 release requires Python 3.11, 3.12 or 3.13. Check the interpreter version in the image or virtual environment that runs the server. | Run the server on a supported Python version. Confirm the requirement in the README and PyPI metadata before upgrading. |
| Model listing works but chat completions fail | The server is reachable, but the model provider behind the configuration is unreachable or misconfigured, such as a wrong key, endpoint or network route. Check the server logs for upstream connection or authentication errors. | Correct the provider settings in the configuration and confirm connectivity from the server host or container to the provider. |
| Client timeouts on guardrailed requests | Rails can call additional models, such as safety or self-check models, before the main model responds, so total latency exceeds the client default. Check which rails the configuration enables and the time each model call takes. | Raise the client timeout to match the configuration, or reduce the number of model calls per request. Confirm latency options in the monitoring and performance documentation. |
What buyers ask before a team changes its OpenAI SDK clients
Is switching an OpenAI SDK client to the guardrails server only a base URL change?
For most applications, yes. The NeMo Guardrails server exposes an OpenAI-compatible REST API, so the client change is typically the base_url, for example OpenAI(base_url="). The catch is validation. Since 0.24.0, the Chat Completions endpoint checks role-specific messages and rejects internal event messages, unexpected fields, unsupported audio requests and invalid role and content combinations before it loads a configuration. Applications that send extra request fields, custom message types or audio will fail until their payloads are corrected. Your first task is to capture real request bodies from each application and confirm they pass validation.
What drives the effort and cost of moving OpenAI SDK clients?
The main drivers are the number of applications calling the model, the number of guardrail configurations you need (selected per request with config_id), the variety of payloads each application sends, and the depth of security review and testing required before go-live. Each application adds its own payload checks and client changes. Each configuration adds design, rail testing and documentation. Payload variety drives validation failures, which take the most investigation. Costs fall into two groups: internal staff time, and any partner fees in a fixed-scope engagement. Ask any partner for a quote that itemizes applications, configurations, test cycles and review work.
How long does it take to move OpenAI SDK clients to the guardrails server?
The duration depends on the factors your team controls: how many applications are in scope, how many of them send non-standard payloads, how many configurations you need, and how long your security review and approvals take. Organizations with a small number of applications that already send standard chat messages will generally finish faster than those with many services and custom payloads. Ask for a timeline that lists each phase, its owner and its dependencies, and check it against your change calendar and approval cycle. No single duration applies to every environment, so confirm the schedule against your own inventory.
What must the team provide before the OpenAI SDK migration starts?
Plan to provide five things before work begins:
- Application owners who can confirm what each client sends and approve changes to it.
- Sample traffic, meaning representative request bodies captured from each application, including edge cases.
- Provider keys for the upstream model services, stored in a secrets system you control.
- Network access between the applications, the guardrails server and the model endpoints, plus any safety model endpoints the configurations call.
- Approvals from security, compliance and change management for the new network path and the new configurations.
Missing sample traffic is the most common cause of delay, because validation problems only appear with real payloads.
Can an internal platform team move its OpenAI SDK clients without a partner?
Yes, if the team has the skills and time for the work. NeMo Guardrails is open source under Apache 2.0, so no license purchase is needed to run the server, and the library runs on Python 3.11, 3.12 or 3.13. The team needs to be comfortable with Python, container deployment, YAML configuration and, for some rails, Colang. It also needs a test plan that covers every application's payloads, because the validation rules reject requests that a looser gateway would have passed. Teams that have no one to own the configurations after go-live often choose a retainer for upgrades and continuous testing, which DeployOpen offers.
What does a fixed-scope engagement for this migration cover?
Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. For this migration, a written scope typically lists the applications in scope, a capture of their request payloads and validation results, the design of the configurations selected by config_id, deployment of the guardrails server in your infrastructure, client changes made with your teams, testing of the configurations and the server, and handover documentation. Security testing of the deployed endpoint can be added to the scope. The quote follows from that written scope, and DeployOpen does not publish a price list. Ask for the exclusions in writing as well.
Which NeMo Guardrails version should the server run for this migration?
Pin a version deliberately and test against it. The current release is 0.25.0, published on 19 November 2026 to PyPI under Apache-2.0, and the previous release is 0.24.1, published on 16 September 2026. The stricter message validation applies from 0.24.0 onward, so any application tested against an older server should be retested after the change. Version 0.25.0 also deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a 0.25 migration guide. Confirm the version and the upgrade plan with your team before the first production deployment, and read the release notes for each version you adopt.
Does the guardrails server need its own security review before clients use it?
Yes. Once the server sits between your applications and the model, it handles every prompt and response, holds or forwards provider credentials, and writes logs that may contain sensitive content. Review its network exposure, authentication in front of the endpoint, how provider keys are injected and stored, what is logged, and which configurations can be changed and by whom. The server's OpenAI-compatible interface means existing clients keep their request shape, but it does not remove the need to test the endpoint itself. Security testing and evidence preparation can be scoped alongside the migration so that the review is completed before go-live.
How DeployOpen scopes and delivers this integration
DeployOpen plans and delivers the guardrails server in front of your OpenAI SDK applications as a fixed-scope engagement, with the scope agreed in writing before work starts. The work runs inside your own infrastructure, from the server configuration and endpoint routing to the validation tests and the handover documentation.
How we scope
- We inventory which OpenAI SDK applications call the model and which base URLs, keys and request shapes each one sends.
- We agree in writing which config_id values, rails and model endpoints are in scope for each application.
- We confirm which payloads your clients send that the stricter message validation since 0.24 would reject.
How we build
- We deploy the NeMo Guardrails server in your environment and point each application's base URL at it.
- We design one configuration per use case and select it with config_id, keeping application code changes minimal.
- We test message validation with representative clients, including the non-standard payloads that need correcting before cutover.
How we hand over
- You receive the server configuration, base URL settings, config_id mapping and runbook for your own team.
- We document each rejected payload pattern found during testing, with the client change needed to fix it.
- We walk your engineers through the deployment, configuration changes and verification steps before handover closes.
How we support
- Ongoing support, version upgrades and continuous testing are available as a retainer after handover.
- We plan version upgrades around release notes, including validation changes that can affect existing clients.
- Retesting after each configuration or NeMo Guardrails release confirms that OpenAI SDK clients still behave as expected.

