awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
microsoft avatar

microsoft/LLMLingua

0
View on GitHub↗
5,844 stars·350 forks·Python·mit·20 viewsllmlingua.com↗

LLMLingua

LLMLingua is a prompt compression tool that reduces token count in prompts before they are sent to a large language model, cutting API costs and latency while preserving task performance. It operates as an extractive pipeline using a BERT-level Transformer encoder to classify each token for removal based on full bidirectional context from the prompt, retaining only key information and discarding non-essential tokens.

The tool is trained through a knowledge distillation process, where a compact compression model learns from an extractive dataset derived from a large language model's output to guide token removal decisions. This approach enables task-agnostic compression without requiring fine-tuning for out-of-domain inputs, and also helps mitigate the lost-in-the-middle effect in retrieval-augmented generation and chain-of-thought scenarios.

Beyond basic prompt compression, LLMLingua supports compressing long context prompts, segmenting conversation histories by topic for structured memory retrieval, and denoising retrieved memory units to improve accuracy. The library is designed to accelerate LLM inference by feeding compressed prompts instead of full-length inputs, and its capabilities extend to improving downstream task performance in RAG and CoT workflows.

Features

  • Prompt Compressors - Ships a bidirectional Transformer encoder that classifies tokens for removal to compress prompts.
  • Token Classification Compressors - Provides a BERT-level encoder that classifies tokens for removal using full bidirectional context.
  • Extractive Prompt Compressors - Ships an extractive pipeline that selects key information from prompts and discards non-essential tokens.
  • Extractive Distillation Pipelines - Trains a compact model on an extractive dataset derived from LLM output to guide token removal.
  • Prompt-Based Accelerators - Accelerates LLM response times by compressing prompts before inference.
  • Extractive Compression Distillers - Distills compression knowledge from LLMs by training a small model on an extractive dataset.
  • LLM Cost Management - Reduces LLM inference costs by compressing prompts before API calls to cut token usage.
  • Model Inference Accelerators - Accelerates model inference by feeding compressed prompts instead of full-length inputs.
  • Redundancy Removers - Removes redundant tokens identified by a small language model to cut API costs and latency.
  • Lost-in-the-Middle Mitigations - Provides prompt compression that reduces lost-in-the-middle effects to improve RAG and CoT task performance.
  • Inference Acceleration - Accelerates LLM inference by feeding compressed prompts instead of full-length inputs.
  • Bidirectional Context Compressors - Compresses prompts by classifying tokens for removal using a Transformer encoder with bidirectional context.
  • Task-Agnostic Compressors - Compresses prompts task-agnostically using a distilled classifier trained on GPT-4 data.
  • Context Compression - Compresses lengthy prompts or documents by retaining only key information to lower cost and latency.
  • Lost-in-the-Middle Mitigators - Mitigates the lost-in-the-middle effect by compressing prompts to focus on essential context.
  • Transformer-Based Reducers - Removes redundant tokens from prompts using a small Transformer encoder trained on GPT-4 data.
  • Downstream Task Enhancers - Improves downstream task performance by compressing prompts to reduce lost-in-the-middle effects.
  • Prompt Compression - Accelerates inference by compressing prompts and context.
  • Prompt Engineering - Library for prompt compression to accelerate inference speeds.

Star history

Star history chart for microsoft/llmlinguaStar history chart for microsoft/llmlingua

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to LLMLingua

Similar open-source projects, ranked by how many features they share with LLMLingua.
  • juliusbrussee/cavemanJuliusBrussee avatar

    JuliusBrussee/caveman

    73,390View on GitHub↗

    Caveman is a set of tools and configurations designed for large language model token optimization. It focuses on reducing the amount of data processed during AI interactions to lower costs and maximize the available context window. The project implements a fragmented communication style that replaces full grammatical sentences with concise technical keywords. This approach extends to AI context optimization by condensing memory files and tool descriptions, and includes a specialized configuration for generating terse, one-line code reviews and short conventional commit messages. The system i

    JavaScriptaianthropiccaveman
    View on GitHub↗73,390
  • nvidia/tensorrtNVIDIA avatar

    NVIDIA/TensorRT

    13,076View on GitHub↗

    TensorRT is a deep learning inference engine and software development kit designed to optimize and deploy neural networks for high-performance execution on NVIDIA GPUs. It functions as a GPU acceleration framework that reduces latency and increases throughput for trained models during production deployment. The toolkit imports models from the Open Neural Network Exchange format and transforms them into optimized engines. It utilizes graph-based model optimization, layer-fusion kernel generation, and precision-based quantization to convert floating point weights into lower precision formats.

    C++deep-learninggpu-accelerationinference
    View on GitHub↗13,076
  • nebuly-ai/nebullvmnebuly-ai avatar

    nebuly-ai/nebullvm

    8,338View on GitHub↗

    Nebullvm is an AI inference accelerator, GPU resource orchestrator, and performance optimization library for large language models. It functions as an optimization layer designed to lower operational costs by aligning model execution with underlying hardware architectures. The system maximizes cluster efficiency through real-time dynamic partitioning and elastic quotas for shared hardware resources. It employs alignment methods and techniques to reduce the hardware and data requirements necessary for tuning large language models. The project covers broad capability areas including AI infrast

    Python
    View on GitHub↗8,338
  • anomalyco/models.devanomalyco avatar

    anomalyco/models.dev

    2,694View on GitHub↗

    models.dev is a directory and intelligence system for large language models that provides a standardized catalog of technical specifications, provider mappings, and pricing data. It serves as a central index for model metadata, including context windows, output limits, and release dates. The project functions as a capability index and pricing comparison tool, allowing for the analysis of token costs across different hosting providers. It maps generic model names to the specific API identifiers required by various third-party platforms and tracks support for functional features such as tool ca

    TypeScript
    View on GitHub↗2,694
See all 30 alternatives to LLMLingua→

Frequently asked questions

What does microsoft/llmlingua do?

LLMLingua is a prompt compression tool that reduces token count in prompts before they are sent to a large language model, cutting API costs and latency while preserving task performance. It operates as an extractive pipeline using a BERT-level Transformer encoder to classify each token for removal based on full bidirectional context from the prompt, retaining only key information and discarding non-essential tokens.

What are the main features of microsoft/llmlingua?

The main features of microsoft/llmlingua are: Prompt Compressors, Token Classification Compressors, Extractive Prompt Compressors, Extractive Distillation Pipelines, Prompt-Based Accelerators, Extractive Compression Distillers, LLM Cost Management, Model Inference Accelerators.

What are some open-source alternatives to microsoft/llmlingua?

Open-source alternatives to microsoft/llmlingua include: juliusbrussee/caveman — Caveman is a set of tools and configurations designed for large language model token optimization. It focuses on… nebuly-ai/nebullvm — Nebullvm is an AI inference accelerator, GPU resource orchestrator, and performance optimization library for large… nvidia/tensorrt — TensorRT is a deep learning inference engine and software development kit designed to optimize and deploy neural… facebookincubator/aitemplate — AITemplate is an ahead-of-time deep learning compiler that translates PyTorch neural networks into standalone C++… diegosouzapw/omniroute — OmniRoute is a unified LLM API gateway that connects multiple AI providers to a single endpoint. Its primary purpose… agentops-ai/agentops — AgentOps is an observability platform and developer toolkit for monitoring the execution, performance, and reliability…