Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openevolve/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version information for openevolve package."""

__version__ = "0.2.21"
__version__ = "0.2.22"
5 changes: 4 additions & 1 deletion openevolve/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down