Runnable Semafold examples live here. They are intentionally small, deterministic, and useful as real smoke checks for the public package surface.
wire_roundtrip.py: stable root-envelope smoke test using the lossless passthrough codecturboquant_embedding.py: synthetic embedding compression example usingTurboQuantMSEVectorCodecturboquant_kv_block.py: cache-shaped K/V compression example usingTurboQuantKVPreviewCodec
From the project root:
PYTHONPATH=src python3 examples/wire_roundtrip.py
PYTHONPATH=src python3 examples/turboquant_embedding.py
PYTHONPATH=src python3 examples/turboquant_kv_block.pyIf the package is installed editable:
python3 examples/wire_roundtrip.py
python3 examples/turboquant_embedding.py
python3 examples/turboquant_kv_block.pywire_roundtrip.pyshows the stable root API, JSON wire conversion, and exact reconstructionturboquant_embedding.pyshows vector compression ratio, reconstruction error, and deterministic TurboQuant MSE behaviorturboquant_kv_block.pyshows cache-shaped K/V compression, restoration of shapes, and combined memory accounting
TurboQuant examples use the current deep-import surface under semafold.turboquant
and semafold.turboquant.kv; those imports are intentionally outside the stable
root API.