Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
blank_issues_enabled: false
contact_links:
- name: Guardrails Documentation
url: https://www.guardrailsai.com/docs
url: https://www.guardrailsai.com/guardrails/docs
about: Check our documentation for answers to common questions and usage guides.
- name: Guardrails Hub
url: https://hub.guardrailsai.com/
url: https://guardrailsai.com/hub
about: Explore pre-built validators and guards for specific types of risks.
- name: GitHub Discussions
url: https://github.com/guardrails-ai/guardrails/discussions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export NLTK_DATA=/tmp/nltk_data;
rm -rf ./guardrails

# Navigate to notebooks
cd docs/src/examples
cd docs/examples

# Get the notebook name from the matrix variable
notebook="$1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/update_notebook_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ignore=(chatbot.ipynb translation_with_quality_check.ipynb guardrails_server.ipy
notebook_names="["

# Compile list of file names
for file in $(ls docs/src/examples/*.ipynb); do
for file in $(ls docs/examples/*.ipynb); do
# Add the full filename with extension
filename=$(basename "$file")
if ! [[ ${ignore[*]} =~ "$filename" ]]
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ docusaurus/static/docs
pyvenv.cfg
mlruns
mlartifacts
/.guardrails
/.guardrails
.claude
.idea
.pytest_cache
.ruff_cache
.vscode
20 changes: 2 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Follow these steps before committing your changes:
1. Ensure tests pass: `make test`
2. Format your code: `make autoformat`
3. Run static analysis: `make type`
4. Update documentation if needed. Docs are located in the `docs` directory. You can serve docs using `mkdocs serve`.
4. Update documentation: `make docs-gen`

### Optional: Pre-Commit Hooks

Expand All @@ -35,20 +35,4 @@ For convenience, consider [installing the pre-commit hooks](https://pre-commit.c
4. Engage in the code review process and make any necessary changes.
5. Celebrate when your pull request is merged! Your changes will be available in the next Guardrails release.

Thank you for your contribution and happy coding!

## Documentation

Docs are served via docusaurus. To serve docs locally, run the following

```bash
# install dependencies
pip install -e ".[dev]"

# install npm dependencies
npm i

# serve the docs
npm run start
```
then navigate to `localhost:3000` in your browser.
Thank you for your contribution and happy coding!
46 changes: 0 additions & 46 deletions DOCS.md

This file was deleted.

13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.PHONY: autoformat type lint test test-basic test-cov view-test-cov view-test-cov-file docs-serve docs-deploy dev full install docs-gen self-install all precommit refresh update-lock
MKDOCS_SERVE_ADDR ?= localhost:8000 # Default address for mkdocs serve, format: <host>:<port>, override with `make docs-serve MKDOCS_SERVE_ADDR=<host>:<port>`
.PHONY: autoformat type lint test test-basic test-cov view-test-cov view-test-cov-file dev full install docs-gen self-install all precommit refresh update-lock

autoformat:
ruff check guardrails/ tests/ --fix
Expand Down Expand Up @@ -30,12 +29,6 @@ view-test-cov:
view-test-cov-file:
pytest tests/unit_tests/test_logger.py --cov=./guardrails/ --cov-report html && open htmlcov/index.html

docs-serve:
poetry run mkdocs serve -a $(MKDOCS_SERVE_ADDR)

docs-deploy:
poetry run mkdocs gh-deploy

dev:
poetry install --extras "dev"
poetry run pre-commit install
Expand All @@ -48,13 +41,11 @@ install:

docs-gen:
poetry run python ./docs/pydocs/generate_pydocs.py
cp -r docs/src/* docs/dist
poetry run nbdoc_build --force_all True --srcdir ./docs/dist

self-install:
pip install -e .

all: autoformat type lint docs test
all: autoformat type lint docs-gen test

precommit:
# pytest -x -q --no-summary
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">

<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/dist/img/Guardrails-ai-logo-for-dark-bg.svg#gh-dark-mode-only" alt="Guardrails AI Logo" width="600px">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/dist/img/Guardrails-ai-logo-for-white-bg.svg#gh-light-mode-only" alt="Guardrails AI Logo" width="600px">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/assets/Guardrails-ai-logo-for-dark-bg.svg#gh-dark-mode-only" alt="Guardrails AI Logo" width="600px">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/assets/Guardrails-ai-logo-for-white-bg.svg#gh-light-mode-only" alt="Guardrails AI Logo" width="600px">

<hr>

Expand All @@ -13,7 +13,7 @@
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/guardrails_ai)](https://x.com/guardrails_ai)
[![Discord](https://img.shields.io/discord/1085077079697150023?logo=discord&label=support&link=https%3A%2F%2Fdiscord.gg%2Fgw4cR9QvYE)](https://discord.gg/U9RKkZSBgx)
[![Static Badge](https://img.shields.io/badge/Docs-blue?link=https%3A%2F%2Fwww.guardrailsai.com%2Fdocs)](https://www.guardrailsai.com/docs)
[![Static Badge](https://img.shields.io/badge/Docs-blue?link=https%3A%2F%2Fwww.guardrailsai.com%2Fdocs)](https://guardrailsai.com/guardrails/docs)
[![Static Badge](https://img.shields.io/badge/Blog-blue?link=https%3A%2F%2Fwww.guardrailsai.com%2Fblog)](https://www.guardrailsai.com/blog)
[![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20Guardrails%20Guru-006BFF)](https://gurubase.io/g/guardrails)

Expand All @@ -25,21 +25,21 @@
## What is Guardrails?

Guardrails is a Python framework that helps build reliable AI applications by performing two key functions:
1. Guardrails runs Input/Output Guards in your application that detect, quantify and mitigate the presence of specific types of risks. To look at the full suite of risks, check out [Guardrails Hub](https://hub.guardrailsai.com/).
1. Guardrails runs Input/Output Guards in your application that detect, quantify and mitigate the presence of specific types of risks. To look at the full suite of risks, check out [Guardrails Hub](https://guardrailsai.com/hub/).
2. Guardrails help you generate structured data from LLMs.


<div align="center">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/dist/img/with_and_without_guardrails.svg" alt="Guardrails in your application" width="1500px">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/assets/with_and_without_guardrails.svg" alt="Guardrails in your application" width="1500px">
</div>


### Guardrails Hub

Guardrails Hub is a collection of pre-built measures of specific types of risks (called 'validators'). Multiple validators can be combined together into Input and Output Guards that intercept the inputs and outputs of LLMs. Visit [Guardrails Hub](https://hub.guardrailsai.com/) to see the full list of validators and their documentation.
Guardrails Hub is a collection of pre-built measures of specific types of risks (called 'validators'). Multiple validators can be combined together into Input and Output Guards that intercept the inputs and outputs of LLMs. Visit [Guardrails Hub](https://guardrailsai.com/hub/) to see the full list of validators and their documentation.

<div align="center">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/dist/img/guardrails_hub.gif" alt="Guardrails Hub gif" width="600px">
<img src="https://raw.githubusercontent.com/guardrails-ai/guardrails/main/docs/assets/guardrails_hub.gif" alt="Guardrails Hub gif" width="600px">
</div>


Expand Down Expand Up @@ -214,11 +214,11 @@ You can reach out to us on [Discord](https://discord.gg/gw4cR9QvYE) or [Twitter]

#### Can I use Guardrails with any LLM?

Yes, Guardrails can be used with proprietary and open-source LLMs. Check out this guide on [how to use Guardrails with any LLM](https://www.guardrailsai.com/docs/how_to_guides/llm_api_wrappers).
Yes, Guardrails can be used with proprietary and open-source LLMs. Check out this guide on [how to use Guardrails with any LLM](https://guardrailsai.com/guardrails/docs/how-to-guides/using_llms).

#### Can I create my own validators?

Yes, you can create your own validators and contribute them to Guardrails Hub. Check out this guide on [how to create your own validators](https://www.guardrailsai.com/docs/hub/how_to_guides/custom_validator).
Yes, you can create your own validators and contribute them to Guardrails Hub. Check out this guide on [how to create your own validators](https://guardrailsai.com/guardrails/docs/hub/how_to_guides/custom_validator).

#### Does Guardrails support other languages?

Expand Down
23 changes: 0 additions & 23 deletions docs-graveyard/cli.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs-graveyard/concepts/prompts_instructions.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs-graveyard/concepts/reasking.md

This file was deleted.

Loading
Loading