Set lower bounds for LiteLLM and OpenAI deps#20
Merged
kelsey-wong merged 4 commits intomainfrom Dec 30, 2025
Merged
Conversation
Add type check fix Revert versions Add fix for coroutines not awaited in litellm
kelsey-wong
reviewed
Dec 29, 2025
tlm/utils/completion_utils.py
Outdated
Comment on lines
+139
to
+143
| @@ -140,7 +140,7 @@ async def _generate_completion( | |||
| # Convert ChoiceLogprobs to dict to avoid Pydantic validation issues | |||
| logprobs = ChoiceLogprobs.model_validate( | |||
| response.choices[0].logprobs.model_dump() | |||
| if hasattr(response.choices[0].logprobs, "model_dump") | |||
| if response.choices[0].logprobs and hasattr(response.choices[0].logprobs, "model_dump") | |||
Collaborator
There was a problem hiding this comment.
is this check necessary? it's already within the condition if litellm_params.get("logprobs") and hasattr(response.choices[0], "logprobs"):
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.
I replaced the pinned versions with lower bounds to ensure consumers of the PyPI package can integrate more easily. The
openaipackage has a major version bump at 2.0.0 around September this year, so I upgraded the LiteLLM and OpenAI package versions to that timeframe.I also added another Pytest fixture to deal with LiteLLM leaking coroutines (GitHub thread) and an extra null check to deal with a type change in LiteLLM.
Checklist