Principle:FlagOpen FlagEmbedding Package Installation
| Field | Value |
|---|---|
| sources | Repo: FlagOpen/FlagEmbedding https://github.com/FlagOpen/FlagEmbedding |
| domains | Information_Retrieval, NLP |
| last_updated | 2026-02-09 00:00 GMT |
Overview
A principle for setting up the FlagEmbedding library environment with required dependencies for embedding and reranking workflows.
Description
FlagEmbedding is installed via pip. The base package includes the following core dependencies: torch, transformers, datasets, accelerate, sentence_transformers, peft, ir-datasets, sentencepiece, and protobuf. The [finetune] extra adds deepspeed and flash-attn for distributed training and memory-efficient attention computation.
Usage
When setting up a Python environment for BGE embedding/reranking inference or fine-tuning.
Theoretical Basis
Package management ensures reproducible environments across development and production systems. FlagEmbedding follows the pip-installable standard with optional extras for different use cases. The base installation provides everything needed for inference, while the [finetune] extra extends the environment with tools required for distributed training workflows (DeepSpeed for multi-GPU/multi-node training, FlashAttention for efficient attention computation). This separation of concerns keeps the base install lightweight while enabling advanced functionality on demand.
Related Pages
Implementation:FlagOpen_FlagEmbedding_Pip_Install_FlagEmbedding