Skip to content

docs: document Vertex AI dependencies for the agent-server image#595

Draft
rajshah4 wants to merge 4 commits into
mainfrom
vertex-agent-server-docs
Draft

docs: document Vertex AI dependencies for the agent-server image#595
rajshah4 wants to merge 4 commits into
mainfrom
vertex-agent-server-docs

Conversation

@rajshah4

Copy link
Copy Markdown
Member

Summary

Vertex AI support (google-cloud-aiplatform) is not included by default in the published agent-server image — it requires the ENABLE_VERTEX build flag (Docker) or the vertex extra (local/uv). This was previously undocumented, leading to cryptic ModuleNotFoundError: No module named 'vertexai' errors for any Vertex AI customer.

This came up while addressing a Red Hat POC objection: Red Hat routes Claude through Google Vertex AI / Model Garden (not direct Anthropic), and there was no documented path for enabling Vertex support across deployment types.

Changes

Adds the following sections to the existing Google Gemini/Vertex provider page (openhands/usage/llms/google-llms.mdx):

  • Vertex AI Dependencies — covers all three deployment contexts:
    • Local / non-Docker install (pip install "openhands-sdk[vertex]" / uv sync --extra vertex)
    • Custom agent-server image (--build-arg ENABLE_VERTEX=1), with a cross-link to the Custom Sandbox Guide
    • OpenHands Enterprise (replicated/K8s) — notes the built-in Vertex config path but flags that the default image still needs Vertex enabled
  • Claude via Vertex AI — the vertex_ai/claude-*@<date> provider string, plus a note about the additional anthropic[vertex] dependency
  • Troubleshooting — the No module named 'vertexai' error and how to resolve it

A <Note> also calls out the asymmetry with AWS Bedrock, whose boto3 dependency is bundled by default — Vertex is the outlier opt-in provider.

Style

Follows the structure of the existing AWS Bedrock provider page (Prerequisites → Configuration → Troubleshooting), uses Mintlify <Note> components, and follows the repo's DOC_STYLE_GUIDE.md (Title Case headers, code blocks for commands, absolute internal link paths).

Notes for reviewers


This PR was created by an AI agent (OpenHands) on behalf of Rajiv Shah.

@rajshah4 can click here to continue refining the PR

Vertex AI support (google-cloud-aiplatform) is not included by default in
the published agent-server image — it requires the ENABLE_VERTEX build
flag (Docker) or the 'vertex' extra (local/uv). This was undocumented,
leading to ModuleNotFoundError errors for Vertex customers.

Adds:
- Vertex AI Dependencies section covering local, custom-Docker, and OHE
  deployments
- Claude via Vertex AI guidance (vertex_ai/claude-*@<date> provider string
  and anthropic[vertex] caveat)
- Troubleshooting for the 'No module named vertexai' error

Follows the structure/style of the existing AWS Bedrock provider page.

Co-authored-by: openhands <openhands@all-hands.dev>
The OHE LLM call path (direct vs. proxied through LiteLLM proxy) was not
verified, so the claim that 'the default agent-server image does not
include Vertex support' may not apply to OHE — the proxy may carry the
Vertex deps. Removing until the OHE architecture is confirmed.

