Skip to main content
Glama
FreezeVII

TurboQuant Tools

by FreezeVII

🧊 TurboQuant Tools

Compress AI embeddings by 5–7× with near-lossless quality.

CLI + Python Library + MCP Server for extreme vector compression using Google's TurboQuant (PolarQuant + QJL) — wrapped in a clean numpy-first API.

PyPI Python License Tests


Quick Start

pip install turboquant-tools
turboquant compress embeddings.npy --bits 3
from turboquant_tools import compress, decompress
import numpy as np

vectors = np.random.randn(1000, 384).astype(np.float32)
compressed = compress(vectors, bits=3)
print(f"Original: {vectors.nbytes / 1e6:.1f} MB")
print(f"Compressed: {compressed.nbytes / 1e6:.1f} MB")

Related MCP server: JSON2TOON MCP Server

CLI

# Compress embeddings
turboquant compress embeddings.npy --bits 3 --output compressed.tq

# Estimate savings without compressing
turboquant estimate embeddings.npy

# Decompress
turboquant decompress compressed.tq --output restored.npy

MCP Server

turboquant mcp-server

Exposes compress_embeddings, decompress_embeddings, estimate_savings, embed_and_compress.

How It Works

  1. PolarQuant — Random rotation + polar coordinate quantization (3-bit)

  2. QJL — Quantized Johnson-Lindenstrauss error correction (1-bit)

Result: ~5x compression with near-zero accuracy loss, no training needed.

Use Cases

  • RAG pipelines — Store 5x more documents in the same RAM

  • Local LLMs — Fit larger vector stores on your GPU/CPU

  • Edge devices — Deploy vector search with minimal memory

  • AI Agents — Compress embeddings between agent calls

License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Advanced Token-Optimized Object Notation MCP server that compresses JSON with up to 85% token reduction using AI-powered pattern detection, providing lossless compression and decompression through 12 MCP tools.
    12
    9
    MIT
  • F
    license
    B
    quality
    C
    maintenance
    Local MCP server for token optimization, providing tools to compress code/JSON, optimize prompts, and manage placeholder-based content redaction and hydration to reduce LLM token usage.
    5
    -