From 508a0331748b92aaea594dbb3a52d7999477f516 Mon Sep 17 00:00:00 2001 From: Asankhaya Sharma Date: Wed, 26 Nov 2025 08:07:52 +0800 Subject: [PATCH 1/2] Update embedding.py --- openevolve/embedding.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openevolve/embedding.py b/openevolve/embedding.py index 74d3c57ab..4016bd4b3 100644 --- a/openevolve/embedding.py +++ b/openevolve/embedding.py @@ -40,7 +40,10 @@ def __init__( def _get_client_model(self, model_name: str) -> tuple[openai.OpenAI, str]: if model_name in OPENAI_EMBEDDING_MODELS: - client = openai.OpenAI() + # Use OPENAI_EMBEDDING_API_KEY if set, otherwise fall back to OPENAI_API_KEY + # This allows users to use OpenRouter for LLMs while using OpenAI for embeddings + embedding_api_key = os.getenv("OPENAI_EMBEDDING_API_KEY") or os.getenv("OPENAI_API_KEY") + client = openai.OpenAI(api_key=embedding_api_key) model_to_use = model_name elif model_name in AZURE_EMBEDDING_MODELS: # get rid of the azure- prefix From 5f4fb9d9e616047f8049072282bcadd18bc560f1 Mon Sep 17 00:00:00 2001 From: Asankhaya Sharma Date: Wed, 26 Nov 2025 08:07:59 +0800 Subject: [PATCH 2/2] Update _version.py --- openevolve/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openevolve/_version.py b/openevolve/_version.py index ddad2c119..858741097 100644 --- a/openevolve/_version.py +++ b/openevolve/_version.py @@ -1,3 +1,3 @@ """Version information for openevolve package.""" -__version__ = "0.2.21" +__version__ = "0.2.22"