Case study · AI context infrastructure · 2026
LLMSlim
The context layer for production AI agents: what every agent sees, decided, checked and on the record.
- Role
- Product, architecture, research, engineering
- Status
- Core: open source (MIT) · Platform: private beta
$ pip install llmslimThe problem
Context grows with every turn, tool and document.
Agents resend their whole prefix on every call. Old facts sit beside their corrections, retrieved text lands beside instructions, and nobody can say afterwards what the model actually saw.
- Turn 112,900
- Turn 1017,500
- Turn 4033,700
Illustrative from the briefing: 50 tools at a measured average of 122 tokens each (375 MCP schemas); history grows about 300 tokens a turn.
- Cost
- The whole prefix is billed again on every call. Caching discounts reuse, not growth.
- Correctness
- 85.7% stale-fact error with raw history in the 180-case synthetic benchmark.
- Trust
- Unlabelled baselines failed 100% of injection probes in the same benchmark.
The product
It owns the decision between your data and your model.
Every source is tagged with a role and a trust level, current facts are separated from superseded ones, the budget is planned explicitly, quality gates are checked, and the request is compiled for the provider with a trace you can replay.
Capabilities
One architecture, two products.
LLMSlim Core
Open source · MIT licence · runs locally- Open source
Query-focused compression
Ranks documents, chat rounds and passages against the question and keeps the best whole, locally and deterministically (0.8).
- Open source
Optional reranker
A 22M-parameter cross-encoder rescoring the strongest candidates; runs on CPU or GPU. Off by default.
- Open source
Code and log compression
Keeps failures, tracebacks, imports and signatures; collapses repeated lines and marks what was omitted.
- Open source
Adaptive Context Planner
Divides a fixed token budget across competing context and records why. Reports INFEASIBLE rather than truncating silently.
- Open source
Agent Context Runtime
Prepares each agent turn as a checked, traceable unit with 10 quality gates.
- Open source
Cache-aware preparation
Keeps request prefixes byte-stable for provider prompt caching. Savings are offline estimates.
- Open source
Tool schemas & MCP
Normalises and fingerprints tool definitions; LLMSlim never executes tools.
- Open source
CLI and Studio
Inspect any agent turn in the browser or from the terminal.
LLMSlim Platform
Private beta · by invitation · runs in your cloud- Private beta
Temporal state
Each fact is active, stale, superseded, contradicted, uncertain or expired.
- Private beta
Trust firewall & provenance
Labels where context came from and how far it can be trusted.
- Private beta
Provider-neutral Context IR
One context decision compiled for OpenAI, Anthropic or Gemini.
- Private beta
Traces and replay
Immutable traces; exact replay reproduced 100% across 15 benchmark runs.
- Experimental
Context Intelligence
Learned policies run in shadow mode; no production uplift is claimed.
from llmslim import plan_context
plan = plan_context(
messages=messages, documents=docs,
query="Acme renewal",
model="sarvam-105b", max_input_tokens=8_000)
assert plan.feasibleExample adapted from the LLMSlim briefing. Local by default; no API key for extractive planning.
Provider compatibility
| Target | Level | In the code today |
|---|---|---|
| OpenAI | Maintained adapter | Responses builder, Agents SDK input filter |
| Anthropic | Maintained adapter | Messages builder with cache breakpoints |
| Google Gemini | Maintained adapter | generate_content and CachedContent builders |
| Sarvam AI | Maintained integration | Official-SDK provider; prompt caching not yet verified |
| Self-hosted (vLLM) | Maintained builder | Chat builder and Transformers KV continuation |
| MCP | Maintained adapter | Catalogs over Streamable HTTP and stdio |
| LangChain | Adapter (0.8.1) | LLMSlimCompressor for ContextualCompressionRetriever |
| LlamaIndex | Adapter (0.8.1) | LLMSlimPostprocessor as a node postprocessor |
| Haystack | Adapter (0.8.1) | LLMSlimDocumentCompressor between retriever and prompt |
Request builders are execution-free: they produce the provider payload and the host sends it. Source: repositories, verified 9 Oct 2026.
Benchmarks
Ahead of LLMLingua-2. Level with LongLLMLingua, at about 100× the speed.
In October 2026 LLMSlim 0.8 was measured against Microsoft Research's two best-known open-source prompt compressors, with the same questions, the same token budget and the same reader model. Development questions were kept separate, and a fresh sample was run once after the code was frozen. The tie is reported as a tie.
- points ahead of Microsoft's LLMLingua-2
- +9.7points ahead of Microsoft's LLMLingua-278.7 vs 69.0 accuracy (95% CI +3.7 to +15.7). Microsoft Research's compressor, NaturalQuestions head-to-head: 300 cases, same 25% token budget, Claude Haiku 5.5 reader, Oct 2026.
- faster than LongLLMLingua, at equal accuracy
- ~100×faster than LongLLMLingua, at equal accuracy78.7 vs 78.0 on the same 300 cases (level, within noise). Median 0.09 s vs 9.3 s per question; a 22M-parameter reranker vs a 7B model.
- fewer tokens on long chat histories
- 14×fewer tokens on long chat historiesLongMemEval-S: 76.7% accuracy at 7,984 tokens vs 82.2% with the full 114,006-token history (72.2% on a fresh sample). Claude Haiku 5.5, Oct 2026.
- Core releases on PyPI
- 11Core releases on PyPIFrom 0.1.0 on 15 Jun 2026 to 0.8.1 on 11 Oct 2026.
- Full contextNo compression · None89.02,889n/a
- LLMSlim 0.8 + rerankerAMEYOR · 22M cross-encoder78.76680.09 s
- LongLLMLinguaMicrosoft Research · LLaMA-2-7B-chat, 4-bit78.06309.3 s
- LLMLingua-2Microsoft Research · XLM-RoBERTa-large69.06802.3 s
- LLMSlim 0.8, no modelAMEYOR · None68.765825 ms CPU
+9.7 pts
ahead of LLMLingua-2
95% CI +3.7 to +15.7; ahead on both the original and the fresh sample.
Level
with LongLLMLingua
78.7 vs 78.0 (+0.7, 95% CI −4.7 to +6.0): it won one sample, LLMSlim the other.
~100×
faster than LongLLMLingua
Median compression time per question on the same 6 GB laptop GPU.
NaturalQuestions with 20 retrieved documents per question: 300 paired cases (100 questions, gold passage 1st, 10th or 20th), the same 25% token budget for every compressor and the same reader, Claude Haiku 5.5. Competitors run with their published settings. October 2026.
One dataset, one reader and one budget. Without the optional reranker, LLMSlim is level with LLMLingua-2 (68.7 vs 69.0). Tuning used separate development questions only, and the fresh sample was run once after the code was frozen.
| Benchmark | LLMSlim | Full context | Tokens | Note |
|---|---|---|---|---|
| LongMemEval-SMemory over 115k-token chat histories | 76.7% | 82.2% | 114,006 → 7,984 | 76.7% vs 72.2% on a fresh sample; 1/62 of the cost |
| LongBench v1Seven long-context tasks | 54.9 | 54.9 | 15,532 → 5,232 | Equal to full context on a third of the tokens, no model |
| HotpotQAMulti-hop questions, F1 | 69.4 | 74.9 | 2,179 → 939 | Truncation to the same budget: 49.5 |
| LongBench v2Long documents and code, multiple choice | 55.6% | 60.0% | 30,493 → 8,469 | Middle truncation, same budget: 48.3% |
LongBench v1 uses LLMSlim without the reranker. Full context is the ceiling, not a competitor: the point is how close LLMSlim gets on a fraction of the tokens. Weak spots, such as preference questions in LongMemEval, are listed in the full results.
Platform evaluation
Doubled task success, with a third fewer tokens.
This is the private Platform's own benchmark: 180 synthetic cases scored by a deterministic oracle, which rewards the temporal labelling the Platform adds. It tests a different layer from the real-model results above, and no production customer outcome is claimed.
- Raw history44.4%
- Truncation33.3%
- RAG only44.4%
- Core (prior)50.0%
- LLMSlim Core83.3%
- LLMSlim Platform88.9%
LLMSlim Platform benchmark, October 2026. Synthetic cases in English, Hindi and Hinglish across 18 categories, 3,000-token budget, deterministic oracle. Most of the gain comes from temporal labelling, which this oracle rewards by design. These are not production customer outcomes; real-model results for Core are reported separately.
| Metric | Raw history | Core | Platform |
|---|---|---|---|
| Stale-fact error | 85.7% | 85.7% | 14.3% |
| Wrong context | 29.4% | 28.6% | 5.9% |
| Mean tokens | 583 | 429 | 392 |
Long sessions: in an in-memory benchmark, Platform context levelled off near 2,000 tokens, 83% fewer than raw history at 1,000 turns. Below about 140 turns, Platform's state and trace headers cost more than short raw history; the value case is long-running agents.
In their words
What early users said.
“got 50% fewer tokens on my rag pipeline with no quality drop on my eval set, super easy drop-in replacement”
Unedited public comments on LLMSlim's first Product Hunt launch (v0.2.0, 16 July 2026). See them on Product Hunt ↗
In the product
Studio and the published limits.


