Metadata-Version: 2.4
Name: powerailabs-squeeze
Version: 0.2.0
Summary: Compress: shrink verbose context (JSON/logs/prose) 60-90% — reversibly. compress() returns a handle; expand() restores the original.
Author: Raghav Mishra
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: powerailabs-core<0.2,>=0.1
Description-Content-Type: text/markdown

# powerailabs-squeeze

Shrink verbose context — JSON, logs, prose — without throwing anything away. Compression returns
a *handle*; the original is always restorable. Content-aware: each type gets a purpose-built,
deterministic compressor (no LLM).

**80% smaller, 100% reversible.**

![status](https://img.shields.io/badge/status-building-yellow) ![license](https://img.shields.io/badge/license-MIT-blue)

🚧 building (v0) · `pip install powerailabs-squeeze` · `from powerailabs.squeeze import compress`

```python
from powerailabs.squeeze import compress

small, handle = compress(huge_json, kind="auto")          # detect + route (JSON/logs/prose)
small, handle = compress(logs, kind="logs", target_tokens=400)   # compress to a budget
original = handle.expand()                                 # restore on demand, byte-for-byte
```

**Inbound** — usually you don't call it directly; `contextkit` does, when a block is marked
`evict="compress"` (`pip install powerailabs-contextkit[squeeze]`). It satisfies core's
`Compressor` protocol by shape, so contextkit never imports squeeze. Call it directly to shrink a
single known-huge blob (e.g. a 50k-token tool response) before it ever enters the window.
Reversibility comes from a content-addressed store that keeps each original keyed by hash —
structural compressors (JSON folding, log dedup) are deterministic; prose is extractive.

See [`docs/squeeze.md`](../../docs/squeeze.md). *Part of the PowerAI Labs stack — github.com/PowerAI-Labs/powerailabs.*
