Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Guardrails ai Guardrails Dev Server Launch

From Leeroopedia
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:

  1. Config Loading: Parse config.py to discover Guard definitions
  2. Guard Registration: Register each Guard as an accessible endpoint
  3. REST API: Expose endpoints: /guards (list/create), /guards/{name} (read/update/delete), /guards/{name}/validate (execute)
  4. Request Handling: Each validate request triggers Guard.__call__ with the provided parameters

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment