Huzaifa785/context-compressor

AI-powered text compression library for RAG systems and API calls. Reduce token usage by up to 50-60% while preserving semantic meaning with advanced compression strategies.

52
/ 100
Established

Implements four distinct compression strategies (extractive, abstractive, semantic, hybrid) leveraging transformer models like BERT and BART, with query-aware optimization to prioritize relevant content. Provides comprehensive quality evaluation via ROUGE scores, semantic similarity, and entity preservation metrics alongside token counting. Integrates directly with LangChain pipelines, OpenAI/Anthropic APIs, and includes a production-ready FastAPI service with Docker deployment support.

Used by 1 other package. No commits in the last 6 months. Available on PyPI.

Stale 6m
Maintenance 2 / 25
Adoption 10 / 25
Maturity 24 / 25
Community 16 / 25

How are scores calculated?

Stars

80

Forks

13

Language

Python

License

MIT

Last pushed

Aug 16, 2025

Commits (30d)

0

Dependencies

26

Reverse dependents

1

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/rag/Huzaifa785/context-compressor"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.