Closed
Description
Bug Description
Running a Python script in Google Colab using litellm==1.48.1
throws ModuleNotFoundError: No module named 'enterprise'
when importing LitellmModel
from agents.extensions.models.litellm_model
. The same script worked fine the previous night, suggesting a recent environment or dependency change.
Additional Context
- The error originates from
litellm/responses/litellm_completion_transformation/transformation.py
, attempting to import fromenterprise.enterprise_hooks.session_handler
. - Similar issue reported in #5909 — likely related to a missing or premium
enterprise
module. - Colab’s runtime may have reset, causing package mismatches.
Possible Causes
- Missing Enterprise Module:
enterprise
might be a separate (undocumented) package likelitellm-proxy-enterprise
. - New Dependency:
litellm==1.48.1
may have introduced this dependency unexpectedly. - Colab Reset: Temporary Colab environment reset could have lost critical packages.
- Undocumented Feature:
enterprise
might belong to a premium feature and should be handled optionally.
Suggested Fix
- Clarify if
enterprise
is required for standard usage or is a separate installation. - If optional, update
litellm
to handle missing imports gracefully (e.g.,try-except
block). - Recommend a stable, verified
litellm
version or pin dependencies to avoid such issues. - Provide clear installation guidance for any
enterprise
-related modules.
Workarounds Attempted
- Reinstalled
litellm==1.48.1
andagents
; error persists. - Tried
!pip install litellm-proxy-enterprise
; package not found on PyPI. - Downgrading to
litellm==1.40.14
(which might avoid the dependency) was considered but not yet tested.