Embedding Cache
Last updated
This page describes the key and value format of the cache that lets ToriiDB reuse an embedding for identical text.
Cache Format
__torii:embed:<hex(sha256("<model>|<dim>|<text>"))>
The cache value is JSON {"v": <base64 vector>, "d": <dim>, "m": <model>}, has no TTL, and is persisted like any entry. An entry is reused only when its stored dimension matches. Vectors are base64-encoded little-endian float32 in both cache entries and log records.