Principle:Guardrails ai Guardrails Dev Server Launch
| Knowledge Sources | |
|---|---|
| Domains | Deployment, Server |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
A server launch principle for starting a local Guardrails API server that exposes Guards as REST endpoints for development and testing.
Description
Dev Server Launch starts a local HTTP server that loads Guard configurations from a config file and exposes them as REST API endpoints. The server provides endpoints for creating, reading, updating, deleting, and executing Guards. It auto-installs the guardrails-api package if not present and delegates to the API package's start function.
This enables a development workflow where Guards are tested locally via REST before being deployed to production infrastructure.
Usage
Use guardrails start --config config.py to launch the development server. The server runs on port 8000 by default and provides REST endpoints for Guard operations.
Theoretical Basis
The server architecture:
- Config Loading: Parse config.py to discover Guard definitions
- Guard Registration: Register each Guard as an accessible endpoint
- REST API: Expose endpoints: /guards (list/create), /guards/{name} (read/update/delete), /guards/{name}/validate (execute)
- Request Handling: Each validate request triggers Guard.__call__ with the provided parameters