Skip to main content
Core v0.8.1 is outPlatform v0.9.1 in beta

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 command

The receipts

Less context. Sharper agents.

Chat memory
62×
lower cost per question over long chat histories, at Haiku 5.5 list prices
Whole history$90.72
LLMSlim$1.45
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
Full document15.5k tokens
LLMSlim5.2k
LongBench v1, 54.9 vs 54.9 with full context
Retrieval
+23
points over truncation at the same token budget
Cut to fit52.0
LLMSlim75.0
NaturalQuestions, 20 passages, 25% budget
Agent turns
0
repeated tool calls across 1,054 agent turns
Before50
Agent turn0
InjecAgent, Platform agent turns
Public benchmarks. One reader and one prompt for every run; only the context changes.*See the results, chapter by chapter

* Every context was read by Claude Haiku 5.5.

Open-source core · private platform

Start in one line. Scale to agents that remember.

agent.py · llmslim.compress()local
Context in114,006 tokens
Sent to the model7,985 tokens
62× cheaper per questionLongMemEval at Haiku 5.5 list prices; 14× fewer tokens

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
trace · turn 214replayable
  • 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
7,287 / 8,000 tokens

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 Platform

Signal in · noise out

Great context makes great agents. Everything else is a tax.

context.txt
54 words
The deployment is scheduled for Thursday at 14:00 UTC. The engineering team discussed the deployment during the weekly planning meeting. All API keys must be stored in environment variables. The discussion also covered the general background of the project and a review of previous meetings. Roll back if the error rate exceeds 2 percent.
Illustrative excerpt · word counts, not tokensA deployment note with room to trim.
  1. 01

    Keep what matters

    Rank and select content around the question before a single token reaches the model.

  2. 02

    Know where it came from

    Instructions, retrieved documents, and tool output keep their roles, so untrusted text never gets promoted.

  3. 03

    Stay in control

    Pick your budget, inspect every decision, and tune it against your own workload.

Supported by 14 startup programs

Built in India. Fuelled by 14 startup programs.

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.

PYTHON
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_text
Runs locallyNo API key needed

Before 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.