litellm_fix(hosted_vllm): use custom client when provided#20158
Closed
shin-bot-litellm wants to merge 1 commit intomainfrom
Closed
litellm_fix(hosted_vllm): use custom client when provided#20158shin-bot-litellm wants to merge 1 commit intomainfrom
shin-bot-litellm wants to merge 1 commit intomainfrom
Conversation
When a custom OpenAI client is passed to hosted_vllm completion, use openai_chat_completions.completion() to ensure the client is properly used. This fixes test failures in test_openai_compatible_custom_api_base and test_openai_compatible_custom_api_video for the hosted_vllm provider. The base_llm_http_handler is still used when no custom client is passed, preserving the ssl_verify functionality added in #19893. Fixes: test_openai_compatible_custom_api_video[hosted_vllm] Fixes: test_openai_compatible_custom_api_base[hosted_vllm]
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes failing CI tests for
hosted_vllmprovider:test_openai_compatible_custom_api_video[hosted_vllm]test_openai_compatible_custom_api_base[hosted_vllm]Root Cause
PR #19893 added a dedicated
hosted_vllmbranch inmain.pythat routes all requests throughbase_llm_http_handler.completion()to supportssl_verify. However, this broke the behavior when a custom OpenAI client is passed - the client was ignored becausebase_llm_http_handleruses its own httpx client internally.Fix
When a custom
clientparameter is provided:openai_chat_completions.completion()which properly utilizes the passed clientWhen no custom client is provided:
base_llm_http_handler.completion()to preserve thessl_verifyfunctionality from fix(hosted_vllm): route through base_llm_http_handler to support ssl_verify #19893Testing
Both failing tests now pass:
The ssl_verify tests from #19893 still pass:
CircleCI Link
https://app.circleci.com/pipelines/github/BerriAI/litellm/56610/workflows/ddae19f6-881e-49e1-922e-005927a11564/jobs/1135770/tests