Summary
FlagEmbedding (BAAI's "BGE" retrieval toolkit) is a widely-used official embeddings/reranking execution library distinct from the already-instrumented local-inference libraries in this repo (sentence-transformers and huggingface_hub — per repo survey, only these two cover local/embedding execution today). FlagEmbedding ships its own model-loading and execution API (FlagModel, FlagReranker, FlagLLMReranker, FlagICLModel) that is not a thin layer over sentence-transformers or transformers.pipeline, and is not touched by either existing integration.
What needs to be instrumented
FlagModel.encode(sentences, ...) / FlagModel.encode_queries(...) / FlagModel.encode_corpus(...) — dense embedding execution
FlagReranker.compute_score(sentence_pairs, ...) — cross-encoder reranking execution
FlagLLMReranker.compute_score(...) and FlagICLModel.compute_score(...) — LLM-based reranker variants
- Batch execution should log input count/shape and output as a compact span (per the embedding feature spec: one span per request, never log raw vectors), plus model name/checkpoint metadata
Weekly downloads
Weekly downloads: 128,075 (as of 2026-09-07; https://pypistats.org/packages/flagembedding)
Braintrust docs status
not_found — checked https://www.braintrust.dev/docs/integrations and https://www.braintrust.dev/docs/guides/tracing/integrations; neither lists FlagEmbedding/BAAI/BGE.
Upstream sources
Local repo files inspected
py/src/braintrust/integrations/ — no flagembedding/ directory (checked all 27 existing integration directories, including transformers/ and huggingface_hub/, neither of which reference FlagEmbedding)
py/pyproject.toml [tool.braintrust.matrix] — no flagembedding entry
py/noxfile.py — no test_flagembedding session
py/src/braintrust/integrations/versioning.py — no mention
- Repo-wide case-insensitive grep for
flagembedding under py/src/braintrust/ — zero matches
Summary
FlagEmbedding(BAAI's "BGE" retrieval toolkit) is a widely-used official embeddings/reranking execution library distinct from the already-instrumented local-inference libraries in this repo (sentence-transformersandhuggingface_hub— per repo survey, only these two cover local/embedding execution today). FlagEmbedding ships its own model-loading and execution API (FlagModel,FlagReranker,FlagLLMReranker,FlagICLModel) that is not a thin layer oversentence-transformersortransformers.pipeline, and is not touched by either existing integration.What needs to be instrumented
FlagModel.encode(sentences, ...)/FlagModel.encode_queries(...)/FlagModel.encode_corpus(...)— dense embedding executionFlagReranker.compute_score(sentence_pairs, ...)— cross-encoder reranking executionFlagLLMReranker.compute_score(...)andFlagICLModel.compute_score(...)— LLM-based reranker variantsWeekly downloads
Weekly downloads: 128,075 (as of 2026-09-07; https://pypistats.org/packages/flagembedding)
Braintrust docs status
not_found— checked https://www.braintrust.dev/docs/integrations and https://www.braintrust.dev/docs/guides/tracing/integrations; neither listsFlagEmbedding/BAAI/BGE.Upstream sources
Local repo files inspected
py/src/braintrust/integrations/— noflagembedding/directory (checked all 27 existing integration directories, includingtransformers/andhuggingface_hub/, neither of which reference FlagEmbedding)py/pyproject.toml[tool.braintrust.matrix]— noflagembeddingentrypy/noxfile.py— notest_flagembeddingsessionpy/src/braintrust/integrations/versioning.py— no mentionflagembeddingunderpy/src/braintrust/— zero matches