Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/how_to_guides/using_llms.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ See LiteLLM’s documentation [here](https://docs.litellm.ai/docs/providers) for

## Custom LLM Wrappers
In case you're using an LLM that isn't natively supported by Guardrails and you don't want to use LiteLLM, you can build a custom LLM API wrapper. In order to use a custom LLM, create a function that accepts a positional argument for the prompt as a string and any other arguments that you want to pass to the LLM API as keyword args. The function should return the output of the LLM API as a string.

Install ProfanityFree from hub:
```
guardrails hub install hub://guardrails/profanity_free
```
```python
from guardrails import Guard
from guardrails.hub import ProfanityFree
Expand Down Expand Up @@ -334,4 +337,4 @@ validated_response = guard(
prompt="Can you generate a list of 10 things that are not food?",
**kwargs,
)
```
```
Loading