Skip to main content
Release history

Changes with consequences.

LLMSlim releases document what shipped, what changed, and where the boundary remains.

v0.8.112 Oct 2026
Drop it into the framework you already use.
Adapters that run LLMSlim's compress_documents inside LangChain, LlamaIndex and Haystack, where you would otherwise use LLMLinguaCompressor or LongLLMLinguaPostprocessor. No change to how compression itself behaves.
LangChain, LlamaIndex, HaystackOrder, ids, scores and metadata keptTested on old and current framework versions

LangChain compressor

LLMSlimCompressor is a BaseDocumentCompressor for ContextualCompressionRetriever. Install llmslim[langchain].

LlamaIndex postprocessor and Haystack component

LLMSlimPostprocessor is a BaseNodePostprocessor (Python 3.10+, llmslim[llamaindex]); LLMSlimDocumentCompressor is a Haystack component with run(documents, query) (llmslim[haystack]).

Same rules as the core

Retrieved text stays untrusted; documents that compress to nothing are dropped; token counts are recorded in metadata and kept out of the prompt for LlamaIndex.

v0.8.0Oct 2026
Keep what the question needs. Drop the rest.
With a query, compress() now ranks whole documents, chat rounds and paragraphs against it and keeps the best ones intact, instead of trimming every chunk by the same ratio. An optional 22M-parameter reranker finds answers that share few words with the question. Code, logs and test output keep their lines, and selection is about six times faster. Measured on public benchmarks, with fresh questions run after the code was frozen.
LongMemEval 25.6% to 76.7% at 8k tokensNaturalQuestions 62.3 to 75.0LongBench v1 level with full context

Query-focused selection

Structural units are ranked with BM25, light stemming, pseudo-relevance feedback and a document prior, kept whole in their original order, then topped up sentence by sentence. compress_documents() shares one budget across documents by relevance.

Code and logs keep their lines

Failures and tracebacks come first, repeated lines collapse into a count, the tail is kept, and code keeps its skeleton plus the most relevant bodies. Compressing a 1.3k-token file dropped from about 3.5 s to 7 ms.

Optional reranker

relevance="semantic" rescores the strongest candidates with a 22M-parameter cross-encoder (the semantic extra), on CPU or GPU. Any scorer(query, texts) callable works too. Without it, LLMSlim still runs no model.

Guardrails still win

Trusted instructions and preserve_patterns survive inside large units; untrusted retrieved, tool and assistant text still cannot reach the protected tier. Query-less prose behaves exactly as in 0.7.

v0.7.211 Oct 2026
Keep the evidence that answers the question.
A patch release. plan_context() no longer drops the most relevant retrieved document in favour of cheaper, less relevant ones, and documents marked superseded are dropped before current evidence. Also fixes runtime sessions on Python 3.9.
Relevance guard in plan_context()Superseded metadata respectedPython 3.9 session fix

Most relevant evidence is kept

After the budget allocation, a deterministic guard keeps the single most relevant, non-superseded document, memory or tool result whenever it fits by dropping or compressing lower-relevance evidence.

Superseded documents go first

Items whose metadata sets superseded, superseded_by, or a past valid_until are scaled down and dropped before current evidence, with a warning in the plan.

Untrusted wording earns no value

Imperative text inside retrieved, tool or assistant content no longer raises its planning value. It is still rendered as untrusted data; there is no injection detector.

v0.7.130 Sep 2026
Plan context with provider caches in mind.
An opt-in cache-aware runtime classifies reusable context, preserves safe prefixes, and separates local estimates from provider-reported usage. The Studio server installs the tagged package; paid provider cache performance remains unmeasured.
Tenant-scoped cache metadataOffline multi-turn benchmarkProvider hits unmeasured

Cache plans and diagnostics

Stable-prefix fingerprints, append-only reuse estimates, cache generations, invalidation reasons, and separate network-byte and token metrics are visible in Context Inspector.

Provider request builders

Execution-free OpenAI, Anthropic, Gemini, and vLLM builders expose supported cache controls. OpenAI state continuation and Gemini cached resources require explicit host opt-in.

Reported data stays distinct

Local prefix matches are estimates until a provider reports usage. Sarvam caching remains unverified; raw KV is confined to an explicit self-hosted process adapter.

v0.7.026 Sep 2026
Prepare context for every agent turn.
A provider-neutral agent context runtime constructs model-visible input from conversation, retrieval, memory, and tools with provenance, dependencies, quality gates, and local traces. Its tagged 0.7.0 wheel remains available; hosted verification and PyPI publication were separate gates.
623 passing tests112 offline cases100% measured fact retention

Agent Context Runtime

ContextEnvelope, ContextGraph, ContextPolicy, progressive planning, quality reporting, and bounded sessions prepare a turn without taking over the agent loop or tool execution.

Context Inspector and adapters

The Studio shows before and after context, decision reasons, graph links, and a prompt-free trace. Generic, Sarvam, OpenAI-compatible, and text-only OpenAI Agents adapters return host-owned model inputs.

Quality and budget tradeoff

Across 112 offline cases, the new runtime retained all measured required facts and tool contracts, with 67.9% budget success and 18.7% context reduction. Provider-backed answer quality remains unmeasured.

v0.6.019 Sep 2026
Plan the whole context, not just one string.
A deterministic, explainable Adaptive Context Planner with explicit hard constraints, provider-neutral model budgets, and optional Sarvam, Zoho, and MongoDB integrations.
28 frozen cases96.4% budget success100% hard-constraint retention

