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

[Bug]: Vertex Credentials Are Cached #7904

Open
hakan458 opened this issue Jan 21, 2025 · 1 comment
Open

[Bug]: Vertex Credentials Are Cached #7904

hakan458 opened this issue Jan 21, 2025 · 1 comment
Assignees
Labels
bug Something isn't working mlops user request

Comments

@hakan458
Copy link

hakan458 commented Jan 21, 2025

What happened?

It seems that when using litellm to make calls to vertex_ai models, the vertex credentials are somehow cached within litellm and the ones passed into completion() are not being used on every call

>>> litellm.completion(
...     messages=[{'role': 'user', 'content': "Hey, how's it going?"}], 
...     model='vertex_ai/gemini-1.5-flash', 
...     max_tokens=10, 
...     temperature=0.0, 
...     vertex_credentials='sdsdfsdsdfsdfsddsff'
... )

Exception: Unable to load vertex credentials from environment. Got=sdsdfsdsdfsdfsddsff

So far so good... but then if I use real working credentials, any subsequent calls with anything passed into vertex_credentials still works, when it should not

>>> creds = <my actual google json credentials> 
>>> litellm.completion(
...     messages=[{'role': 'user', 'content': "Hey, how's it going?"}], 
...     model='vertex_ai/gemini-1.5-flash', 
...     max_tokens=10, 
...     temperature=0.0, 
...     vertex_credentials=creds
... )

ModelResponse(id=' ................)  # successful response

>>> litellm.completion(
...     messages=[{'role': 'user', 'content': "Hey, how's it going?"}], 
...     model='vertex_ai/gemini-1.5-flash', 
...     max_tokens=10, 
...     temperature=0.0, 
...     vertex_credentials='sdsdfsdsdfsdfsddsff'
... )

ModelResponse(id=' ................)  # successful response when it should not be

Relevant log output

Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

1.47.2

Tried with 1.59.1 as well, same behavior

Twitter / LinkedIn details

No response

@hakan458 hakan458 added the bug Something isn't working label Jan 21, 2025
@krrishdholakia krrishdholakia self-assigned this Jan 23, 2025
@krrishdholakia
Copy link
Contributor

Thanks for the issue @hakan458 i plan to look into this, this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mlops user request
Projects
None yet
Development

No branches or pull requests

2 participants