chroma-core/chroma · error · ValueError

Keyword argument {key} is not a primitive type

Error message

Keyword argument {key} is not a primitive type

What it means

Error "Keyword argument {key} is not a primitive type" thrown in chroma-core/chroma.

Source

Thrown at chromadb/utils/embedding_functions/huggingface_sparse_embedding_function.py:56

            Some common models: prithivida/Splade_PP_en_v1, naver/splade-cocondenser-ensembledistil, naver/splade-v3
            device (str, optional): Device used for computation
            **kwargs: Additional arguments to pass to the Splade model.
        """
        try:
            from sentence_transformers import SparseEncoder
        except ImportError:
            raise ValueError(
                "The sentence_transformers python package is not installed. Please install it with `pip install sentence_transformers`"
            )

        self.model_name = model_name
        self.device = device
        self.task = task
        self.query_config = query_config
        validate_embedding_function_kwargs_are_safe(kwargs)
        for key, value in kwargs.items():
            if not isinstance(value, (str, int, float, bool, list, dict, tuple)):
                raise ValueError(f"Keyword argument {key} is not a primitive type")
        self.kwargs = kwargs

        if model_name not in self.models:
            self.models[model_name] = SparseEncoder(
                model_name_or_path=model_name, device=device, **kwargs
            )
        self._model = self.models[model_name]

    def __call__(self, input: Documents) -> SparseVectors:
        """Generate embeddings for the given documents.

        Args:
            input: Documents to generate embeddings for.

        Returns:
            Embeddings for the documents.
        """
        try:

View on GitHub (pinned to aecdd12c8a)

When it happens

Trigger: Thrown at chromadb/utils/embedding_functions/huggingface_sparse_embedding_function.py:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/b7d08da600b5f53c. Report an issue: GitHub.