{"record":{"id":"d2d350774b77a0d6","repo":"BerriAI/litellm","slug":"quantization-config-must-be-one-of-scalar-bina","errorCode":null,"errorMessage":"Quantization config must be one of 'scalar', 'binary' or 'product'","messagePattern":"Quantization config must be one of 'scalar', 'binary' or 'product'","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/caching/qdrant_semantic_cache.py","lineNumber":125,"sourceCode":"            quantization_params: dict[str, Any]\n            if quantization_config is None or quantization_config == \"binary\":\n                quantization_params = {\n                    \"binary\": {\n                        \"always_ram\": False,\n                    }\n                }\n            elif quantization_config == \"scalar\":\n                quantization_params = {\n                    \"scalar\": {\n                        \"type\": \"int8\",\n                        \"quantile\": QDRANT_SCALAR_QUANTILE,\n                        \"always_ram\": False,\n                    }\n                }\n            elif quantization_config == \"product\":\n                quantization_params = {\"product\": {\"compression\": \"x16\", \"always_ram\": False}}\n            else:\n                raise Exception(\"Quantization config must be one of 'scalar', 'binary' or 'product'\")\n\n            new_collection_status: Final = self.sync_client.put(\n                url=f\"{self.qdrant_api_base}/collections/{self.collection_name}\",\n                json={\n                    \"vectors\": {\"size\": self.vector_size, \"distance\": \"Cosine\"},\n                    \"quantization_config\": quantization_params,\n                },\n                headers=self.headers,\n            )\n            if new_collection_status.json()[\"result\"]:\n                collection_details = self.sync_client.get(\n                    url=f\"{self.qdrant_api_base}/collections/{self.collection_name}\",\n                    headers=self.headers,\n                )\n                self.collection_info = collection_details.json()\n                print_verbose(f\"New collection created.\\nCollection details:{self.collection_info}\")\n                self._ensure_cache_key_payload_index()\n            else:","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/caching/qdrant_semantic_cache.py#L107-L143","documentation":"QdrantSemanticCache.__init__ validates the quantization_config argument: only 'binary', 'scalar' and 'product' map to Qdrant quantization_params, so any other string (or mis-typed value) reaches this guard and aborts cache setup.","triggerScenarios":"Thrown at litellm/caching/qdrant_semantic_cache.py:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the quantization config to one of 'scalar', 'binary' or 'product'.","Remove the quantization config to use Qdrant defaults."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}