HybridRouter
. This can leverage the strengths of both encoding methods:
Encoder | Description | Installation |
---|---|---|
OpenAIEncoder | Uses OpenAI’s text embedding models | pip install -qU semantic-router |
AzureOpenAIEncoder | Uses Azure OpenAI’s text embedding models | pip install -qU semantic-router |
CohereEncoder | Uses Cohere’s text embedding models | pip install -qU semantic-router |
HuggingFaceEncoder | Uses local Hugging Face models | pip install -qU "semantic-router[local]" |
HFEndpointEncoder | Uses Hugging Face Inference API | pip install -qU semantic-router |
FastEmbedEncoder | Uses FastEmbed for local embeddings | pip install -qU "semantic-router[local]" |
MistralEncoder | Uses Mistral’s text embedding models | pip install -qU semantic-router |
GoogleEncoder | Uses Google’s text embedding models | pip install -qU semantic-router |
BedrockEncoder | Uses AWS Bedrock embedding models | pip install -qU semantic-router |
VitEncoder | Vision Transformer for image embeddings | pip install -qU semantic-router |
CLIPEncoder | Uses CLIP for image embeddings | pip install -qU semantic-router |
Encoder | Description | Installation |
---|---|---|
BM25Encoder | Implements BM25 algorithm for sparse embeddings | pip install -qU semantic-router |
TfidfEncoder | Implements TF-IDF for sparse embeddings | pip install -qU semantic-router |
AurelioSparseEncoder | Uses Aurelio’s API for BM25 sparse embeddings | pip install -qU semantic-router |
LocalSparseEncoder | Uses local sentence-transformers SPLADE/CSR models for neural sparse embeddings | pip install -qU "semantic-router[local]" |
AutoEncoder
class that automatically selects the appropriate encoder based on the specified type: