Skip to content
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

add google-auth to pyproject.toml #1613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nmfisher
Copy link
Contributor

@nmfisher nmfisher commented Jan 22, 2025

The google-auth package isn't specified as a dependency in pyproject.toml, so litellm will fail with any gemini model:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/litellm/main.py", line 457, in acompletion
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py", line 1030, in async_completion
    _auth_header, vertex_project = await self._ensure_access_token_async(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 275, in _ensure_access_token_async
    self._credentials, cred_project_id = await asyncify(self.load_auth)(
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/litellm_core_utils/asyncify.py", line 57, in wrapper
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 943, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 39, in load_auth
    import google.auth as google_auth
ModuleNotFoundError: No module named 'google.auth'

This also requires an update to poetry.lock, but I suspect you probably re-generate that regularly as other dependencies change. To be honest, I'm not sure why this isn't included as a transitive dependency of litellm but I haven't gone digging upstream to figure that out.


Important

Add google-auth to pyproject.toml to resolve ModuleNotFoundError for Gemini models in litellm.

  • Dependencies:
    • Add google-auth version ^2.37.0 to pyproject.toml to resolve ModuleNotFoundError for google.auth when using Gemini models in litellm.

This description was created by Ellipsis for 709f78d. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 709f78d in 10 seconds

More details
  • Looked at 12 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pyproject.toml:13
  • Draft comment:
    Consider specifying a more precise version constraint for google-auth to avoid potential compatibility issues. For example, use "^2.37.0,<3.0" to ensure compatibility with future updates.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of google-auth to the dependencies list is correct given the error trace provided in the PR description. However, the version constraint should be more specific to avoid potential compatibility issues.

Workflow ID: wflow_bCcLL83l0HcnhIAz


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@suchintan
Copy link
Contributor

@nmfisher I'd love to get this merged -- any chance you can regenerate poetry.lock? I'll merge it when the check passes!

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.

2 participants