enquire-mcp API reference - v4.0.0-rc.7
    Preparing search index...

    Function encodeInt8Vector

    • v2.17.0 — encode a Float32 vector for storage as int8 + (vMin, scale). Asymmetric scalar quantization: the smallest Float32 component maps to int8 0; the largest maps to int8 255; intermediate values are linearly interpolated. Dequantization: f[i] ≈ q[i] * scale + vMin.

      BLOB layout (dim × 1 + 8 bytes): bytes [0 .. dim) int8 quantized values bytes [dim .. dim+4) Float32 vMin (little-endian) bytes [dim+4 .. dim+8) Float32 scale (little-endian)

      For a 384-dim vector this is 392 bytes vs 1536 for Float32 — a 3.92× reduction at the storage layer.

      Parameters

      • vec: Float32Array

      Returns Buffer