Skip to content

Feature Request: Support for Gemini Embedding Models #323

@jay-tau

Description

@jay-tau

Description

I would like to use Google's Gemini embedding models (e.g., gemini-embedding-001) with OpenEvolve. Currently, the EmbeddingClient in openevolve/embedding.py only supports OpenAI and Azure OpenAI models.

Motivation

Gemini embedding models provide a cost-effective (often free) alternative to OpenAI's embeddings. Enabling support for them would allow users to run the framework with lower costs.

Proposed Solution

Modify openevolve/embedding.py to:

  1. Recognize Gemini model names (e.g., gemini-embedding-001).
  2. When a Gemini model is selected, configure the openai client to point to Google's OpenAI-compatible endpoint: https://generativelanguage.googleapis.com/v1beta/openai/.
  3. Use GEMINI_API_KEY or GOOGLE_API_KEY for authentication.

Example Configuration

Users should be able to set:

database:
  embedding_model: "gemini-embedding-001"

And have it work seamlessly provided the API key is set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions