Claude
Claude on Vertex AI examples for runs, storage, multimodal input, knowledge, memory, caching, thinking, structured output, and tools.
The source uses claude-sonnet-4@20250514, which Anthropic lists as deprecated on Google Cloud. Google's Sonnet 4 card does not establish a completed retirement. For a new deployment, choose a current model and its supported settings, such as Sonnet 4.6. Provider availability and lifecycle dates can differ from the direct Anthropic API.
| Example | Description |
|---|---|
| Vertex AI Basic | Run Claude Sonnet 4 on Vertex AI with sync, streaming, and async calls. |
| Vertex AI Basic With Timeout | Set a five-second request timeout on Claude Sonnet 4 running on Vertex AI. |
| Betas | Pass a beta option to Claude on Vertex AI and inspect the SDK’s known beta names. |
| DB | Persist session history in SQLite so a Vertex AI Claude agent can answer follow-ups. |
| Vertex AI Image Input Bytes | Send a downloaded image as bytes to Claude on Vertex AI and search the web about it. |
| Vertex AI Image Input URL | Pass an image URL to Claude on Vertex AI and search the web for more context. |
| Knowledge | Answer questions from a PgVector knowledge base with Claude on Vertex AI. |
| Memory | Store personalized memories and session summaries with Claude on Vertex AI using PostgreSQL. |
| Vertex AI PDF Input Bytes | Summarize a PDF passed as raw bytes to Claude Sonnet 4 on Vertex AI. |
| Vertex AI PDF Input Local | Summarize a local PDF file passed by path to Claude Sonnet 4 on Vertex AI. |
| Prompt Caching | Mark a reusable system prompt for caching and inspect Claude’s cache usage on Vertex AI. |
| Vertex AI Structured Output | Request JSON from Claude on Vertex AI and validate it locally as a MovieScript. |
| Vertex AI Thinking | Enable extended thinking with a 1024-token budget on Claude Sonnet 4 via Vertex AI. |
| Tool Use | Give Claude on Vertex AI web search tools and run it sync, streaming, and async. |
| Adaptive Thinking | Use adaptive thinking with effort levels to control reasoning depth on Claude VertexAI. |