huggingface / huggingface/Microsoft-Azure

BGE-M3 on Azure AI Foundry appears to expose dense embeddings only; need guidance for sparse lexical_weights support

Open
#79 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Makefile
Stars
16
Forks
6
PR merge metrics
No merged PRs in 30d

Description

We are evaluating BAAI/bge-m3 on Azure AI Foundry / Azure ML for a production hybrid retrieval workload.

BGE-M3 natively supports dense retrieval, sparse retrieval, and multi-vector retrieval through FlagEmbedding. For example:

```python
from FlagEmbedding import BGEM3FlagModel

model = BGEM3FlagModel("BAAI/bge-m3", use_fp16=True)

output = model.encode(
texts,
return_dense=True,
return_sparse=True,
return_colbert_vecs=False,
)

dense_vecs = output["dense_vecs"]
lexical_weights = output["lexical_weights"]
```

However, the Azure AI Foundry-hosted deployment appears to expose only dense embedding output through the standard embedding endpoint. We have not found a documented way to request lexical_weights / sparse output.

**Questions:**
1. Does the Azure AI Foundry deployment path for BGE-M3 support sparse embeddings / lexical weights?
2. If yes, what request schema or configuration enables return_sparse=True behavior?
3. If no, is the recommended Azure pattern to deploy BGE-M3 via Azure ML managed online endpoint with a custom score.py?
4. Is there an official sample showing BGE-M3 dense + sparse output on Azure ML / Foundry managed compute?

Contributor guide

Open the contributing guide

Research direction

Start by checking the standard Azure AI Foundry embedding endpoint and the Azure ML managed online endpoint with the BGE-M3 FlagEmbedding example in the issue. Determine whether sparse lexical_weights output is supported and whether custom score.py is required. Done means documenting the supported request schema or configuration, the recommended deployment path, and an official dense-plus-sparse sample if one exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
cloud, documentation, machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.