Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:FlagOpen FlagEmbedding Package Installation

From Leeroopedia


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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment