Skip to content

Allowing litellm<1.72 in llm extra for working VCR #251

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

Merged
merged 4 commits into from
Jun 14, 2025

Conversation

jamesbraza
Copy link
Collaborator

@jamesbraza jamesbraza commented Jun 14, 2025

The backstory here is:

  1. Pinned latest litellm for tool_choice=Tool's finish_reason fix #244 pinned litellm>=1.72.0 for improved finish_reason logic
  2. However, last night I discovered [Bug]: #11097 broke HTTP request caching via vcrpy BerriAI/litellm#11724

So this PR:

@jamesbraza jamesbraza self-assigned this Jun 14, 2025
@Copilot Copilot AI review requested due to automatic review settings June 14, 2025 18:41
@jamesbraza jamesbraza added the bug Something isn't working label Jun 14, 2025
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 14, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts the version pinning for litellm in the llm extra to allow versions below 1.72 so that VCR cassettes won’t break, and it adds a runtime version check to automatically select the correct finish_reason validation logic.

  • Restores a lower version constraint for litellm in the llm extra while adding an import and runtime version check in utils.py
  • Updates cassette fixtures (headers, content-length, user-agent, etc.) to reflect new version information
  • Revises pyproject.toml to tighten the allowed litellm version range and add a packaging dependency

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cassettes/TestParallelism.test_tool_selector_with_external_acompletion*.yaml Updates request/response formatting and header values for consistency and versioning
tests/cassettes/TestParallelism.test_tool_selector_from_model_name*.yaml Similar cassette updates with differences in header values (e.g. read timeout)
tests/cassettes/TestParallelism.test_dummyenv_using_empty_params.yaml Adjusts JSON payload formatting and header updates
src/aviary/tools/utils.py Adds a runtime version check for litellm and introduces a new flag for finish_reason logic
pyproject.toml Changes litellm version constraints and adds packaging as a dependency
Comments suppressed due to low confidence (1)

tests/cassettes/TestParallelism.test_tool_selector_with_external_acompletion[gpt-4o-mini-2024-07-18].yaml:39

  • The header 'x-stainless-read-timeout' is set to '6000.0' in this cassette while a similar cassette uses '600.0'. Please confirm that this difference is intentional to avoid potential inconsistency issues.
x-stainless-read-timeout:

Copy link
Collaborator

@maykcaldas maykcaldas left a comment

Choose a reason for hiding this comment

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

Nice dive 🙌🏻

@jamesbraza jamesbraza merged commit facb78b into main Jun 14, 2025
5 of 6 checks passed
@jamesbraza jamesbraza deleted the loosening-litellm branch June 14, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants