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

Prompt Compression Python Packages

Python packages with the GitHub topic prompt-compression. Sorted by monthly downloads, with stars and forks.
fkiene
llmtrim

Local proxy that compresses your LLM API requests so you pay less, with no change to the answers. Trims wasted tokens from prompts, history, tool output, and code before they're sent: -31% input / -74% output, measured live. Any provider, no extra model calls. Also an MCP server and embeddable library (Rust, Python, Ruby, Kotlin, Swift, JS/TS).

6K 277 24
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
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
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
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
NadirRouter
barber-llm

Query-aware context trimming for LLM requests. Your context could use a trim.

1K 5 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
bnimit
memor-cli

One local memory shared by every AI coding agent — Claude Code, Cursor, Codex, Copilot, Kimi, Goose. No API key, no cloud, no plugin to install. Plus opt-in token compression.

912 2 0
KathanModh259
latent-gate

MCP server that shrinks logs, JSON, docs and web pages before your AI reads them. Offline, deterministic, ~3ms, no API key. 66% fewer tokens on a mixed dev corpus, 90%+ on logs.

898 25 2
kettertom
prompt-compressor

Rule-based LLM prompt compression — 30+ algorithms, zero dependencies

798 0 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
ashishjsharda
llm-token-surgeon

Cut your LLM API costs 30–70% automatically. Zero accuracy loss. Works with OpenAI, Anthropic, and Gemini.

495 1 0
anilatambharii
agentmesh-proxy

The governance plane for AI agents — policy, budget, and audit across every framework. Istio for AI agents.

493 1 1
h2cker
llama-index-postprocessor-vecr

Deterministic, auditable LLM context compression — regex whitelist guarantees structured facts (IDs, URLs, dates, code) survive. Two layers: retention + heuristic knapsack.

410 0 0
h2cker
langchain-vecr-compress

Deterministic, auditable LLM context compression — regex whitelist guarantees structured facts (IDs, URLs, dates, code) survive. Two layers: retention + heuristic knapsack.

410 0 0
liurongchen1
shenlun-forge

Context compression for LLM agents that you can measure on your own conversations

398 1 0
aimaghsoodi
foveance

A lossless token-optimization codec for LLM agents — cut input tokens up to 82%, nothing dropped. Drop-in proxy for Claude Code, Codex, Cursor, and any OpenAI/Anthropic client.

389 22 1
howwang0507
adaptive-prompt-compressor

Adaptive Prompt Compression system powered by Contextual Bandit (LinUCB) to optimize LLM API costs and response quality. 🧠🤖

316 0 0
nguyenminhduc9988
tokenseive

Multi-layer token optimization for LLM applications — compress prompts, map codebases, reduce output. Zero required dependencies.

251 4 0
contextcrunch-ai
contextcrunch

Compress LLM Prompts and save 80%+ on GPT-4 in Python

213 3 1
jia-gao
leanctx

Drop-in prompt compression for production LLM apps. Cut your token bill 40-60% without changing your code. Python SDK, LLMLingua-2, MIT.

187 324 7
arjunkshah
supercompress

SuperCompress — learned context compression for LLMs.

159 11 1
DelvyG
promptminify

Minify LLM prompts to save tokens — domain-aware, tiktoken-validated, zero regressions

148 1 0
    • Original data from PyPI, GitHub, and OSV; downloads served through ClickHouse
    • Sources & methodology