microsoft/LLMLingua

[EMNLP'23, ACL'24] To speed up LLMs' inference and enhance LLM's perceive of key information, compress the prompt and KV-Cache, which achieves up to 20x...

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 43 minutes ago
Added to GitGenius on September 9th, 2026
Created on July 7th, 2023
Open Issues & Pull Requests: 121 (+0)
GitHub issues: Enabled
Number of forks: 424
Total Stargazers: 6,650 (+0)
Total Subscribers: 40 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 13.4 days
Mean response time: 46.1 days
90th percentile: 196.2 days
Tracked items: 53

How this project is maintained

100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 57% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 42
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 617 days
Stale 30+ days: 42
Stale 90+ days: 41

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • question (37)
  • bug (16)
  • feature request (2)
  • feature (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

LLMLingua is a prompt compression tool that speeds up large language model inference and improves model focus on key information by compressing prompts and KV-cache with minimal performance degradation.

The tool addresses the challenge of processing long contexts in LLMs, which suffer from increased latency and reduced attention to critical information. LLMLingua achieves this through prompt compression techniques that identify and preserve essential content while removing redundancy. The approach works by analyzing prompt structure to determine which tokens and information are most important for the model's task, then reconstructing a compressed version that maintains semantic meaning and task performance.

Teams should consider LLMLingua when working with applications that process lengthy prompts, such as document analysis, retrieval-augmented generation systems, or multi-turn conversations where context accumulates. The tool is particularly valuable for cost-sensitive deployments where reducing token processing directly lowers inference expenses. It suits projects where latency matters and where the overhead of compression is outweighed by faster model execution. The project offers multiple variants—the base LLMLingua, LongLLMLingua for extended contexts, and LLMLingua-2—allowing teams to choose based on their specific context length and performance requirements.

The project maintains active development with regular updates addressing both core compression algorithms and new model variants. The codebase includes comprehensive examples and integration patterns for common use cases. Documentation covers both theoretical foundations and practical implementation details, supporting developers in understanding compression trade-offs for their specific scenarios. The project provides demo interfaces for testing compression behavior before integration, reducing adoption friction for teams evaluating the approach.