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 API Server Installation

From Leeroopedia
Knowledge Sources
Domains Deployment, Installation
Last Updated 2026-02-14 00:00 GMT

Overview

An installation principle for adding server-mode capabilities to a Guardrails installation through optional dependency extras.

Description

API Server Installation extends the base Guardrails package with server capabilities by installing the guardrails-api optional extra. The base package provides the Guard class and validators for in-process use, while the [api] extra adds the HTTP server infrastructure (FastAPI/Flask application, REST endpoints, health checks) needed for deploying Guards as a standalone service.

This follows the optional extras pattern common in Python packaging, keeping the base package lightweight while supporting advanced deployment modes.

Usage

Install with pip install "guardrails-ai[api]" when you plan to deploy Guards as an HTTP service. Not needed for in-process validation.

Theoretical Basis

The optional extras pattern provides:

  1. Minimal base: Core Guard and Validator functionality without server dependencies
  2. Opt-in server: [api] extra adds guardrails-api which provides FastAPI/Flask server
  3. Auto-install fallback: The guardrails start CLI command auto-installs the API extra if missing

Related Pages

Implemented By

Page Connections

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