[GH-ISSUE #310] How to provide Google Vertex AI API key in the .env file #98

Open
opened 2026-06-06 22:09:07 -04:00 by yindo · 3 comments
Owner

Originally created by @lethalcyanide on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/310

Hi Team,

I have tried multiple methods of adding Anthropic's Claude models Vertex AI keys but the application couldn't parse it. Please help me on this configuration.

Originally created by @lethalcyanide on GitHub (May 12, 2026). Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/310 Hi Team, I have tried multiple methods of adding Anthropic's Claude models Vertex AI keys but the application couldn't parse it. Please help me on this configuration.
Author
Owner

@asdek commented on GitHub (May 29, 2026):

hey @lethalcyanide

Vertext AI is not supported now, to connect this provider try to use LiteLLM a front of PentAGI and custom provider type on PentAGI side to connect to LiteLLM.

<!-- gh-comment-id:4580536282 --> @asdek commented on GitHub (May 29, 2026): hey @lethalcyanide Vertext AI is not supported now, to connect this provider try to use LiteLLM a front of PentAGI and custom provider type on PentAGI side to connect to LiteLLM.
Author
Owner

@mrigankad commented on GitHub (May 31, 2026):

Hi @lethalcyanide — thanks for the question.

Native Google Vertex AI is not currently a supported provider. The supported provider types are: openai, anthropic, gemini, bedrock, ollama, custom, deepseek, glm, kimi, qwen (see backend/pkg/providers/provider/provider.go). A few notes specific to Google/Anthropic:

  • GEMINI_API_KEY / GEMINI_SERVER_URL target Google AI Studio (https://generativelanguage.googleapis.com), not Vertex AI — they don't accept Vertex project credentials.
  • ANTHROPIC_API_KEY / ANTHROPIC_SERVER_URL target the direct Anthropic API, not Claude-via-Vertex.

So there is no .env key that takes a Vertex AI key directly today.

Recommended workaround: the custom (OpenAI-compatible) provider via a proxy

PentAGI ships a custom provider that talks to any OpenAI-compatible /chat/completions + /models endpoint. Front Vertex AI with a proxy such as LiteLLM (which natively supports both Gemini and Claude on Vertex) and point the custom provider at it:

# .env — custom LLM provider
LLM_SERVER_URL=http://your-litellm-proxy:4000/v1
LLM_SERVER_KEY=<your-proxy-key>
LLM_SERVER_MODEL=<model-id-as-exposed-by-proxy>
LLM_SERVER_PROVIDER=custom
# optional: a JSON file mapping agent roles -> models
LLM_SERVER_CONFIG_PATH=

Your Vertex credentials (service-account JSON / GOOGLE_APPLICATION_CREDENTIALS, project, region) live in the proxy configuration, not in PentAGI. The proxy handles auth and exposes plain OpenAI-style endpoints that PentAGI consumes.

If you want native Vertex support

That would be a new provider (vertex) implementing the provider.Provider interface plus registration/config/migration wiring. If that's of interest, it's worth opening a separate enhancement issue so maintainers can scope it — happy to help there.

Would the LiteLLM-proxy route work for your setup?

<!-- gh-comment-id:4585693219 --> @mrigankad commented on GitHub (May 31, 2026): Hi @lethalcyanide — thanks for the question. **Native Google Vertex AI is not currently a supported provider.** The supported provider types are: `openai`, `anthropic`, `gemini`, `bedrock`, `ollama`, `custom`, `deepseek`, `glm`, `kimi`, `qwen` (see `backend/pkg/providers/provider/provider.go`). A few notes specific to Google/Anthropic: - `GEMINI_API_KEY` / `GEMINI_SERVER_URL` target **Google AI Studio** (`https://generativelanguage.googleapis.com`), **not** Vertex AI — they don't accept Vertex project credentials. - `ANTHROPIC_API_KEY` / `ANTHROPIC_SERVER_URL` target the **direct Anthropic API**, not Claude-via-Vertex. So there is no `.env` key that takes a Vertex AI key directly today. ### Recommended workaround: the `custom` (OpenAI-compatible) provider via a proxy PentAGI ships a `custom` provider that talks to any OpenAI-compatible `/chat/completions` + `/models` endpoint. Front Vertex AI with a proxy such as [LiteLLM](https://docs.litellm.ai/docs/providers/vertex) (which natively supports both Gemini and Claude on Vertex) and point the custom provider at it: ```dotenv # .env — custom LLM provider LLM_SERVER_URL=http://your-litellm-proxy:4000/v1 LLM_SERVER_KEY=<your-proxy-key> LLM_SERVER_MODEL=<model-id-as-exposed-by-proxy> LLM_SERVER_PROVIDER=custom # optional: a JSON file mapping agent roles -> models LLM_SERVER_CONFIG_PATH= ``` Your Vertex credentials (service-account JSON / `GOOGLE_APPLICATION_CREDENTIALS`, project, region) live in the **proxy** configuration, not in PentAGI. The proxy handles auth and exposes plain OpenAI-style endpoints that PentAGI consumes. ### If you want native Vertex support That would be a new provider (`vertex`) implementing the `provider.Provider` interface plus registration/config/migration wiring. If that's of interest, it's worth opening a separate **enhancement** issue so maintainers can scope it — happy to help there. Would the LiteLLM-proxy route work for your setup?
Author
Owner

@mrigankad commented on GitHub (May 31, 2026):

Opened #321 to track native Vertex AI provider support as a scoped enhancement (with an implementation plan following the repo's "Adding a New LLM Provider" checklist). The LiteLLM-proxy workaround above remains the path until that lands.

<!-- gh-comment-id:4585698697 --> @mrigankad commented on GitHub (May 31, 2026): Opened #321 to track native Vertex AI provider support as a scoped enhancement (with an implementation plan following the repo's "Adding a New LLM Provider" checklist). The LiteLLM-proxy workaround above remains the path until that lands.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#98