BerriAI / litellm

Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs)
https://docs.litellm.ai/docs/
Other
10.23k stars 1.14k forks source link

[Feature]: Claud3 vertex ai without sa json key #3549

Closed superpoussin22 closed 1 month ago

superpoussin22 commented 1 month ago

What happened?

when trying to use claude 3 on GCP without a json key from a SA we have an error 400. It could be fine to having it working like for gemini ( without the json file and only with the Vertex AI user Role)

Relevant log output

{"error":{"message":"VertexAIException - Error code: 400 - {'error': {'code': 400, 'message': 'Project `project1` is not allowed to use Publisher Model `projects/project1/locations/europe-west4/publishers/anthropic/models/claude-3-haiku@20240307`', 'status': 'FAILED_PRECONDITION'}} \n\nKey Name: `xxxx-key`\nTeam: `xxxx`\nModel: vertex_ai/claude-3-haiku@20240307\nAPI Base: europe-west4-aiplatform.googleapis.com/v1/projects/project1/locations/europe-west4/publishers/google/models/claude-3-haiku@20240307:streamGenerateContent\nMessages: [{'role': 'user', 'content': 'what llm are you'}]\nmodel_group: claude3-haiku\n\ndeployment: vertex_ai/claude-3-haiku@20240307\n\nvertex_project: project1\n\nvertex_location: europe-west4\n\nNumber Retries = 2","type":null,"param":null,"code":400}}

Twitter / LinkedIn details

No response

krrishdholakia commented 1 month ago

hey @superpoussin22 it looks like it worked fine

the error is being raised by google saying your service account doesn't have model access -

Project project1 is not allowed to use Publisher Model projects/project1/locations/europe-west4/publishers/anthropic/models/claude-3-haiku@20240307'

superpoussin22 commented 1 month ago

@krrishdholakia thanks for the info the SA is "Consumer Procurement Entitlement Manager" and "Vertex AI User" but I always have errors :( the model is defined like this

 model_name: claude3-haiku
    litellm_params:
      model: vertex_ai/claude-3-haiku@20240307
      vertex_project: "litellm"
      vertex_location: "europe-west4"
superpoussin22 commented 1 month ago

solved , just need to wait a little bit more that the Consumer role was applyed by GCP

it can be closed