Co-authored-by: openhands <openhands@all-hands.dev>
OHE's default Vertex path routes through a LiteLLM proxy (agent-server uses
litellm_proxy/... model), so the agent-server image does not need Vertex
enabled. ENABLE_VERTEX=1 only matters for direct vertex_ai/* calls bypassing
the proxy.

Co-authored-by: openhands <openhands@all-hands.dev>

all-hands-bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review complete.

This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here.

@mintlify

mintlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
all-hands-ai 🟢 Ready View Preview Jun 26, 2026, 6:19 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Acceptable — addresses a real and common failure mode (ModuleNotFoundError: vertexai), and the new structure is reasonable. Requesting changes because several concrete technical claims in the new sections should be verified against the actual openhands-agent-server Dockerfile and SDK packaging before this lands; if any are wrong, users following the guide will hit new errors instead of getting unstuck.

The three blocking items are:

  1. ENABLE_VERTEX build-arg is not referenced anywhere else in this docs repo, and the path openhands-agent-server/openhands/agent_server/docker/Dockerfile cannot be verified from here — both need to match what the Dockerfile actually accepts.
  2. anthropic[vertex] does not appear to be a real pip extra on the anthropic package; suggesting it will likely yield Could not find a version that satisfies the requirement anthropic[vertex] for users who follow the troubleshooting note.
  3. openhands-sdk[vertex] package + extra name needs to be confirmed against the published SDK.

Two smaller suggestions (non-blocking): the uv sync --extra vertex command will not work for end users outside the openhands source tree, and the Claude example uses a 2-year-old model version.

Detailed inline comments follow.


[RISK ASSESSMENT]

  • Overall PR ⚠️ Risk Assessment: 🟢 LOW
    Docs-only change. No code, no dependency manifest, no runtime behavior change. Worst case if any technical claim is wrong: users waste time debugging before finding the right docs. No security, compliance, or production-risk surface.

VERDICT:
Needs rework: Verify the three concrete technical claims above against the actual source files, then this is a valuable addition.

KEY INSIGHT:
A docs PR that tells users to run a command they cannot reproduce is worse than no doc at all — every command in this section needs to match what the code actually accepts.


Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it's merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.


This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation

Comment thread openhands/usage/llms/google-llms.mdx
Comment thread openhands/usage/llms/google-llms.mdx Outdated
```bash
pip install "openhands-sdk[vertex]"
# or, with uv:
uv sync --extra vertex

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: uv sync only works from inside a project directory whose pyproject.toml declares the vertex extra. End users running OpenHands (rather than hacking on it) will not be in such a directory, so this command will fail with Project directory not found or similar. Either drop the uv variant, or replace it with uv pip install "openhands-sdk[vertex]" which works in any Python environment the same way the pip install line above does.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — replaced uv sync --extra vertex with uv pip install "openhands-sdk[vertex]" (commit 93966ca), which works in any Python environment.

Comment thread openhands/usage/llms/google-llms.mdx
Comment thread openhands/usage/llms/google-llms.mdx
### Claude via Vertex AI

If you route Anthropic Claude through Google Vertex AI / Model Garden (rather than direct
Anthropic endpoints), use the `vertex_ai/` prefix with the Vertex-published model name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Critical: The Anthropic Python SDK does not expose a vertex extras spec — there is no anthropic[vertex] distribution on PyPI. LiteLLM routes Claude-via-Vertex calls through google-cloud-aiplatform (already covered by the vertex extra), not through any anthropic[vertex] package. A user following this note will hit ERROR: Could not find a version that satisfies the requirement anthropic[vertex] and conclude the Vertex setup is broken. Either remove this paragraph entirely, or replace it with the actual LiteLLM-recommended install command (typically just google-cloud-aiplatform, possibly with the anthropic SDK itself for some LiteLLM code paths).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushing back on this one — anthropic[vertex] is a real PyPI extra. Verified directly against the published wheel METADATA:

Provides-Extra: vertex
Requires-Dist: google-auth[requests]<3,>=2; extra == 'vertex'

pip install "anthropic[vertex]" resolves successfully (tested against anthropic 0.112.0). The note stands, since Claude-via-Vertex historically surfaced ModuleNotFoundError: No module named 'anthropic' (OpenHands/OpenHands#3505) when only google-cloud-aiplatform was present.

Comment thread openhands/usage/llms/google-llms.mdx
- Replace uv sync --extra vertex with uv pip install (works outside source tree)
- Add link to the agent-server Dockerfile and clarify repo-root working dir
- Update Claude example to claude-sonnet-4-5@20250929 (current model)

Kept anthropic[vertex] note — verified it IS a real PyPI extra
(Provides-Extra: vertex -> google-auth[requests] in anthropic wheel METADATA).

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants