Guardrails is a Python package that lets a user add structure, type and quality guarantees to the outputs of large language models (LLMs). At the heart of Guardrails is the rail spec. rail is intended to be a language-agnostic, human-readable format for specifying structure and type information, validators and corrective actions over LLM outputs. We create a RAIL spec to describe the expected structure and types of the LLM output, the quality criteria for the output to be considered valid, and corrective actions to be taken if the output is invalid.

Features

  • Does pydantic-style validation of LLM outputs
  • Semantic validation such as checking for bias in generated text, checking for bugs in generated code, etc.
  • Takes corrective actions (e.g. reasking LLM) when validation fails
  • Enforces structure and type guarantees (e.g. JSON)
  • Guardrails provides a format (.rail) for enforcing a specification on an LLM output
  • Lightweight wrapper around LLM API calls to implement this spec

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Guardrails

Guardrails Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Guardrails!

Additional Project Details

Programming Language

Python

Related Categories

Python Large Language Models (LLM)

Registered

2023-08-21