sanjay3290
@sanjay3290
ยท
a year ago
Claude 4 via Vertex AI
Last Updated
a year ago
Created
a year ago
Function
pipe
v1.0.0
Name
Claude 4 via Vertex AI
Downloads
332+
Saves
0+
Description
๐Ÿš€ Complete access to all Anthropic Claude models through Google Vertex AI - including the latest Claude 4 Opus & Sonnet with extended thinking capabilities. โœจ FEATURES: - Claude 4 Opus & Sonnet (Latest 2025 models) - Claude 3.7 Sonnet with extended thinking - All Claude 3.5 & 3.0 models included - Vision support for image analysis - Enterprise-grade security & authentication - Multiple auth methods (Service Account, ADC, Environment) - Extended thinking process visualization - Configurable token limits & temperature ๐Ÿ”ง QUICK SETUP: 1. Set your Google Cloud PROJECT_ID in configuration 2. Enable Vertex AI and Claude models in your GCP project 3. Configure authentication (Service Account JSON or Environment) 4. Start chatting with Claude models! ๐Ÿ’ก AUTHENTICATION OPTIONS: - Service Account JSON (paste directly) - GOOGLE_APPLICATION_CREDENTIALS file - Application Default Credentials (ADC) - Environment variables ๐ŸŽฏ PERFECT FOR: - Development teams using Google Cloud - Enterprise deployments requiring Vertex AI - Organizations needing advanced Claude capabilities - Projects requiring vision + text processing โšก All Claude models work out-of-the-box with proper GCP setup!

Anthropic Claude 4 & All Models via Vertex AI

๐Ÿš€ Complete access to all Anthropic Claude models through Google Vertex AI - including the latest Claude 4 Opus & Sonnet with extended thinking capabilities.

โœจ Features

๐Ÿค– Complete Model Access

  • Claude 4 Opus - Most powerful model for complex tasks and coding
  • Claude 4 Sonnet - Balanced performance and cost efficiency
  • Claude 3.7 Sonnet - Extended thinking capabilities
  • Claude 3.5 Sonnet V2 - Advanced reasoning and analysis
  • Claude 3.5 Haiku - Lightning-fast responses
  • Claude 3 Opus & Haiku - Previous generation models

๐Ÿง  Advanced Capabilities

  • Extended Thinking - See Claude's reasoning process (Claude 4 & 3.7)
  • Vision Support - Process images, charts, documents, and screenshots
  • Long Context - Handle up to 200K tokens of context
  • Tool Use - Function calling and structured outputs
  • Multi-modal - Text, image, and document processing

๐Ÿ” Enterprise Security

  • Multiple Authentication Methods - Service Account, ADC, Environment Variables
  • Google Cloud Integration - Native Vertex AI security and compliance
  • No API Key Management - Uses Google Cloud IAM permissions
  • Audit Logging - Full request/response logging through Vertex AI

โš™๏ธ Flexible Configuration

  • Configurable Parameters - Temperature, token limits, thinking budget
  • Debug Mode - Detailed logging for troubleshooting
  • Regional Deployment - Choose your preferred Google Cloud region
  • Environment Flexibility - Works in any Google Cloud environment

๐Ÿš€ Quick Start

1. Install the Function

  1. Go to Admin Panel > Functions in Open WebUI
  2. Click "+" to add a new function
  3. Search for "Anthropic Claude 4 & All Models via Vertex AI" in the community
  4. Click Install

2. Configure Google Cloud

bash
# Enable Vertex AI API in your Google Cloud project
gcloud services enable aiplatform.googleapis.com

# Enable Claude models in Vertex AI Model Garden
# Go to: https://console.cloud.google.com/vertex-ai/model-garden
# Search for "Claude" and enable the models you want to use

3. Set Up Authentication

Option A: Service Account JSON (Recommended)

  1. Create a service account in Google Cloud Console
  2. Grant it Vertex AI User role
  3. Download the JSON key file
  4. Copy the JSON content and paste it in the SERVICE_ACCOUNT_JSON field

Option B: Environment Variables

bash
export VERTEX_AI_PROJECT_ID="your-project-id"
export VERTEX_AI_LOCATION="us-east5"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

Option C: Application Default Credentials

bash
gcloud auth application-default login

4. Configure the Function

  1. Go to Functions > Vertex AI Claude > Settings
  2. Set your PROJECT_ID (your Google Cloud project ID)
  3. Adjust other settings as needed:
    • LOCATION: us-east5 (recommended for Claude models)
    • ENABLE_THINKING: true for Claude 4 thinking capabilities
    • MAX_OUTPUT_TOKENS: 4096 (or higher for longer responses)

