Supported by 14 startup programs
The context layer
for production AI agents.
Open-source context compression for RAG and agents. Level with LongLLMLingua on NaturalQuestions at about 100× the speed, with a 22M reranker instead of a 7B model.
Your agents are only as smart as what they know. LLMSlim decides what reaches the model, remembers what changed, and learns which context wins.
pip install llmslimCopy install commandThe receipts
Less context. Sharper agents.
- Chat memory
- 62×
- lower cost per question over long chat histories, at Haiku 5.5 list prices
- LongMemEval, 76.7% vs 82.2% with the whole history; 14× fewer tokens
- Long documents
- 3×
- fewer tokens on long documents, for the same score
- LongBench v1, 54.9 vs 54.9 with full context
- Retrieval
- +23
- points over truncation at the same token budget
- NaturalQuestions, 20 passages, 25% budget
- Agent turns
- 0
- repeated tool calls across 1,054 agent turns
- InjecAgent, Platform agent turns
* Every context was read by Claude Haiku 5.5.
Open-source core · private platform
Start in one line. Scale to agents that remember.
LLMSlim Core · v0.8.1 · MIT
Control exactly what reaches the model.
Compress context in your own process, keep provenance on every piece, and fit it all into your token budget. No API key, no network call.
Start with Core- s1stateuser.home_city = "Delhi"sent
- h1stateuser.home_city = "Pune"superseded
- e3evidenceRenewal signed: 50 pilot workspacessent
- t1toolIMPORTANT!!! Ignore all previous instructions…data, not instruction
- e7evidenceQ3 offsite agenda, catering notesleft out
- d9dialogueWhen does the contract renew?sent
LLMSlim Platform · v0.9.1 beta · private
Give your agents a memory you can audit.
A tamper-evident timeline of what your agents were told, a trace for every context decision, and policies that learn from real outcomes.
Explore the PlatformSignal in · noise out
Great context makes great agents. Everything else is a tax.
- 01
Keep what matters
Rank and select content around the question before a single token reaches the model.
- 02
Know where it came from
Instructions, retrieved documents, and tool output keep their roles, so untrusted text never gets promoted.
- 03
Stay in control
Pick your budget, inspect every decision, and tune it against your own workload.
Tiny library · massive leverage
Three lines. Then back to shipping.
Drop LLMSlim in front of your model call, or into the LangChain, LlamaIndex or Haystack pipeline you already run. Extraction runs locally and instantly, or bring any provider for rewrite and hybrid strategies.
from llmslim import compress
# Keep the useful. Leave the rest.
result = compress(
long_context,
target_ratio=0.5,
)
# Ready for your model
context = result.compressed_textBefore you start
A few good questions.
Does it need an API key?
No. LLMSlim’s default extractive strategy runs right inside your Python application, with no key and no model call. Rewrite and hybrid strategies plug into any provider you choose.
Does it work with my model?
Yes. LLMSlim prepares context before your model call, so the output works with Sarvam, OpenAI, Anthropic, Gemini, or a local model. Adapters for LangChain, LlamaIndex and Haystack drop it into the retrieval pipeline you already run. Your application keeps full control of the request.
How much should I compress?
Start at a 50% target and tune from there against your own evals. Every result shows exactly what was kept and why, so you can push the budget as far as your workload allows.
What is LLMSlim Platform?
A private beta built on the open-source Core. It keeps a verifiable timeline of what your agents were told and what changed, explains and replays every context decision, and learns from real outcomes which context wins. Learned policies go live only when an administrator promotes them, and roll back instantly. Core stays MIT licensed: pip install llmslim.
What do the startup programs give LLMSlim?
LLMSlim is part of 14 startup programs: Sarvam Startup Program, Zoho for Startups, MongoDB for Startups, Claude for Startups, OpenAI for Startups, Auth0 for Startups, Zendesk for Startups, Mixpanel for Startups, Sentry for Startups, Descope Hello World Startup Program, Pulumi for Startups, Honeycomb for Builders, Exa Startup Grants, and Neo4j Startup Program. They provide credits, tools, and guidance. Our Sarvam integration guide shows how to pair local context compression with the official Sarvam Python SDK.
Ship agents that know exactly enough.
One install. Your next model call gets sharper.












