Open Source: llmslim – Semantic Prompt Compression for LLM Applications

Published my first open-source Python package: llmslim.

It compresses prompts, chat histories, and RAG contexts using semantic chunking + extractive ranking before sending them to an LLM.

Example:

2847 tokens → 1138 tokens (60% reduction)

Looking for feedback from the HF community on:

  • Evaluation methodology
  • Embedding model choices
  • Retrieval + compression workflows
  • Long-context benchmarking

GitHub - Thanatos9404/llmslim: Shrink LLM prompts by 40-70% while preserving meaning, semantic chunking + extractive summarization · GitHub

Contributions and criticism welcome.

4 Likes