Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

[Feat]: Add Integration for Guardrails (#387)

patcher92800120df651
diff --git a/docs/images/docs-guardrails-banner.gif b/docs/images/docs-guardrails-banner.gif
new file mode 100644
index 00000000..347ce74e
Binary files /dev/null and b/docs/images/docs-guardrails-banner.gif differ
diff --git a/docs/latest/integrations/guardrails.mdx b/docs/latest/integrations/guardrails.mdx
new file mode 100644
index 00000000..82bd768a
--- /dev/null
+++ b/docs/latest/integrations/guardrails.mdx
@@ -0,0 +1,75 @@
+---
+title: 'Monitor Guardrails using OpenTelemetry'
+sidebarTitle: 'Guardrails'
+---
+
+<Frame>
+ <img src="/images/docs-guardrails-banner.gif" />
+</Frame>
+
+OpenLIT uses OpenTelemetry Auto-Instrumentation to help you monitor LLM applications built using Guardrails. This includes tracking performance and operation stats.
+
+Auto-instrumentation means you don't have to set up monitoring manually for different LLMs, frameworks, or databases. By simply adding OpenLIT in your application, all the necessary monitoring configurations are automatically set up.
+
+## Get Started
+
+<Steps>
+ <Step title="Install OpenLIT">
+ Open your command line or terminal and run:
+ ```shell
+ pip install openlit
+ ```
+ </Step>
+ <Step title="Initialize OpenLIT in your Application">
+ You can set up OpenLIT in your application using either function arguments directly in your code or by using environment variables.
+ <Tabs>
+ <Tab title="Setup using function arguments">
+
+ Add the following two lines to your application code:
+
+ ```python
+ import openlit
+
+ openlit.init(
+ otlp_endpoint="YOUR_OTEL_ENDPOINT",
+ )
+ ```
+
+ Replace:
+ 1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector.
+ </Tab>
+ <Tab title="Setup using Environment Variables">
+
+ Add the following two lines to your application code:
+
+ ```python
+ import openlit
+
+ openlit.init()
+ ```
+
+ Then, configure the your OTLP endpoint using environment variable:
+ ```shell
+ export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
+ ```
+
+ Replace:
+ 1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector.
+ </Tab>
+ </Tabs>
+ To send metrics and traces to other Observability tools, refer to the [Connections Guide](/latest/connections/intro).
+
+ For more advanced configurations and application use cases, visit the [OpenLIT Python repository](https://github.com/openlit/openlit/tree/main/sdk/python).
+ </Step>
+</Steps>
+
+---
+
+<CardGroup cols={2}>
+<Card title="Connections" href="/latest/connections/intro" icon='link'>
+Connect to your existing Observablity Stack
+</Card>
+<Card title="SDK configuration" href="/latest/sdk-configuration" icon='file-code'>
+Documentation of the configuration options for the OpenLIT SDK.
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/latest/integrations/introduction.mdx b/docs/latest/integrations/introduction.mdx
index d908f0fd..6fcfc575 100644
--- a/docs/latest/integrations/introduction.mdx
+++ b/docs/latest/integrations/introduction.mdx
@@ -869,6 +869,18 @@ Start integrating and monitoring your applications with OpenLIT effortlessly. Ch
}
>
</Card>
+ <Card
+ title="Guardrails AI"
+ href="/latest/integrations/guardrails"
+ iconType="duotone"
+ icon={
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 292 292">
+ <path d="M0 0 C0.75357788 -0.00570007 1.50715576 -0.01140015 2.28356934 -0.01727295 C3.87360251 -0.0266705 5.46365471 -0.03323591 7.05371094 -0.03710938 C9.43461104 -0.04673695 11.81461714 -0.07777722 14.1953125 -0.109375 C24.1960901 -0.17791624 33.23914696 0.85647022 42.96875 3.203125 C44.07831055 3.44667725 45.18787109 3.69022949 46.33105469 3.94116211 C53.37127311 5.49408144 59.52658816 8.0109142 65.96875 11.203125 C67.26651667 11.82247528 68.56472245 12.44090601 69.86328125 13.05859375 C76.91734925 16.4545963 83.56097958 19.95326471 89.85546875 24.66015625 C92.00223448 26.2794379 92.00223448 26.2794379 94.58203125 27.75 C97.50629658 29.53040377 99.58218693 31.75689785 101.96875 34.203125 C103.3609375 35.2859375 103.3609375 35.2859375 104.78125 36.390625 C105.503125 36.98875 106.225 37.586875 106.96875 38.203125 C106.96875 38.863125 106.96875 39.523125 106.96875 40.203125 C107.56558594 40.45191406 108.16242188 40.70070312 108.77734375 40.95703125 C111.29090525 42.38631132 112.38465812 43.78270543 114.03125 46.140625 C116.04871673 49.01133363 116.04871673 49.01133363 118.39453125 51.60546875 C139.43175902 72.95590587 148.15714846 106.87576579 148.15405273 135.78369141 C148.15623802 138.06561989 148.17443821 140.34706299 148.19335938 142.62890625 C148.22371611 150.3706121 147.90510361 157.66723174 145.96875 165.203125 C145.66645598 166.61501023 145.36817894 168.02776239 145.07421875 169.44140625 C141.63644335 184.96853568 135.60174764 198.31738855 127.96875 212.203125 C127.30875 212.203125 126.64875 212.203125 125.96875 212.203125 C125.73542969 212.89792969 125.50210938 213.59273437 125.26171875 214.30859375 C123.71665509 217.76748248 121.61670826 220.56730983 119.28125 223.515625 C118.83064209 224.08958008 118.38003418 224.66353516 117.91577148 225.25488281 C116.60804683 226.91082093 115.2899379 228.55792152 113.96875 230.203125 C113.36546875 230.96496094 112.7621875 231.72679687 112.140625 232.51171875 C107.41625374 238.21077826 101.77446821 242.64962052 95.96875 247.203125 C95.11023438 247.904375 94.25171875 248.605625 93.3671875 249.328125 C92.57570312 249.9675 91.78421875 250.606875 90.96875 251.265625 C90.2675 251.83410156 89.56625 252.40257812 88.84375 252.98828125 C86.96875 254.203125 86.96875 254.203125 83.96875 254.203125 C83.96875 254.863125 83.96875 255.523125 83.96875 256.203125 C61.1605653 269.06947626 38.73417773 276.39124911 12.38818359 276.38842773 C10.10625511 276.39061302 7.82481201 276.40881321 5.54296875 276.42773438 C-2.1987371 276.45809111 -9.49535674 276.13947861 -17.03125 274.203125 C-18.44313523 273.90083098 -19.85588739 273.60255394 -21.26953125 273.30859375 C-34.23500241 270.44007128 -45.65627368 266.12013651 -57.34375 259.765625 C-58.59828979 259.08391235 -58.59828979 259.08391235 -59.87817383 258.38842773 C-66.89402533 254.47460032 -73.24383339 249.95427598 -79.21875 244.578125 C-81.44815918 242.58616769 -83.65909557 240.7191607 -86.03125 238.890625 C-86.69125 238.33375 -87.35125 237.776875 -88.03125 237.203125 C-88.03125 236.543125 -88.03125 235.883125 -88.03125 235.203125 C-89.02125 234.873125 -90.01125 234.543125 -91.03125 234.203125 C-92.53125 232.4609375 -92.53125 232.4609375 -94.03125 230.328125 C-96.07018895 227.43929328 -96.07018895 227.43929328 -98.4296875 224.8203125 C-108.02457682 215.13181451 -113.63012927 202.49953477 -119.03125 190.203125 C-119.48588623 189.22255127 -119.48588623 189.22255127 -119.94970703 188.22216797 C-121.46815248 184.88620278 -122.03125 182.95640431 -122.03125 179.203125 C-112.13125 179.203125 -102.23125 179.203125 -92.03125 179.203125 C-89.370625 183.9984375 -89.370625 183.9984375 -86.65625 188.890625 C-86.10018066 189.88924561 -85.54411133 190.88786621 -84.97119141 191.91674805 C-84.30869385 193.11618042 -84.30869385 193.11618042 -83.6328125 194.33984375 C-83.18244629 195.15155029 -82.73208008 195.96325684 -82.26806641 196.79956055 C-81.03125 199.203125 -81.03125 199.203125 -80.05615234 201.94458008 C-79.71793457 202.6898999 -79.3797168 203.43521973 -79.03125 204.203125 C-78.04125 204.533125 -77.05125 204.863125 -76.03125 205.203125 C-74.51318617 206.92302878 -73.06282131 208.70340428 -71.65625 210.515625 C-69.31524855 213.5283571 -67.2270928 216.04650562 -64.2421875 218.43359375 C-63.51257813 219.01753906 -62.78296875 219.60148438 -62.03125 220.203125 C-62.03125 220.863125 -62.03125 221.523125 -62.03125 222.203125 C-61.226875 222.47125 -60.4225 222.739375 -59.59375 223.015625 C-58.748125 223.4075 -57.9025 223.799375 -57.03125 224.203125 C-56.70125 225.193125 -56.37125 226.183125 -56.03125 227.203125 C-55.20625 227.47125 -54.38125 227.739375 -53.53125 228.015625 C-50.39307114 229.08036426 -48.81415512 229.98564804 -46.21875 231.890625 C-24.19662166 247.00312582 6.1123606 250.28973373 31.87402344 245.6484375 C48.6314379 242.08602212 64.41275655 234.61613334 77.7109375 223.890625 C79.96875 222.203125 79.96875 222.203125 81.96875 222.203125 C82.29875 221.213125 82.62875 220.223125 82.96875 219.203125 C84.52734375 217.703125 84.52734375 217.703125 86.40625 216.203125 C88.85649632 214.23883568 90.18255578 212.88241632 91.96875 210.203125 C92.62875 210.203125 93.28875 210.203125 93.96875 210.203125 C94.23429688 209.45675781 94.49984375 208.71039063 94.7734375 207.94140625 C95.95282299 205.23961139 97.1665743 203.59119074 99.09375 201.390625 C116.62930496 179.29801313 121.33281482 149.5536928 118.28125 122.203125 C115.7504495 102.89929104 107.3127625 85.23420282 95.26953125 70.0625 C93.96875 68.203125 93.96875 68.203125 93.96875 66.203125 C92.97875 65.873125 91.98875 65.543125 90.96875 65.203125 C89.6796875 63.8203125 89.6796875 63.8203125 88.34375 62.078125 C85.24454076 58.28237631 81.68761554 55.53999668 77.7265625 52.68359375 C77.14648438 52.19503906 76.56640625 51.70648438 75.96875 51.203125 C75.96875 50.543125 75.96875 49.883125 75.96875 49.203125 C75.2778125 48.95175781 74.586875 48.70039062 73.875 48.44140625 C70.54267078 47.02158318 67.57497655 45.25364849 64.46875 43.390625 C39.85350674 29.06785271 9.69732356 25.25894887 -17.8828125 32.16796875 C-30.92982109 35.80540343 -42.66357107 41.92781048 -54.03125 49.203125 C-54.69125 49.203125 -55.35125 49.203125 -56.03125 49.203125 C-56.03125 49.863125 -56.03125 50.523125 -56.03125 51.203125 C-56.815 51.450625 -57.59875 51.698125 -58.40625 51.953125 C-61.52314346 53.43735998 -61.55380446 54.23724919 -63.03125 57.203125 C-64.65234375 58.765625 -64.65234375 58.765625 -66.46875 60.203125 C-69.09322006 62.3484387 -71.02683324 64.46023891 -73.03125 67.203125 C-73.69125 67.203125 -74.35125 67.203125 -75.03125 67.203125 C-75.69125 68.853125 -76.35125 70.503125 -77.03125 72.203125 C-77.69125 72.203125 -78.35125 72.203125 -79.03125 72.203125 C-79.258125 73.028125 -79.485 73.853125 -79.71875 74.703125 C-81.04055189 78.22793004 -82.69176076 80.97679691 -84.7265625 84.11328125 C-87.31401385 88.25785152 -89.48637553 92.56850159 -91.03125 97.203125 C-101.26125 97.203125 -111.49125 97.203125 -122.03125 97.203125 C-118.41944109 79.14408045 -107.41080096 58.85945699 -94.03125 46.203125 C-93.433125 45.419375 -92.835 44.635625 -92.21875 43.828125 C-89.75846301 40.87578061 -87.07143005 38.49963332 -84.1484375 36.015625 C-82.81739274 34.87613281 -81.50639439 33.71235093 -80.2265625 32.515625 C-59.40419923 13.21248995 -28.31767999 0.17088116 0 0 Z " fill="#0BD797" transform="translate(128.03125,-0.203125)"/>
+ <path d="M0 0 C7.55734359 5.92121766 13.49944608 14.05807395 18.6875 22.0625 C18.6875 22.7225 18.6875 23.3825 18.6875 24.0625 C13.5463937 24.18666286 8.40617154 24.27710196 3.26391602 24.3371582 C1.51701645 24.36220857 -0.22977928 24.39625917 -1.97631836 24.43969727 C-4.49619232 24.50077206 -7.01467382 24.52880335 -9.53515625 24.55078125 C-10.30835709 24.57658768 -11.08155792 24.6023941 -11.87818909 24.62898254 C-17.83402592 24.63202109 -20.83442656 22.99901141 -25.3125 19.0625 C-25.3125 18.4025 -25.3125 17.7425 -25.3125 17.0625 C-26.3334375 16.9078125 -26.3334375 16.9078125 -27.375 16.75 C-30.3125 16.0625 -30.3125 16.0625 -33.3125 14.625 C-44.74027152 9.61455158 -59.56016528 9.71366801 -71.15625 14.10546875 C-74.48236934 15.58173549 -77.73078065 17.18875505 -80.953125 18.87890625 C-83.3125 20.0625 -83.3125 20.0625 -86.046875 21.02734375 C-86.79453125 21.36894531 -87.5421875 21.71054688 -88.3125 22.0625 C-88.6425 23.0525 -88.9725 24.0425 -89.3125 25.0625 C-91.75 27.75 -91.75 27.75 -94.3125 30.0625 C-94.9725 30.0625 -95.6325 30.0625 -96.3125 30.0625 C-96.5703125 30.7534375 -96.828125 31.444375 -97.09375 32.15625 C-98.46353399 35.42265798 -100.1265772 38.44782906 -101.8125 41.5625 C-108.03051806 53.67933602 -109.09992146 67.70818348 -105.0625 80.8125 C-104.51181124 82.24217273 -103.92711771 83.6591229 -103.3125 85.0625 C-102.961875 85.87203125 -102.61125 86.6815625 -102.25 87.515625 C-99.43892543 93.5446402 -95.4994376 101.9690312 -89.3125 105.0625 C-89.3125 105.7225 -89.3125 106.3825 -89.3125 107.0625 C-88.6525 107.289375 -87.9925 107.51625 -87.3125 107.75 C-84.79495862 108.85142436 -82.78127895 110.00614475 -80.5 111.5 C-68.82025647 118.84031941 -54.91354559 120.22662055 -41.49609375 117.8203125 C-33.742652 115.97470796 -27.57488438 112.88750588 -21.125 108.234375 C-19.3125 107.0625 -19.3125 107.0625 -17.3125 107.0625 C-17.3125 106.4025 -17.3125 105.7425 -17.3125 105.0625 C-15.4375 102.9375 -15.4375 102.9375 -13.3125 101.0625 C-12.6525 101.0625 -11.9925 101.0625 -11.3125 101.0625 C-10.9721875 100.0725 -10.9721875 100.0725 -10.625 99.0625 C-9.2473863 95.91366869 -7.55651544 93.25197725 -5.62890625 90.41796875 C-3.80448742 87.1535042 -2.62559055 83.5640748 -1.3125 80.0625 C-23.0925 79.5675 -23.0925 79.5675 -45.3125 79.0625 C-45.3125 69.8225 -45.3125 60.5825 -45.3125 51.0625 C-20.8925 51.0625 3.5275 51.0625 28.6875 51.0625 C32.45348229 62.36044688 30.17157749 77.99188149 26.6875 89.0625 C26.42066406 90.04992187 26.15382812 91.03734375 25.87890625 92.0546875 C23.48411797 100.25018517 19.44180339 107.01429148 14.6875 114.0625 C14.16929687 114.83851563 13.65109375 115.61453125 13.1171875 116.4140625 C1.02537035 133.52761792 -19.09960341 143.37576612 -39.06640625 147.65234375 C-51.76014802 149.25624614 -65.09123043 148.90870336 -77.3125 145.0625 C-78.29992187 144.79566406 -79.28734375 144.52882812 -80.3046875 144.25390625 C-93.50156068 140.39767707 -103.64938981 132.55526691 -113.3125 123.0625 C-114.240625 122.17949219 -115.16875 121.29648438 -116.125 120.38671875 C-118.3125 118.0625 -118.3125 118.0625 -118.3125 116.0625 C-118.9725 116.0625 -119.6325 116.0625 -120.3125 116.0625 C-122.03841164 113.59429363 -123.60082006 111.15293617 -125.125 108.5625 C-125.57278809 107.80235596 -126.02057617 107.04221191 -126.48193359 106.2590332 C-131.14502643 98.04476363 -135.3125 88.64166605 -135.3125 79.0625 C-153.7925 79.0625 -172.2725 79.0625 -191.3125 79.0625 C-191.3125 69.8225 -191.3125 60.5825 -191.3125 51.0625 C-172.8325 51.0625 -154.3525 51.0625 -135.3125 51.0625 C-134.9825 48.4225 -134.6525 45.7825 -134.3125 43.0625 C-132.18240393 34.98905551 -128.876401 27.82633928 -124.625 20.6875 C-124.23248047 20.0267749 -123.83996094 19.3660498 -123.43554688 18.68530273 C-122.45698024 17.10397442 -121.39197824 15.57673863 -120.3125 14.0625 C-119.6525 14.0625 -118.9925 14.0625 -118.3125 14.0625 C-117.94125 13.2271875 -117.94125 13.2271875 -117.5625 12.375 C-114.75837026 7.18735999 -110.94606433 3.58803808 -106.3125 0.0625 C-105.6525 0.0625 -104.9925 0.0625 -104.3125 0.0625 C-104.3125 -0.5975 -104.3125 -1.2575 -104.3125 -1.9375 C-99.92788462 -4.9375 -99.92788462 -4.9375 -97.3125 -4.9375 C-97.3125 -5.5975 -97.3125 -6.2575 -97.3125 -6.9375 C-63.98610254 -23.30070661 -30.48693 -21.68353355 0 0 Z " fill="#0BD897" transform="translate(191.3125,72.9375)"/>
+ </svg>
+ }
+ >
+ </Card>
</CardGroup>
### GPUs
diff --git a/docs/mint.json b/docs/mint.json
index c5918b8b..1be26701 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -98,7 +98,8 @@
"latest/integrations/litellm",
"latest/integrations/llama-index",
"latest/integrations/haystack",
- "latest/integrations/embedchain"
+ "latest/integrations/embedchain",
+ "latest/integrations/guardrails"
]
},
{
diff --git a/sdk/python/README.md b/sdk/python/README.md
index e8d840b4..544f3c49 100644
--- a/sdk/python/README.md
+++ b/sdk/python/README.md
@@ -34,10 +34,10 @@ This project adheres to the [Semantic Conventions](https://github.com/open-telem
| [✅ Anthropic](https://docs.openlit.io/latest/integrations/anthropic) | [✅ Qdrant](https://docs.openlit.io/latest/integrations/qdrant) | [✅ LlamaIndex](https://docs.openlit.io/latest/integrations/llama-index) | |
| [✅ GPT4All](https://docs.openlit.io/latest/integrations/gpt4all) | [✅ Milvus](https://docs.openlit.io/latest/integrations/milvus) | [✅ Haystack](https://docs.openlit.io/latest/integrations/haystack) | |
| [✅ Cohere](https://docs.openlit.io/latest/integrations/cohere) | | [✅ EmbedChain](https://docs.openlit.io/latest/integrations/embedchain) | |
-| [✅ Mistral](https://docs.openlit.io/latest/integrations/mistral) | | | |
-| [✅ Azure OpenAI](https://docs.openlit.io/latest/integrations/azure-openai) | | | |
-| [✅ HuggingFace Transformers](https://docs.openlit.io/latest/integrations/huggingface) | | | |
-| [✅ Amazon Bedrock](https://docs.openlit.io/latest/integrations/bedrock) | | | |
+| [✅ Mistral](https://docs.openlit.io/latest/integrations/mistral) | | [✅ Guardrails](https://docs.openlit.io/latest/integrations/guardrails) | |
+| [✅ Azure OpenAI](https://docs.openlit.io/latest/integrations/azure-openai) | | | |
+| [✅ HuggingFace Transformers](https://docs.openlit.io/latest/integrations/huggingface) | | | |
+| [✅ Amazon Bedrock](https://docs.openlit.io/latest/integrations/bedrock) | | | |
| [✅ Vertex AI](https://docs.openlit.io/latest/integrations/vertexai) | | | |
| [✅ Groq](https://docs.openlit.io/latest/integrations/groq) | | | |
| [✅ ElevenLabs](https://docs.openlit.io/latest/integrations/elevenlabs) | | | |