chroma-core/chroma · error · ValueError
Unsupported encoding
Error message
Unsupported encoding: {encoding.value} What it means
Raised by encode_vector when the requested ScalarEncoding is neither FLOAT32 nor INT32. This is a sentinel guard at the end of the encoding branch chain: it fires only if a new/unknown encoding enum value is passed, indicating an encoding this ingest path does not support.
Solutions
- Encode vectors as FLOAT32 or INT32
- Convert other encodings to a supported dtype before calling encode_vector
- Add a serialization branch if a new encoding must be supported
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at chromadb/ingest/__init__.py:23 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/68bd7825c6681076.
Report an issue: GitHub.
Appendix: source
Thrown at chromadb/ingest/__init__.py:23
LogRecord,
SeqId,
Vector,
ScalarEncoding,
)
from chromadb.config import Component
from uuid import UUID
import numpy as np
def encode_vector(vector: Vector, encoding: ScalarEncoding) -> bytes:
"""Encode a vector into a byte array."""
if encoding == ScalarEncoding.FLOAT32:
return np.array(vector, dtype=np.float32).tobytes()
elif encoding == ScalarEncoding.INT32:
return np.array(vector, dtype=np.int32).tobytes()
else:
raise ValueError(f"Unsupported encoding: {encoding.value}")
def decode_vector(vector: bytes, encoding: ScalarEncoding) -> Vector:
"""Decode a byte array into a vector"""
if encoding == ScalarEncoding.FLOAT32:
return np.frombuffer(vector, dtype=np.float32)
elif encoding == ScalarEncoding.INT32:
return np.frombuffer(vector, dtype=np.float32)
else:
raise ValueError(f"Unsupported encoding: {encoding.value}")
class Producer(Component):
"""Interface for writing embeddings to an ingest stream"""
@abstractmethod
def delete_log(self, collection_id: UUID) -> None:View on GitHub (pinned to aecdd12c8a)