๐Ÿ“‹ Configuration Reference

Required Settings

SettingDescriptionExample
PROJECT_IDYour Google Cloud Project IDmy-ai-project-123
LOCATIONVertex AI regionus-east5

Authentication (Choose One)

MethodSettingDescription
Service Account JSONSERVICE_ACCOUNT_JSONPaste full JSON content
Environment FileGOOGLE_APPLICATION_CREDENTIALSPath to JSON file
Default CredentialsNone neededUses gcloud auth

Optional Settings

SettingDefaultDescription
MAX_OUTPUT_TOKENS4096Maximum response length
TEMPERATURE0.7Response creativity (0.0-1.0)
ENABLE_THINKINGfalseShow Claude's reasoning process
THINKING_TOKEN_BUDGET16000Tokens for thinking (1024-32000)

๐ŸŽฏ Usage Examples

Basic Chat

text
User: Explain quantum computing in simple terms
Claude: [Provides detailed explanation using Claude 4's capabilities]

Extended Thinking (Claude 4)

text
User: Plan a complete marketing strategy for a new SaaS product

๐Ÿค” **Thinking Process:**
Let me break this down systematically...
[Shows detailed reasoning process]

**Marketing Strategy:**
[Provides comprehensive strategy based on thinking process]

Vision Analysis

text
User: [Uploads image] What's in this chart and what insights can you provide?
Claude: [Analyzes the image and provides detailed insights]

Code Review

text
User: Review this Python code for security issues
Claude: [Provides detailed code analysis using Claude 4's coding expertise]

๐Ÿ”ง Troubleshooting

Common Issues

โŒ "Authentication failed"

  • Verify your service account has Vertex AI User role
  • Check that your JSON is valid and complete
  • Ensure your project has Vertex AI API enabled

โŒ "Invalid Endpoint name"

  • Verify your PROJECT_ID is correct
  • Check that the Claude models are enabled in your project
  • Confirm you're using the correct region (us-east5 recommended)

โŒ "Model not found"

  • Go to Vertex AI Model Garden and enable Claude models
  • Wait a few minutes after enabling for propagation
  • Check that your region supports Claude models

โŒ "Quota exceeded"

  • Check your Vertex AI quotas in Google Cloud Console
  • Request quota increases if needed
  • Consider using different regions for better availability

Debug Mode

Enable debug mode by setting DEBUG_MODE = True in the function code:

python
# At the top of the function code
DEBUG_MODE = True

This will show detailed logs including:

  • Authentication method used
  • API endpoints called
  • Request/response payloads
  • Error details

๐ŸŒ Supported Regions

Claude models are available in these Vertex AI regions:

  • us-east5 (Virginia) - Recommended
  • us-central1 (Iowa)
  • europe-west4 (Netherlands)
  • asia-southeast1 (Singapore)

๐Ÿ’ฐ Pricing

Pricing follows Vertex AI's pay-as-you-go model:

  • Claude 4 Opus: $15 input / $75 output per 1M tokens
  • Claude 4 Sonnet: $3 input / $15 output per 1M tokens
  • Claude 3.5 models: $3 input / $15 output per 1M tokens
  • Claude 3 models: $0.25-$15 per 1M tokens (varies by model)

Prices subject to change. Check Google Cloud Vertex AI pricing for current rates.

๐Ÿ“„ Requirements

Dependencies

  • google-auth - Google Cloud authentication
  • google-cloud-aiplatform - Vertex AI client library

Permissions

Your service account needs:

  • Vertex AI User (roles/aiplatform.user)
  • Service Account Token Creator (if using impersonation)

Google Cloud Setup

  1. Enable Vertex AI API
  2. Enable Claude models in Model Garden
  3. Set up billing (required for Vertex AI)
  4. Configure authentication

๐Ÿ”„ Updates & Changelog

Version 1.0.0 (2025-05-24)

  • โœ… Initial release with all Claude models
  • โœ… Claude 4 Opus & Sonnet support
  • โœ… Extended thinking capabilities
  • โœ… Multi-modal vision support
  • โœ… Enterprise authentication options
  • โœ… Comprehensive error handling

๐Ÿ“š Additional Resources

โš–๏ธ Terms & Privacy

This function:

  • Does not store or log your conversations
  • Uses Google Cloud's security and privacy controls
  • Follows Anthropic's usage policies
  • Adheres to Google Cloud's terms of service

Your data is processed according to Google Cloud and Anthropic privacy policies.


Made with โค๏ธ for the Open WebUI Community

Get started in minutes with enterprise-grade Claude 4 access through Google Vertex AI!


0