autogen/website/docs/topics/handling_long_contexts/compressing_text_w_llmligua.md
# Compressing Text with LLMLingua  Text compression is crucial for optimizing interactions with LLMs, especially when dealing with long prompts that can lead to higher costs and slower response times. LLMLingua is a tool designed to compress prompts effectively, enhancing the efficiency and cost-effectiveness of LLM operations.  This guide introduces LLMLingua's integration with AutoGen, demonstrating how to use this tool to compress text, thereby optimizing the usage of LLMs for various applications.  :::info Requirements Install `pyautogen[long-context]` and `PyMuPDF`:  ```bash pip install "pyautogen[long-context]" PyMuPDF ```  For more information, please refer to the [installation guide](/docs/installation/). ::: 