Skip to content
PyRank
  • Search
  • PyPI
  • GitHub
  • Insights
  • Compare
  • Advisories
  • Ecosystem
  • About

Context Compression Python Packages

Python packages with the GitHub topic context-compression. Sorted by monthly downloads, with stars and forks.
juyterman1000
entroly-core

Local-first AI efficiency layer for coding agents and LLM apps. Budget and recover context, verify outputs against source, and resume work across agents.

10K 489 75
activeing123
mcptoon

One zero-dependency MCP gateway CLI for every server and agent skill. Token optimization, tool discovery and context compression: 71,929 -> 581 tokens (-99.2%, measured), schemas stay out of context. One config for Claude Code, Codex, Cursor, every agent. 561KB, pure Python. | 零依赖 CLI:管所有 MCP 工具与技能,工具发现省 99.2% token。

10K 446 26
dshakes
distil-llm

Compression with a quality contract — cache-aware, causally-pruned LLM context compression for agentic runtimes, certified non-inferior across 7 domains. Works with any SDK.

7K 21 3
juyterman1000
entroly

Local-first AI efficiency layer for coding agents and LLM apps. Budget and recover context, verify outputs against source, and resume work across agents.

6K 489 75
Stxyu-p
trimtok

Cut token usage in Claude Code, Cursor, Codex & Gemini: deterministic in-process context compression for AI coding agents. Lossless and retrievable (#ref), AST code skeletons, TOON JSON tables, stdio MCP. No LLM, no network, MIT.

5K 2 0
g0GobliN
sutra-agent

A stone gate for the context window.⛩️

4K 2 1
khanhtq29vn
contextcraft-ai

AST-Aware, Personalized-PageRank-Ranked, Token-Budgeted Codebase Compressor for LLMs

4K 66 7
riceharvest
ctxprune

Shrink what your LLM reads: lossless tool-output compression for Claude Code, Codex, Hermes, Pi, OpenCode (MCP results as rows, no content dropped) + token pruning for RAG/LangChain, level with LLMLingua-2-large on held-out LongBench.

3K 0 0
Thanatos9404
llmslim

Long-term memory for AI agents with no LLM call: an MCP server and Claude Code plugin, plus local-first context compression for LLM apps.

3K 27 3
layer1labs
specsmith

Lean AEE governance for requirements, linked tests, epistemic context, evidence, and AI-assisted changes.

3K 9 1
wasabihu
cairnkit

A small agent runtime for business apps: the host owns identity, writes become drafts a person approves.

2K 3 1
lucasmartins-ai
local-context-compiler

Compact coding-agent context without summarizing it away. Verbatim, offline, with a receipt and recall for every cut. CLI, MCP server, Claude Code plugin. MIT.

2K 20 6
Taha-azizi
contextpress

Deterministic context compression for LLM chat, RAG, and agent pipelines

2K 2 1
maheshmakvana
graphsift

Save Claude, GPT-5 & Gemini API costs with LLM token optimization. 80-150x code context reduction, 86% CLI compression, F1 0.85 relevance. AST dep graph, BM25+graph selection, tree-sitter parsing, MCP server, agent memory. Zero external deps.

2K 6 0
naranor
agent-coderag

CodeRAG: Lightweight semantic code search and distillation utility for AI coding agents. It solves the API knowledge gap via real-time local signature extraction and intent analysis. Optimized for token efficiency, it compresses codebase context into compact semantic summaries stored in a local DuckDB vector similarity index.

1K 2 1
omar-y-abdi
furl-ctx

Prompt and context compression for AI agents to reduce LLM token costs - typically 0-54% fewer tokens on real high-entropy content, up to 95% on repetitive logs/fixtures (best-case ceiling), reversible via CCR. Note: furl-ctx is not furl, the unrelated URL-manipulation library.

1K 5 0
ojuschugh1
sqz

Pre-injection context compression and session deduplication for AI coding agents: squeeze tool output, code, JSON and logs before they reach the LLM

1K 680 45
MlkBlk-IT
icyloom

Unified local gateway: LLM cache + compressed context drawer, in a single MCP server

1K 1 0
finktech-dev
llm-zip

Self-hosted HTTP sidecar for LLM context compression. Reduce token costs 3–5× before calling any AI API — powered by LLMLingua-2 and MarkItDown. No proxy, no API keys, no GPU required.

930 1 0
compactbench
compactbench

Open benchmark for LLM context compaction methods — measures what survives when you replace conversation history with a compacted artifact. Multi-cycle drift, hidden ranked set.

824 11 2
robbiebusinessacc
justllm

Production LLM calls. Just the three lines. Cross-provider fallback, native caching, and reversible context compression on by default.

799 2 1
MakeaMouse
fish-bridge-mcp

An economical and fuel(token) efficient AI tool, graph session memory for looong chat session

706 2 0
open-compress
claw-compactor

14-stage Fusion Pipeline for LLM token compression — reversible compression, AST-aware code analysis, intelligent content routing. Zero LLM inference cost. MIT licensed.

602 2K 182
castnettech
mnemosyne-engine

LLM Context Compression and Retrieval Engine -- zero dependencies, sub-100ms queries, document + code ingestion

437 65 9
    • Original data from PyPI, GitHub, and OSV; downloads served through ClickHouse
    • Sources & methodology