Supported by 21 startup programs
The context layer
for production AI agents.
Open-source context compression for RAG and agents. More answers right than Mem0 on long conversations, at a third of the cost, with no memory to build.
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
- 2.8×
- lower cost than Mem0 on long conversations, with more questions right
- LoCoMo, 93.0% vs 91.0% for Mem0 at about 2,500 tokens
- Long histories
- 42×
- lower cost than sending the whole chat history, at the same accuracy
- LongMemEval, 77.8% for both at 10,000 tokens
- Memory systems
- 212×
- lower cost than Mem0 on its own LongMemEval questions, as accurate
- Mem0's 60-question sample, 78.3% vs 76.7%
- Long documents
- 3×
- fewer tokens on long documents, for the same score
- LongBench v1, 54.9 vs 54.9 with full context
* Every context was read by Claude Haiku 5.5.
Open-source core · self-hosted Vault
Start in one line. Scale to agents that remember.
LLMSlim Core · v0.12.0 · 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 Vault · v0.9.1 beta · self-hosted
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 VaultSignal 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, into the LangChain, LlamaIndex or Haystack pipeline you already run, or into a gptme, Hermes Agent or Pydantic AI agent's history. 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, and adapters for gptme, Hermes Agent and Pydantic AI fit an agent's history into its budget. 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 Vault?
The self-hosted edition of LLMSlim, built on the open-source Core and run in your own VPC, in private beta. 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. LLMSlim Orbit, the hosted edition, opens with LLMSlim 1.0. Core stays MIT licensed: pip install llmslim.
What do the startup programs give LLMSlim?
LLMSlim is part of 21 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, Neo4j Startup Program, Cartesia Startups Grant Program, Nebius AI Builder Program, Notion for Startups, Snyk Secure Developer Program, Gitar Open Source Program, Composio Startup Program, and Future AGI for Startups. 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.