Timeline
Compression library to context platform in sixteen weeks.
- 16 Jun 2026
First release on PyPI
- Jul 2026
Entity rules, rewrite and hybrid modes
- Aug 2026
Provenance locks and safe tool schemas
- 12 Sep 2026
MCP catalogs, new site and Studio
- 20 Sep 2026
Adaptive Context Planner
- 30 Sep 2026
Agent runtime and cache planning
- 2 Oct 2026
Private Platform control plane
- 9 Oct 2026
Context Intelligence beta
- 10 Oct 2026
Planner keeps the most relevant evidence (0.7.2)
- 11 Oct 2026
Query-focused selection and reranker; head-to-head vs LLMLingua-2 and LongLLMLingua (0.8.0)
- 11 Oct 2026
LangChain, LlamaIndex and Haystack adapters (0.8.1)
Ecosystem & status
Startup programs, not investors.
- OpenAI for Startups
- Claude for Startups
- Sarvam Startup Program
- Zoho for Startups
- MongoDB for Startups
- Auth0 for Startups
- Zendesk for Startups
- Mixpanel for Startups
- Sentry for Startups
- Descope Hello World
- Pulumi for Startups
LLMSlim has been accepted into these programs, which offer cloud and API credits, software licences, technical resources and community access. None is an investor, lender, customer or funder, and membership implies no technical endorsement or commercial partnership.
Commercial status, October 2026
Core is free under the MIT licence. Platform is a private beta, by invitation. LLMSlim has no paying customers or revenue today, and no paid plan is live.
Building agents that need better context?
Ask about LLMSlim Platform's private beta and enterprise deployment, or hire AMEYOR to design the context and evaluation layer of your own AI product.
Or book a free 30-minute call (opens in a new tab) with the founder.
Prefer email? hello@ameyor.in

