Enterprise guide
Multi-tenant compression
SaaS platforms serving multiple customers need to compress prompts without mixing tenant data. Here is a multi-tenant compression architecture.
Tenant isolation
from supercompress import Compressor
# One compressor instance per tenant
tenant_compressors: dict[str, Compressor] = {}
def get_compressor(tenant_id: str) -> Compressor:
if tenant_id not in tenant_compressors:
tenant_compressors[tenant_id] = Compressor()
return tenant_compressors[tenant_id]
def compress_tenant(tenant_id: str, context: str, query: str):
comp = get_compressor(tenant_id)
return comp.compress(context, query)
Frequently asked questions
Does each tenant need a separate Compressor instance?
No. The compressor is stateless and thread-safe. Separate instances are for logical isolation.
How do I bill tenants for compression?
Log compression metrics per tenant and include them in usage-based billing.
Build with less context
Put compression in front of your next LLM call.
Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.