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

[Feature Request] Support Anthropic Model on Google Vertex #5772

Open
ryanhex53 opened this issue Nov 5, 2024 · 2 comments
Open

[Feature Request] Support Anthropic Model on Google Vertex #5772

ryanhex53 opened this issue Nov 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ryanhex53
Copy link
Contributor

🥰 Feature Description

Currently, I can't get it to work with Claude 3.5 on Google Cloud Vertex AI. Google Cloud offers a $300 no-cost trial credit for 90 days. Could anyone help with this?

🧐 Proposed Solution

Here are some information from google cloud documentation:

Note that the API for Claude on Vertex differs from the Anthropic API documentation in the following ways:

  • model is not a valid parameter. The model is instead specified in the Google Cloud endpoint URL.
  • anthropic_version is a required parameter and must be set to "vertex-2023-10-16"

request.json

{
  "anthropic_version": "vertex-2023-10-16",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image",
          "source": {
            "type": "base64",
            "media_type": "image/png",
            "data": "iVBORw0KGg..."
          }
        },
        {
          "type": "text",
          "text": "What is in this image?"
        }
      ]
    }
  ],
  "max_tokens": 256,
  "stream": true
}
PROJECT_ID=your-gcp-project-id
MODEL=claude-3-5-sonnet-v2@20241022

# Pick one region:
LOCATION=us-east5
# LOCATION=europe-west1

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d @request.json \
"https://$LOCATION-aiplatform.googleapis.com/v1/projects/$PROJECT_ID/locations/$LOCATION/publishers/anthropic/models/$MODEL:streamRawPredict"

📝 Additional Information

No response

@ryanhex53 ryanhex53 added the enhancement New feature or request label Nov 5, 2024
@ryanhex53
Copy link
Contributor Author

I'm working on this now

@ryanhex53
Copy link
Contributor Author

#5794 work done, merge pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant