Skip to content

fix(openrouter): support embeddings#641

Merged
mikehostetler merged 2 commits into
mainfrom
fix/openrouter-embeddings
Apr 24, 2026
Merged

fix(openrouter): support embeddings#641
mikehostetler merged 2 commits into
mainfrom
fix/openrouter-embeddings

Conversation

@mikehostetler
Copy link
Copy Markdown
Contributor

Summary

  • enable OpenRouter embedding requests by using the default OpenAI-compatible embedding request path
  • pass embedding-specific options (dimensions, encoding_format, input_type) through the OpenRouter request body
  • add provider-level coverage and public Embedding.embed/3 coverage using an inline OpenRouter model spec

Validation

  • mix test test/providers/openrouter_test.exs test/req_llm/embedding_test.exs
  • mix test
  • mix quality
  • live OpenRouter smoke with .env key: openai/text-embedding-3-small, dimensions: 16, returned vector length 16 and usage

Notes

Refs #640. ReqLLM can now use OpenRouter embeddings with an explicit model spec. The local llm_db dependency still lacks OpenRouter embedding catalog entries because OpenRouter exposes those through /api/v1/embeddings/models, while the current source uses /api/v1/models.

@mikehostetler mikehostetler merged commit 361ce84 into main Apr 24, 2026
7 checks passed
@mikehostetler mikehostetler deleted the fix/openrouter-embeddings branch April 24, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant