headroom/docs
chopratejas 31aa72c885 Add universal compression module with ML-based content detection
- Add headroom.compression module with UniversalCompressor
- ML-based content detection using Magika (JSON, code, logs, text)
- Structure-preserving compression via handler protocol
- JSON handler: preserves keys, brackets, high-entropy values (UUIDs)
- Code handler: preserves imports, signatures, types (tree-sitter AST)
- Entropy-based preservation for identifiers and hashes
- CCR integration for reversible compression
- Comprehensive test suite with LLM eval tests
- Add docs/compression.md with full API documentation
2026-01-15 15:26:14 -08:00
..
api.md Prepare for OSS release v0.2.0 2026-01-07 11:36:44 -08:00
ARCHITECTURE.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
ccr.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
compression.md Add universal compression module with ML-based content detection 2026-01-15 15:26:14 -08:00
configuration.md Add AST-based code compression and custom model configuration 2026-01-14 13:46:55 -08:00
errors.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
getting-started.md Prepare for OSS release v0.2.0 2026-01-07 11:36:44 -08:00
langchain.md Add seamless LangChain integration 2026-01-14 16:03:34 -08:00
llmlingua.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
memory.md Add persistent memory system with zero-latency inline extraction 2026-01-14 21:32:09 -08:00
metrics.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
proxy.md Add LLMLingua-2 opt-in support to proxy server 2026-01-14 12:21:51 -08:00
quickstart.md Publish headroom-ai v0.2.0 to PyPI with DevEx fixes 2026-01-10 14:51:08 -08:00
README.md Add universal compression module with ML-based content detection 2026-01-15 15:26:14 -08:00
sdk.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
text-compression.md v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
transforms.md Add AST-based code compression and custom model configuration 2026-01-14 13:46:55 -08:00
troubleshooting.md Publish headroom-ai v0.2.0 to PyPI with DevEx fixes 2026-01-10 14:51:08 -08:00

Headroom Documentation

Welcome to the Headroom documentation.

Getting Started

Guide Description
Quickstart 5-minute setup
SDK Guide Python SDK usage
Proxy Guide Proxy server deployment

Framework Integrations

Framework Description
LangChain Chat models, memory, retrievers, agents, streaming
MCP See CCR Guide for tool compression

Core Concepts

Topic Description
Universal Compression ML-based content detection + structure preservation
Transforms How compression works
CCR Reversible compression architecture
Configuration All configuration options

Advanced

Topic Description
Text Compression Opt-in utilities for search/logs
LLMLingua ML-based compression
Metrics Monitoring and observability
Errors Error handling

Reference

Topic Description
API Reference Complete API docs
Architecture Internal design
Troubleshooting Common issues

Overview

Headroom is the Context Optimization Layer for LLM applications. It reduces your LLM costs by 50-90% through intelligent context compression.

How It Works

  1. Universal Compression — ML-based content detection with structure-preserving compression
  2. SmartCrusher — Compresses JSON tool outputs, keeping errors, anomalies, and relevant items
  3. CacheAligner — Stabilizes message prefixes so provider caching works
  4. RollingWindow — Manages context limits without breaking tool call pairs
  5. CCR — Caches original data so compression is reversible

Safety Guarantees

  • Never removes human content
  • Never breaks tool call ordering
  • Parse failures pass through unchanged
  • LLM can always retrieve original data

Getting Help