yym68686 / uni-api

This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balancing. Currently supported backend services include: OpenAI, Anthropic, DeepBricks, OpenRouter, Gemini, Vertex, etc.
337 stars 42 forks source link

vertex provider not work #41

Closed ratu-sh closed 1 day ago

ratu-sh commented 2 days ago

hello, i created vertex ai provider by this guide https://github.com/cg-dot/vertexai-cf-workers got this error. what is wrong? thanks!

2024-11-11 20:47:12,311 - uni-api - INFO - provider: vertex      model: claude-3-sonnet        engine: vertex-claude
2024-11-11 20:47:14,424 - uni-api - ERROR - Error 400 with provider vertex API key: None: [{'error': {'code': 400, 'message': 'Project `*********` is not allowed to use Publisher Model `projects/*****-*****-********-m8/locations/asia-southeast1/publishers/anthropic/models/claude-3-sonnet@20240229`', 'status': 'FAILED_PRECONDITION'}}]
INFO:     10.60.0.2:35400 - "POST /v1/chat/completions HTTP/1.1" 400 Bad Request
ratu-sh commented 1 day ago

same for other locations

us-central1

us-east5

asia-southeast1

ratu-sh commented 1 day ago

Error 400 with provider vertex API key Project is not allowed to use Publisher Model claude status FAILED_PRECONDITION

ratu-sh commented 1 day ago

Enable all claude models on "model garden" page. now have new error

429 Too Many Requests {"error":"All claude-3-5-sonnet error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-5-sonnet. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_"}
429 Too Many Requests {"error":"All claude-3-haiku error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-haiku. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_EXH"}
ratu-sh commented 1 day ago

https://github.com/cg-dot/vertexai-cf-workers/issues/18#issuecomment-2457115587

ratu-sh commented 1 day ago

You can't access or use Free Trial credits for generative AI partner models offered as managed APIs (also known as model as a service).

Thus, tree trial doesn't support Claude and Meta models.

ref: https://cloud.google.com/free/docs/free-cloud-features

ratu-sh commented 1 day ago

so as claude models listed in this page model as a service) i suppose that Google Cloud Povider stopped to allow us using Free Trial for Claude AI.

@yym68686 can you confirm or deny this?

ratu-sh commented 1 day ago

https://github.com/vercel/ai/issues/2441

yym68686 commented 1 day ago

Hi, this bug may have been fixed, please pull the latest image and try again.

ratu-sh commented 1 day ago

updated. still got this errors on all claude models

AI, [12.11.2024 14:17]
429 Too Many Requests {"error":"All claude-3-5-sonnet error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-5-sonnet. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_"}

AI, [12.11.2024 14:17]
429 Too Many Requests {"error":"All claude-3-sonnet error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-sonnet. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_EX"}

AI, [12.11.2024 14:17]
429 Too Many Requests {"error":"All claude-3-haiku error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-haiku. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_EXH"}

 AI, [12.11.2024 14:17]
429 Too Many Requests {"error":"All claude-3-opus error: [{'error': {'code': 429, 'message': 'Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: anthropic-claude-3-opus. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.', 'status': 'RESOURCE_EXHA"}
yym68686 commented 1 day ago

This is not a uni-api error. Your vertex has no quota. Free vertex usually encounters this situation. Please switch to a paid API.