# CompresLM CompresLM is a drop-in LLM proxy that cuts the cost of every LLM call by sending models only the context they need. ## What it is - OpenAI-compatible and Claude-compatible HTTP proxy. - Sits between your app and any upstream LLM (OpenAI, Anthropic, or a self-hosted model). - Compresses bulky context before the request is forwarded — chat history, pasted documents, RAG insertions, and tool/function call results, not just the latest user message. - Does not store your prompts or provider API keys. - First 1 million tokens processed are free. After that you pay 20% of dollars saved (or $0.50 per 1M tokens saved for local/unknown-price models). ## Why use it - Up to 90% lower cost per 1M tokens on compressible workloads. - On a 200+ case paired public-dataset benchmark, quality is held (no statistically significant drop) on needle-fact, negation, multi-hop and log-search cases, with measured cost reduction of 6.5%–70.4% on those categories. - Two harder categories (query-focused summarization, and code pasted directly in the user message) are automatically routed through the uncompressed or headroom path instead, because aggressive extraction measurably hurts them — you get the safe result without having to choose. - Quality often improves because the model is not distracted by irrelevant context. - Measured to outperform Netflix-style internal head/tail compression tooling on workloads where those tools save ~0% and CompresLM still cuts cost at matched quality. ## Cost per 1M input tokens (measured on this benchmark) | Model | List price | With CompresLM | |---|---|---| | GPT-4o mini | $0.15 | ~$0.084 | | GPT-4o | $2.50 | ~$1.41 | | Claude Sonnet | $3.00 | ~$1.69 | | Self-hosted / local | n/a | billed at $0.50 per 1M tokens saved | ## How to connect (one line) Point your existing OpenAI/Anthropic SDK at CompresLM: - base_url = https://compreslm.com/v1 - api_key = your CompresLM token (from the dashboard) - header X-LLM-API-Key = your upstream provider key (never stored by CompresLM) - optional header X-LLM-API-Base = custom upstream base URL for self-hosted LLMs Example (Python OpenAI SDK): ``` from openai import OpenAI client = OpenAI( base_url="https://compreslm.com/v1", api_key="YOUR_COMPRESLM_TOKEN", default_headers={"X-LLM-API-Key": "YOUR_PROVIDER_KEY"}, ) client.chat.completions.create(model="gpt-4o-mini-smart", messages=[...]) ``` Recommended model alias: gpt-4o-mini-smart (auto-routes compression strategy per request). ## Where compression applies - Chat history and pasted documents in user/system messages. - RAG-inserted context blocks. - Tool / function call results (role="tool"), where LLM agent workloads usually carry the most removable bulk. - Works the same way inside multi-step agent frameworks (e.g. LangGraph) as long as each LLM call in the chain goes through this proxy — every hop gets compressed independently, so long tool-call chains save at every step, not just the first one. ## Pricing - Free tier: 1,000,000 tokens processed per account. - After free tier, known-price models: commission = 20% × (cost_without_compression − cost_with_compression). - Local / unknown-price models: $0.50 per 1,000,000 tokens saved. - You never pay more than you save on known-price models. - On-prem and custom plans: contact via the form on the site (we help set up for free). ## Privacy CompresLM processes each request and forwards it. Provider keys arrive per-request via header and are not persisted. Prompts are not kept as a product dataset. Full detail: /app/privacy. ## Operator CompresLM is operated by Individual Entrepreneur Mikita Valkunovich, registered in Georgia (identification number 300412284). Full terms: /app/terms. ## Links - Landing: https://compreslm.com/ - App / signup: https://compreslm.com/app - Docs: https://compreslm.com/app/docs - Billing explained: https://compreslm.com/app/billing - Terms of Service: https://compreslm.com/app/terms - Privacy Policy: https://compreslm.com/app/privacy - This file: https://compreslm.com/llms.txt