feat(gateway): serve embedding models from OpenRouter#3109
Open
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
Open
feat(gateway): serve embedding models from OpenRouter#3109kilo-code-bot[bot] wants to merge 2 commits intomainfrom
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
Conversation
Make /api/gateway/embedding-models proxy the live OpenRouter catalog (output_modalities=embeddings) so clients see all supported embedding models, mirroring the existing /api/gateway/models endpoint for language models.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by gpt-5.5-2026-04-23 · 159,355 tokens |
Importing jest from @jest/globals interferes with module auto-mocking under SWC, leaving the mocked function as the real implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #3099. The
/api/gateway/embedding-modelsendpoint now proxies the live OpenRouter catalog (output_modalities=embeddings) instead of returning a hardcoded list, mirroring the existing/api/gateway/modelsendpoint for language models. Clients now see every embedding model OpenRouter exposes (Gemini, Perplexity, Qwen, BAAI, Sentence Transformers, etc.) without us shipping a new release each time the catalog changes.getOpenRouterEmbeddingModels()inapps/web/src/lib/ai-gateway/providers/openrouter/index.tsthat fetches${OPENROUTER}/models?output_modalities=embeddings, validates withOpenRouterModelsResponseSchema, and reuses the existing attribution headers and Sentry plumbing.apps/web/src/app/api/gateway/embedding-models/route.tsto call that helper and return the OpenRouter response shape ({ data: [...] }), with a 500 + Sentry capture on failure.Verification
curl http://localhost:3000/api/gateway/embedding-modelsreturns the live OpenRouter embeddings catalog.Visual Changes
N/A
Reviewer Notes
{ defaultModel, models, aliases }catalog to the standardOpenRouterModelsResponse({ data: OpenRouterModel[] }) used by/api/gateway/models. Any client still relying on the old shape (e.g. the bundled fallback in the kilocode indexing PR) should be updated in lockstep.next.revalidatecaching that the language-models endpoint uses.apps/web/src/lib/ai-gateway/embeddings/kilo-embedding-models.tsis untouched; it is still consumed byapps/web/src/app/(app)/claw/components/embeddingModels.tsand other internal call sites and can be retired in a separate change once those move to the live endpoint.