#7787·chroma

[Bug]: FastEmbed sparse model options reach incorrect constructor parameters

Author: HuaTNACreated Sep 23, 2026Updated Sep 23, 2026

What happened?

FastembedSparseEmbeddingFunction forwards its model options positionally to fastembed.SparseTextEmbedding, but FastEmbed has a providers parameter between threads and cuda. This shifts three options: Chroma's cuda reaches providers, device_ids reaches cuda, and lazy_load reaches device_ids. FastEmbed's lazy_load stays at its default.

Passing an explicit ONNX provider through the supported **kwargs fails immediately:

python
from chromadb.utils.embedding_functions.fastembed_sparse_embedding_function import (
    FastembedSparseEmbeddingFunction,
)

FastembedSparseEmbeddingFunction(
    model_name="prithivida/Splade_PP_en_v1",
    providers=["CPUExecutionProvider"],
    lazy_load=True,
)

Expected: construct the embedding function with the requested provider and lazy-loading setting.

Actual: TypeError: SparseTextEmbedding.__init__() got multiple values for argument 'providers'. This reproduces before any model download or inference.

The same positional mismatch also sends a boolean as device_ids when lazy_load is explicitly set. In local regression tests using real FastEmbed constructors with only model download/loading mocked, setting cuda=True, device_ids=[2, 3], lazy_load=True raises TypeError: 'bool' object is not subscriptable.

Versions

  • Chroma main at 0ca571e2c0a67514ab7a382cec8975b86dff0984 (Python package reports 1.5.9)
  • FastEmbed 0.8.1
  • Python 3.11.15
  • macOS 27.0, arm64

Proposed fix and validation

Pass the declared model options by keyword to SparseTextEmbedding, preserving additional **kwargs. I have a local patch and will link its PR immediately. Eight regression cases cover explicit providers, CUDA/device settings, eager/lazy loading, and configuration restoration. All eight fail before the fix and pass afterward. Related configuration tests also pass.

AI assistance (Codex) was used to investigate, implement, and run the local tests. No real model inference or GPU execution was performed.