Skip to content

Google Gemini embedder

Embeds through Google Gemini via its OpenAI-compatible endpoint. Selected via EMBEDDING_PROVIDER=gemini.

Enable it

bash
EMBEDDING_PROVIDER=gemini
GEMINI_API_KEY=...
EMBEDDING_DIMS=768

Configuration

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiSet to gemini.
GEMINI_API_KEYnoneAPI key for Gemini. GOOGLE_API_KEY is accepted as a fallback. Calls fail at runtime if neither is set.
GOOGLE_API_KEYnoneAlternative key read when GEMINI_API_KEY is unset.
EMBEDDING_DIMS768Vector dimension; must match the embedding model.

Notes

  • Talks to the OpenAI-compatible base URL https://generativelanguage.googleapis.com/v1beta/openai.
  • The default model is text-embedding-004.
  • Shares the OpenAI-compatible request loop: 429 and 5xx and network errors retry with backoff, other 4xx fail fast, and a final failure raises for a clean 503.

The memory layer for AI agents.