Skip to content

CUBE-154 - vLLM with guardrails#166

Open
smithjilks wants to merge 5 commits intoultravioletrs:mainfrom
smithjilks:feat-vllm-guardrails
Open

CUBE-154 - vLLM with guardrails#166
smithjilks wants to merge 5 commits intoultravioletrs:mainfrom
smithjilks:feat-vllm-guardrails

Conversation

@smithjilks
Copy link
Contributor

What type of PR is this?

This is a feature becuaes it adds vllm support to guardrails

What does this do?

Adds vllm support to guardrails.

Which issue(s) does this PR fix/relate to?

Resolves #154

Have you included tests for your changes?

No.

Did you document any new/modified features?

No.

Notes

Signed-off-by: Jilks Smith <smithjilks@gmail.com>
@smithjilks smithjilks requested a review from SammyOina February 4, 2026 00:47
@smithjilks smithjilks self-assigned this Feb 4, 2026
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
) -> ChatResult:
final_headers = self._merge_headers()

model = self._get_model_from_context() or self.model_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_model_from_context() is called twice per request — redundant, here and 163

Comment on lines +140 to +151
temp_client = ChatOpenAI(
model=model,
base_url=str(self.openai_api_base),
api_key=self.openai_api_key.get_secret_value() if self.openai_api_key else "EMPTY",
default_headers=final_headers,
temperature=self.temperature,
max_tokens=self.max_tokens,
**self._extract_openai_options(kwargs)
)

return await temp_client._agenerate(
messages, stop=stop, run_manager=run_manager, **kwargs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kwargs are passed both to the temp_client constructor (via _extract_openai_options) and to temp_client._agenerate(..., **kwargs) — risk of duplicate/conflicting parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vLLM with guardrails

2 participants