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

Google Authentication Issue #8424

Open
binyasin opened this issue Feb 9, 2025 · 2 comments
Open

Google Authentication Issue #8424

binyasin opened this issue Feb 9, 2025 · 2 comments

Comments

@binyasin
Copy link

binyasin commented Feb 9, 2025

LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.

Traceback (most recent call last):
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\main.py", line 2404, in completion
model_response = vertex_chat_completion.completion( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\gemini\vertex_and_google_ai_studio_gemini.py", line 1204, in completion
_auth_header, vertex_project = self._ensure_access_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py", line 130, in _ensure_access_token
self._credentials, cred_project_id = self.load_auth(
^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py", line 84, in load_auth
creds, creds_project_id = google_auth.default(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\google\auth_default.py", line 719, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\JOJIS.venv\Scripts\gemini1.exe_main
.py", line 10, in
File "C:\Users\JOJIS\azambasti\src\azambasti\nms.py", line 7, in call_llm
response = completion(
^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\utils.py", line 1156, in wrapper
raise e
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\utils.py", line 1034, in wrapper
result = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\main.py", line 3085, in completion
raise exception_type(
^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\litellm_core_utils\exception_mapping_utils.py", line 2201, in exception_type
raise e
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\litellm_core_utils\exception_mapping_utils.py", line 2177, in exception_type
raise APIConnectionError(
litellm.exceptions.APIConnectionError: litellm.APIConnectionError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
Traceback (most recent call last):
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\main.py", line 2404, in completion
model_response = vertex_chat_completion.completion( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\gemini\vertex_and_google_ai_studio_gemini.py", line 1204, in completion
_auth_header, vertex_project = self._ensure_access_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py", line 130, in _ensure_access_token
self._credentials, cred_project_id = self.load_auth(
File "C:\Users\JOJIS.venv\Lib\site-packages\litellm\llms\vertex_ai\vertex_llm_base.py", line 84, in load_auth
creds, creds_project_id = google_auth.default(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JOJIS.venv\Lib\site-packages\google\auth_default.py", line 719, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

@binyasin
Copy link
Author

binyasin commented Feb 9, 2025

I am trying connect via litellm through UV but this error cannot make me pass on

@superpoussin22
Copy link
Contributor

Did you follow this : https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
And set the variable in litellm to find your json credential file ?
GOOGLE_APPLICATION_CREDENTIALS

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service_account.json"

https://docs.litellm.ai/docs/providers/vertex#pre-requisites

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

No branches or pull requests

2 participants