{"record":{"id":"4d1afece6d9eac0f","repo":"chroma-core/chroma","slug":"updating-key-is-not-supported-for-chroma-cloud","errorCode":null,"errorMessage":"Updating '{key}' is not supported for chroma-cloud-splade","messagePattern":"Updating '(.+?)' is not supported for chroma-cloud-splade","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/utils/embedding_functions/chroma_cloud_splade_embedding_function.py","lineNumber":175,"sourceCode":"            api_key_env_var=api_key_env_var,\n            model=ChromaCloudSpladeEmbeddingModel(model),\n            include_tokens=config.get(\"include_tokens\", False),\n        )\n\n    def get_config(self) -> Dict[str, Any]:\n        return {\n            \"api_key_env_var\": self.api_key_env_var,\n            \"model\": self.model.value,\n            \"include_tokens\": self.include_tokens,\n        }\n\n    def validate_config_update(\n        self, old_config: Dict[str, Any], new_config: Dict[str, Any]\n    ) -> None:\n        immutable_keys = {\"include_tokens\", \"model\"}\n        for key in immutable_keys:\n            if key in new_config and new_config[key] != old_config.get(key):\n                raise ValueError(\n                    f\"Updating '{key}' is not supported for chroma-cloud-splade\"\n                )\n\n    @staticmethod\n    def validate_config(config: Dict[str, Any]) -> None:\n        validate_config_schema(config, \"chroma-cloud-splade\")\n","sourceCodeStart":157,"sourceCodeEnd":182,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/utils/embedding_functions/chroma_cloud_splade_embedding_function.py#L157-L182","documentation":"validate_config_update for chroma-cloud-splade iterates over the immutable keys {'include_tokens', 'model'} and raises ValueError when such a key is present in new_config with a value different from old_config. Unlike the Qwen function (presence alone triggers), SPLADE only rejects actual value changes — you may resend the same model/include_tokens harmlessly.","triggerScenarios":"An EF config update where new_config['model'] != old_config['model'] or new_config['include_tokens'] != old_config['include_tokens'], e.g. switching include_tokens from false to true, or swapping prithivida/Splade_PP_en_v1 for another model.","commonSituations":"Trying to enable token fetching (include_tokens) on an existing collection; model migrations attempted via config edit; diffs computed against a stale old_config making equal values look different.","solutions":["Revert the changed value, or omit 'model'/'include_tokens' from the update if unchanged.","To change include_tokens or model, build a new ChromaCloudSpladeEmbeddingFunction and a new collection (vector comparability requires it).","When diffing configs, compare against the collection's current get_config() output so identical values are not flagged."],"exampleFix":"# before\nnew_config = {\"include_tokens\": True}  # old had False -> ValueError\n\n# after: recreate with the setting you need\nfrom chromadb.utils.embedding_functions import ChromaCloudSpladeEmbeddingFunction, ChromaCloudSpladeEmbeddingModel\nef = ChromaCloudSpladeEmbeddingFunction(\n    api_key_env_var=\"CHROMA_API_KEY\",\n    model=ChromaCloudSpladeEmbeddingModel.SPLADE_PP_EN_V1,\n    include_tokens=True,\n)\ncol2 = client.create_collection(\"docs_v2\", embedding_function=ef)","handlingStrategy":"validation","validationCode":"for key in (\"model\", \"include_tokens\"):\n    if key in new_config and new_config[key] != old_config.get(key):\n        raise ValueError(\n            f\"{key} is immutable for chroma-cloud-splade; recreate the collection to change it\"\n        )","typeGuard":"def is_safe_splade_update(old: dict, new: dict) -> bool:\n    return all(new.get(k) == old.get(k) for k in (\"model\", \"include_tokens\") if k in new)","tryCatchPattern":null,"preventionTips":["Diff updates against the collection's live get_config(), not a cached copy.","Decide include_tokens at collection creation; treat it as part of the schema.","Omit unchanged immutable keys from update payloads entirely."],"tags":["chroma-cloud","splade","immutable-config","config-validation","sparse-embeddings"],"backgroundTag":"immutable-config-update","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}