Command
Options
integer
default:"8000"
The port that the server should listen on.
path
Path to a directory containing multiple configuration sub-folders (multi-config mode) or a single configuration directory (single-config mode).If not specified, looks for a
config folder in the current directory.string
The default configuration ID to use when no config is specified in requests.
boolean
default:"false"
If the server should be verbose and output detailed logs including prompts.
boolean
default:"false"
Whether the Chat UI should be disabled. When enabled (default), the UI is accessible at
http://localhost:<port>/.boolean
default:"false"
Enable automatic reloading when configuration files change. Requires the
watchdog package.string
default:""
A prefix that should be added to all server paths. Must start with ’/’. Useful for deploying behind a reverse proxy.
Examples
Basic Usage
Start server with default settings:config directory in the current folder.
Specify Config Directory
Start server with a specific config directory:Multi-Config Mode
Serve multiple guardrails configurations:Single-Config Mode
Serve a single configuration:Custom Port
Start server on a different port:Verbose Mode
Enable detailed logging:Auto-Reload
Automatically reload configs when files change:watchdog:
Disable Chat UI
Disable the built-in web interface:With Path Prefix
Deploy behind a reverse proxy with a path prefix:http://localhost:8000/api/guardrails/v1/chat/completionshttp://localhost:8000/api/guardrails/v1/rails/configs
Set Default Config
Set a default configuration for requests that don’t specify one:Environment Variables
The server respects several environment variables:CORS Configuration
Model Provider
Default Config
Testing the Server
Check Server Status
List Available Configs
List Available Models
Test Chat Completion
Using with OpenAI SDK
Production Deployment
Using Gunicorn
Using Docker
Dockerfile
Using Docker Compose
docker-compose.yml
Troubleshooting
Server Won’t Start
Check if port is already in use:Config Not Found
Verify config path:config.yml or config.yaml file.