-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Route your openai compatible sdk base_url to the Guardrails Server #1212
Comments
@joy1007 can i get some more information here? what's the error you're getting? as far as i can tell this should be supported. does the non openai endpoint respond? it should be a POST http://localhost:8000/guards/gibberish_guard/validate what does your config.py look like? what happens if you curl it or try to use another model? |
Thank you for your response! We deployed a LLaMA model using vllm and configured it to connect via the OpenAI-compatible endpoint. Typically, we make requests as follows:
However, since we wanted to use the Guardrails server, we modified the script as follows (the model data is anonymized for privacy):
Here is the error we encountered when running the above Python script:
Here is the config.py file we used:
Additionally, the server-side error log reports:
We would appreciate guidance on how to resolve this issue. Specifically:
Thank you! |
Description
In the documentation "Quickstart : Guardrails Server", have mention about updating client to use the Guardrails Server
I wonder how exactly can I route my openai (or openai compatible sdk) base_url to the http://localhost:8000/guards/[guard_name]/openai/v1/ endpoint.
Current documentation
Additional context
How can I route to Guardrails Server when the openAI client's base_url is already in use by Guardrails Server?
For example, assume my openai endpoint is http://my-openai.endpoint.com/v1
and the client's base_url has already set below
client = OpenAI(
base_url="http://localhost:8000/guards/gibberish_guard/openai/v1",
api_key="token_abc"
)
when I want to use my model, it doesn't work by typing my model name like this.
response = client.chat.completions.create(
model="my-model-name",
messages=[{
"role": "user",
"content": "Make up some gibberish for me please!"
}]
)
The text was updated successfully, but these errors were encountered: