[GH-ISSUE #2575] [FEAT]: Application Default Credentials on Gemini #1669

Open
opened 2026-02-22 18:25:58 -05:00 by yindo · 0 comments
Owner

Originally created by @Stono on GitHub (Nov 3, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2575

What would you like to see?

The vast majority of google libraries support ADC for transparent auth. That also means they just "work" when running locally, or deployed as applications on GKE using Workload Identity.

Not needing to create secrets which then require storage, sharing between devs, and rotation is a huge win.

I did have a quick look at the code but it looks like the app is using @google/generative-ai which doesn't support ADC (no clue why - the hopscotch of google libraries always confuses me): https://github.com/google-gemini/generative-ai-js/issues/289.

The @google-cloud/vertexai does, so the app could pivot to that. That's the library I used to use (i now just make rest calls to https://europe-west4-aiplatform.googleapis.com/v1/projects/${projectId}/locations/europe-west4/publishers/google/models/${model}:predict to avoid pulling in all the transitive dependencies of the google library, although that would then break existing users as that doesn't support api keys.

Switching the library would have other benefits too for example being able to target specific regions or zones for those more concerns about data processing locations. The @google/generative-ai library looks super restrictive tbh.

Maybe it'd need to be a new API integration (Vertex) 🤷

Originally created by @Stono on GitHub (Nov 3, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2575 ### What would you like to see? The vast majority of google libraries support ADC for transparent auth. That also means they just "work" when running locally, or deployed as applications on GKE using Workload Identity. Not needing to create secrets which then require storage, sharing between devs, and rotation is a huge win. I did have a quick look at the code but it looks like the app is using `@google/generative-ai` which doesn't support ADC (no clue why - the hopscotch of google libraries always confuses me): https://github.com/google-gemini/generative-ai-js/issues/289. The [@google-cloud/vertexai](https://www.npmjs.com/package/@google-cloud/vertexai) does, so the app could pivot to that. That's the library I used to use (i now just make rest calls to `https://europe-west4-aiplatform.googleapis.com/v1/projects/${projectId}/locations/europe-west4/publishers/google/models/${model}:predict` to avoid pulling in all the transitive dependencies of the google library, although that would then break existing users as that doesn't support api keys. Switching the library would have other benefits too for example being able to target specific regions or zones for those more concerns about data processing locations. The `@google/generative-ai` library looks super restrictive tbh. Maybe it'd need to be a new API integration (`Vertex`) 🤷
yindo added the enhancementfeature request labels 2026-02-22 18:25:58 -05:00
yindo changed title from [FEAT]: Application Default Credentials on Gemini to [GH-ISSUE #2575] [FEAT]: Application Default Credentials on Gemini 2026-06-05 14:42:02 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1669