Adaptive Context Planner

Multiple-choice constrained allocation selects safe representations for trusted instructions, chat, RAG, memory, tool results, and tool schemas, then explains each decision.

Failure is explicit

Required trusted content is never silently truncated. Impossible budgets produce an infeasible plan, provider candidates fail closed, and tool selection never grants execution authority.

Optional ecosystem adapters

Official-SDK Sarvam rewriting, bounded read-only Zoho sources, and PyMongo async memory remain optional extras; the base planner stays local and provider-neutral.

v0.5.013 Sep 2026
MCP catalogs. Your host stays in control.
Optional MCP transports and an OpenAI Agents SDK bridge, with complete tool contracts and explicit execution ownership.
MCP + Agents extrasFull catalog by defaultPython 3.10+ for integrations

MCP catalog sources

Streamable HTTP and literal-argv stdio support bounded pagination, scoped caching, contract fingerprints, and stale-plan detection.

Execution belongs to the host

The optional Agents SDK bridge requires a host callback. Full and measure-only plans retain every schema; selective exposure remains research-only.

A new home for LLMSlim

A redesigned website with light and dark themes, a Sarvam integration guide, and a note on LLMSlim's acceptance into the Sarvam Startup Program.

v0.4.021 Aug 2026
Contract-safe tool context.
This Python release adds stable, conservative tool-schema infrastructure while keeping retrieval and selective exposure research-only.
489 / 0 tests90.93% coverage375 schemas / 18 catalogs

Stable tool-contract APIs

The released tool surface supports copied schema normalization, deterministic canonical JSON, SHA-256 fingerprints, exact contract checks, and safe catalog optimization.

Retrieval remains research-only

Lexical, dense, hybrid retrieval, selective exposure, and lazy hydration are explicit experiments. They do not authorize or execute tools, and compress() keeps its established behavior.

Schema-tax evidence stays transparent

The v0.4.0 release gate records 489 passing tests, 90.93% coverage, and 375 generated tool schemas in 18 catalogs. The compact baseline produced 0.00% lossless reduction.

v0.3.113 Aug 2026
Provenance and verification.
This security-focused Python release strengthens caller-declared trust boundaries and makes token-counter provenance visible in the public result.
432 / 0 tests92.57% coverageRuff passed

Provenance-aware priority locking

ContextRole distinguishes system, developer, user, assistant, tool, RAG, and general content. Untrusted RAG, tool, and assistant text cannot become hard-locked priority from imperative wording, safety patterns, or preserve patterns.

Nonce-protected rewrite template fences

User text containing a template-fence-like delimiter remains byte-for-byte unchanged while the template uses a content-preserving nonce fence, preventing fence breakout.

Context roles and token-counter telemetry

The public Python API exports ContextRole and records token_counter_used so callers can distinguish tiktoken from the documented heuristic fallback.

Inline code and CJK sentence boundaries

Inline backtick code spans no longer create false sentence boundaries, and the CJK ideographic stops 。, !, and ? are recognized by the sentence-splitting paths.

Pipelines preserve provenance

Document compression defaults retrieved context to RAG, while chat compression propagates supplied system, developer, user, assistant, and tool roles instead of flattening them.

Benchmark collection reports real pytest results

The release runner collects actual pass/fail reports rather than replaying stale tuples. The checked-in release record reports 432 passing tests, zero failures, 92.57% branch coverage, and Ruff passing.

v0.3.018 Jul 2026
Hybrid prompt optimization.
v0.3.0 expanded the package from its offline extractive default into an extensible rewrite and hybrid framework without bundling an LLM provider.
Extractive defaultProvider abstractionValidation pipeline

Rewrite and hybrid strategies

compress() gained extractive, rewrite, and hybrid strategies. Rewrite-capable paths require a caller-supplied provider; the default extractive path remains offline and deterministic.

Provider and validation contracts

BaseRewriteProvider, CallableProvider, RewriteRequest, RewriteMetadata, versioned templates, and structural, instruction, entity, and similarity validation were added as public building blocks.

Rewrite work moved into a focused sub-package

Prompt construction, execution, and validation were separated into llmslim.rewrite modules, with strategy benchmarking and a CLI strategy flag added alongside them.

v0.2.013 Jul 2026
High-performance semantic compression.
v0.2.0 deepened the original extractive engine with instruction and entity protection, chunking improvements, cost tooling, and a fuller command-line and benchmark surface.
Instruction retentionEntity preservationCLI + benchmarks

Instruction and entity retention

The release added explicit instruction prioritization plus regex and heuristic preservation for names, dates, financial metrics, technical identifiers, and URLs.

Chunking, embeddings, and cost tooling

It introduced semantic and hybrid chunking, optional sentence-transformers support, model cost estimation, an interactive/file-based CLI, and comprehensive benchmark tooling.

Richer ranking and result telemetry

TF-IDF plus PageRank-style sentence centrality, optional tiktoken accounting, and a standardized CompressionResult with detailed telemetry became part of the release.

v0.1.016 Jun 2026
Initial public release.
The first LLMSlim release established the installable Python package and its simple offline compression entry point.
Python 3.8+TF-IDF rankingPublic compress() API

Installable LLMSlim package

v0.1.0 published the llmslim package for Python 3.8+ with the public compress(), ContextCompressor, CompressionResult, token, pipeline, and cost utility exports.

Offline prompt compression foundation

The initial engine provided ratio-driven prompt compression using TF-IDF sentence scoring and thresholding, with optional semantic, fast-token, and NLTK extras.