Skip to content

[FEAT]: Application Default Credentials on Gemini #2575

Open
@Stono

Description

@Stono

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): google-gemini/deprecated-generative-ai-js#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) 🤷

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions