cookbook/90_models/vertexai/claude/README.md
Note: Fork and clone this repository if needed
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
export GOOGLE_CLOUD_PROJECT=your-project-id
export CLOUD_ML_REGION=your-region
gcloud auth application-default login
or
uv pip install -U anthropic ddgs duckdb agno
python cookbook/92_models/vertexai/claude/basic_stream.py
python cookbook/92_models/vertexai/claude/basic.py
python cookbook/92_models/vertexai/claude/tool_use.py
python cookbook/92_models/vertexai/claude/structured_output.py
python cookbook/92_models/vertexai/claude/db.py
Take note that claude uses OpenAI embeddings under the hood, and you will need an OpenAI API Key
export OPENAI_API_KEY=***
python cookbook/92_models/vertexai/claude/knowledge.py
python cookbook/92_models/vertexai/claude/memory.py
python cookbook/92_models/vertexai/claude/image_input_url.py
python cookbook/92_models/vertexai/claude/thinking.py
python cookbook/92_models/vertexai/claude/thinking_stream.py
output_configFor Claude 4.6 VertexAI models that support adaptive thinking, use output_config to control thinking depth via the effort parameter:
python cookbook/90_models/vertexai/claude/adaptive_thinking.py
from agno.models.vertexai import Claude
model = Claude(
id="claude-sonnet-4-6@20250514",
max_tokens=4096,
thinking={"type": "adaptive"},
output_config={"effort": "high"},
)
Valid effort values:
"low" - Most efficient, significant token savings"medium" - Balanced approach with moderate savings"high" - Default, high capability for complex reasoning"max" - Absolute maximum capability (Opus 4.6 only)