a2aproject / a2aproject/a2a-samples

LiteLLM ignores GOOGLE_GENAI_USE_VERTEXAI=FALSE environment variable and defaults to Vertex AI

Aberta
#334 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Jupyter Notebook
Estrelas
1.8k
Forks
751
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

### What happened?

When GOOGLE_GENAI_USE_VERTEXAI=FALSE is set, LiteLLM should use Google AI Studio with the GOOGLE_API_KEY, not attempt Vertex AI authentication.

LiteLLM defaults to Vertex AI regardless of the GOOGLE_GENAI_USE_VERTEXAI setting, causing authentication errors:

I have fixed the issue I will be raising the PR soon

### Relevant log output

```shell
litellm.exceptions.AuthenticationError: geminiException - {
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_INVALID",
"domain": "googleapis.com",
"metadata": {
"service": "generativelanguage.googleapis.com"
}
}
]
}
}
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Look for the Google AI/Vertex AI client initialization in the LiteLLM codebase, likely in a provider-specific module. The environment variable GOOGLE_GENAI_USE_VERTEXAI should be read to decide between Google AI Studio and Vertex AI endpoints. Check the authentication flow and ensure the API key is used correctly when the flag is false. Verify the fix by setting the environment variable and testing the Gemini API call.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
ai, backend
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
40/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.