spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/index.html
Apache License 2.0
2.77k stars 688 forks source link

VertexAI PaLM2 does not support Authentication Credentials #653

Closed rafal-dudek closed 1 month ago

rafal-dudek commented 3 months ago

VertexAI PaLM2 Chat https://docs.spring.io/spring-ai/reference/api/clients/vertexai-palm2-chat.html does not support authentication by gcloud (gcloud auth application-default login). I get following error when not defining api-key:

java.lang.RuntimeException: 403 - ResponseError[error=Error[message=Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API., code=403, status=PERMISSION_DENIED]]

As this is the same mechanism, I think it won't support GKE IAM authentication as well.

VertexAI Gemini Chat supports this authentication already: https://docs.spring.io/spring-ai/reference/api/clients/vertexai-gemini-chat.html#_prerequisites

In documentation I see, that API for PaLM2 supports this method of authentication: https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/text-bison ("Setup the PaLM 2 Text Bison (curl)")

ThomasVitale commented 1 month ago

VertexAI PaLM2 is deprecated and it's being decommissioned by Google. Therefore, it's being removed from Spring AI as well (see https://github.com/spring-projects/spring-ai/issues/924).

markpollack commented 1 month ago

Closing as the model support via those APIs is going away and will be replaced by access through the vertex apis.