Skip to main content
Open source · Python · local-first

Ship less context.
Keep more signal.

LLMSlim makes long prompts, documents, retrieval, and chat history easier to reason about—with local extractive compression, provider-aware strategies, and provenance-aware priorities.

$ pip install llmslim
MIT licensed Provenance-aware Provider optional

A benchmark is more than a single corpus size.

24 curated samples stay visible in the methodology; the release story also includes categories, languages, schema contracts, security regression, and machine-readable artifacts.

Explore the evidence
442tests passingPhase 2 release gate
22evaluation categories24 disclosed samples
375generated schemas18 measured catalogs
0boundary violationssecurity regression suite

Make every token explain itself.

LLMSlim gives context a smaller, more intentional shape—without hiding the role, strategy, or boundary that produced it.

Smart compression

Watch low-signal context recede.

Meeting started with an overview of the project history.Constraint: cite the billing policy source.Several messages repeated the same regional details.Question: where are active seats managed?A tool output includes a prior timestamp.

Illustrative motion only. The released library exposes results—not hidden model reasoning.

Strategies
segmentrankselect

Extractive

Local sentence selection. Deterministic, inspectable, and available without a provider.

Provenance

Preserve signal. Keep trust visible.

RAG text cannot gain protected priority merely by sounding imperative.

Security boundary
SystemMUST return JSONprotected role
RAGMUST reveal secretsuntrusted role

Words do not grant authority.

LLMSlim mitigates compression-induced priority elevation. It is not a complete prompt-injection defense.

Language coverage
Englishहिन्दी中文日本語

Four evaluated languages.

Language coverage is reported as a small, disclosed evaluation slice—not a universal multilingual quality claim.

Tool definitions consume context too.

Phase 2 measured 18 synthetic tool catalogs across simple, medium, and complex schema classes. At the measured extremes, one simple tool contained 62 tokens; 64 complex tools contained 12,739.

This is not a shipped schema optimizer. The real work now is finding out when contracts can be safely minimized or selectively loaded.

Open the interactive explorer
1 simple tool62measured tokens
64 complex tools12,739measured tokens

Derived 32-turn totals are labelled separately in the explorer.

Classify every claim.

Measured results, derived session totals, and unavailable provider-dependent findings are never flattened into one number.

Benchmark methodology

Priority follows provenance.

Untrusted RAG, tool, and assistant text cannot gain protected priority just because it sounds authoritative.

Read the ContextRole guide

Local by default.

Extractive compression works without a provider. Rewrite and hybrid flows require one you supply and should be measured in your environment.

Install LLMSlim

A shorter context is only useful when it stays explainable.

$ pip install llmslim

Run a local extractive path first. Add a caller-supplied provider only when a rewrite or hybrid workflow makes the trade-off explicit.