prompt-compression

Solid

Token-efficient prompt compression techniques for cost optimization

AI & Automation 1,160 stars 71 forks Updated today MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
54
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Prompt Compression Skill ## Capabilities - Implement token-efficient prompt compression - Design context pruning strategies - Configure selective context inclusion - Implement LLMLingua-style compression - Design summary-based compression - Create compression quality metrics ## Target Processes - cost-optimization-llm - agent-performance-optimization ## Implementation Details ### Compression Techniques 1. **LLMLingua**: Token-level compression 2. **Summary Compression**: LLM-based summarization 3. **Selective Context**: Relevant section extraction 4. **Token Pruning**: Remove low-importance tokens 5. **Document Filtering**: Pre-retrieval filtering ### Configuration Options - Compression ratio targets - Quality threshold settings - Token budget constraints - Compression model selection - Evaluation metrics ### Best Practices - Monitor quality vs compression tradeoff - Test with representative prompts - Set appropriate compression ratios - Validate compressed prompt quality - Track cost savings ### Dependencies - llmlingua (optional) - tiktoken - transformers

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

prompt-compressor

Compress verbose prompts & context before LLM processing. This skill should be used when input exceeds 1500 tokens, contains redundant phrasing, or includes unnecessary context. Reduces tokens by 40-60%.

2 Updated today
hackermanishackerman
AI & Automation Solid

optimizing-prompts

This skill optimizes prompts for Large Language Models (LLMs) to reduce token usage, lower costs, and improve performance. It analyzes the prompt, identifies areas for simplification and redundancy removal, and rewrites the prompt to be more concise and effective. It is used when the user wants to reduce LLM costs, improve response speed, or enhance the quality of LLM outputs by optimizing the prompt. Trigger terms include "optimize prompt", "reduce LLM cost", "improve prompt performance", "rewrite prompt", "prompt optimization".

2,274 Updated today
jeremylongshore
AI & Automation Listed

token-optimizer

Maximize Claude's output quality while minimizing input token usage. Use this skill whenever a user wants to compress prompts, reduce token consumption, extract maximum output from Claude, write high-density instructions, optimize system prompts, or improve AI communication efficiency. Trigger on phrases like "optimize my prompt", "too many tokens", "make this shorter but better", "get more from Claude", "compress this prompt", "write a better system prompt", "token efficient", or any request to improve how someone communicates with Claude or any LLM. Also trigger when building AI-powered tools, chatbots, agents, or any system where prompt cost or quality matters.

2 Updated today
samibajwaisking
AI & Automation Solid

context-compression

When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request.

39,350 Updated today
sickn33
AI & Automation Listed

context-compression

This skill should be used when the user asks to "compress context", "summarize conversation history", "implement compaction", "reduce token usage", or mentions context compression, structured summarization, tokens-per-task optimization, or long-running agent sessions exceeding context limits.

3 Updated today
Kalyanikhandare29