AI GitHub
FlagEmbedding for BGE retrieval models
Evaluate and use embedding and reranking models from the BGE family.
Key Takeaways
- The repository provides model usage and training examples for embedding and reranking.
- Start with the model card for the BGE variant, including query instructions and sequence limits.
- Compare two supported model configurations on a labeled question set.
- Different model variants serve different languages and tasks.
How it works
The repository provides model usage and training examples for embedding and reranking. Some checkpoints use specific query instructions or offer several types of retrieval representations.
What you need
Start with the model card for the BGE variant, including query instructions and sequence limits. A dense encoder, sparse model and reranker produce different kinds of outputs.
What to try first
Compare two supported model configurations on a labeled question set. Check whether the model expects an instruction prefix and hold the document text fixed.
Keep one test set in each language you serve. A better aggregate result can conceal a regression in a language with fewer examples.
Where to look for failures
Different model variants serve different languages and tasks. Read the exact model card and keep track of indexing changes before switching variants.
Related Franklin pages
Check whether the task needs a library inside the app or a separate model endpoint. Preserve query formatting, checkpoint and vector dimensions when comparing either deployment.
- Encode inputs for semantic search or score query-document pairs with a cross-encoder. Sentence Transformers for embeddings and reranking
- Expose supported embedding and reranking models through a dedicated inference service. Text Embeddings Inference for serving embedding models
For the role of the encoder in a search stack, read Franklin’s model guide. Embedding models
Project documentation
Try it for your workflow
Explore the project’s documentation for setup and usage, or save this page to a collection for later.
Read the project documentation ↗