Skip to content
VERASPEC
Repository
Reference setsstable

Vector packing

vector_sha256 is SHA-256 over exactly these octets:

  1. Take the space's image embedding as verd.embed.embed_images returns it: float32, L2-normalized (normalization: "l2" in the descriptor).
  2. Cast to the descriptor's own dtype, fp16 — IEEE 754 binary16.
  3. Serialize little-endian, component 0 first, no header, no padding: dim × 2 octets. 1536 for the two SigLIP spaces, 1024 for CLIP.
python
np.ascontiguousarray(np.asarray(vector, dtype=np.float32).astype("<f2")).tobytes()

Normalization happens in float32 and the cast follows it, which is the order verd stores vectors in. The consequence is that the packed vector is not exactly unit-norm: across these thirty vectors the binary16 norms lie in [0.99980, 1.00018]. Anything comparing them must normalize after unpacking, and the cosine metric the spaces declare does that anyway.