Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

proxy server

Ishaan Jaff21963e0bbe78
diff --git a/docs/my-website/docs/providers/bedrock.md b/docs/my-website/docs/providers/bedrock.md
index 08a4d4862d5..1ba67955567 100644
--- a/docs/my-website/docs/providers/bedrock.md
+++ b/docs/my-website/docs/providers/bedrock.md
@@ -365,6 +365,9 @@ print(f"\nResponse: {resp}")
Example of using [Bedrock Guardrails with LiteLLM](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-use-converse-api.html)
+<Tabs>
+<TabItem value="sdk" label="LiteLLM SDK">
+
```python
from litellm import completion
@@ -389,7 +392,38 @@ response = completion(
},
)
```
+</TabItem>
+<TabItem value="proxy" label="LiteLLM Proxy Server">
+
+```python
+
+import openai
+client = openai.OpenAI(
+ api_key="anything",
+ base_url="http://0.0.0.0:4000"
+)
+# request sent to model set on litellm proxy, `litellm --model`
+response = client.chat.completions.create(model="anthropic.claude-v2", messages = [
+ {
+ "role": "user",
+ "content": "this is a test request, write a short poem"
+ }
+],
+temperature=0.7,
+extra_body={
+ guardrailConfig={
+ "guardrailIdentifier": "ff6ujrregl1q", # The identifier (ID) for the guardrail.
+ "guardrailVersion": "DRAFT", # The version of the guardrail.
+ "trace": "disabled", # The trace behavior for the guardrail. Can either be "disabled" or "enabled"
+ },
+}
+)
+
+print(response)
+```
+</TabItem>
+</Tabs>
## Usage - "Assistant Pre-fill"