Skip to content

feat: add list_embedding_models_async to OpenRouterProvider - #3089

Open
majiayu000 wants to merge 1 commit into
letta-ai:mainfrom
majiayu000:fix/openrouter-embedding-models
Open

feat: add list_embedding_models_async to OpenRouterProvider#3089
majiayu000 wants to merge 1 commit into
letta-ai:mainfrom
majiayu000:fix/openrouter-embedding-models

Conversation

@majiayu000

Copy link
Copy Markdown

Summary

  • Add list_embedding_models_async() method to OpenRouterProvider class
  • Return hardcoded EmbeddingConfig objects for OpenAI embedding models supported by OpenRouter
  • Add unit tests for the new functionality

Problem

When using OpenRouter as an LLM provider, Letta cannot discover embedding models because OpenRouter's /models endpoint only returns LLM models, not embedding models.

Current behavior:

  • Only letta/letta-free embedding model appears in the UI/API
  • OpenRouter embedding models (e.g., openai/text-embedding-3-small) are not discoverable

Root cause:
OpenRouter's /models endpoint doesn't list embedding models, but they support OpenAI's embedding models via the /embeddings endpoint.

Solution

Added list_embedding_models_async() method to OpenRouterProvider class that returns hardcoded EmbeddingConfig objects for:

  • openai/text-embedding-3-small (1536 dimensions)
  • openai/text-embedding-3-large (3072 dimensions)

Test plan

  • Added unit test test_openrouter_embedding_models_without_api_key that verifies embedding models are returned correctly without making API calls
  • Added integration test test_openrouter (requires OPENROUTER_API_KEY)

Fixes #3086

OpenRouter's /models endpoint doesn't list embedding models, but they
support OpenAI's embedding models via the /embeddings endpoint. This
change adds hardcoded EmbeddingConfig objects for the known supported
models (text-embedding-3-small and text-embedding-3-large).

Fixes letta-ai#3086
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenRouterProvider missing list_embedding_models_async() - embedding models not discovered

1 participant