Search tldr

llm-min.txt: Min.js Style Compression of Tech Docs for LLM Context

llm-min converts technical documentation into compact Structured Knowledge Format manifests for AI coding assistants. Its multi-stage Gemini pipeline claims 90–95% typical token reduction while retaining APIs, relationships, and usage patterns.

Share

llm-min.txt: Min.js Style Compression of Tech Docs for LLM Context

Author: marv1nnnnn | Published: Unknown | Generated: 2025-05-16 | Domain: github.com
Tags: ‘#llm’ ‘#documentation’ ‘#context-engineering’ ‘#gemini’ ‘#python’ ‘#developer-tools’


TLDR

llm-min is a Python tool that uses Gemini to transform library documentation into a compact, machine-oriented Structured Knowledge Format (SKF) file for use as LLM context. It targets the gap between rapidly changing software documentation and model knowledge cutoffs, preserving APIs, component relationships, and workflows while intentionally discarding explanatory prose. The project reports typical 90–95% token reductions—sometimes over 97%—with compressed outputs commonly around 10,000 tokens, though the format is explicitly lossy and code-generation performance has not yet been rigorously benchmarked.

Key Takeaways

  • Structured, lossy technical reference: Output llm-min.txt uses SKF/1.4 LA with DEFINITIONS (D), INTERACTIONS (I), and USAGE_PATTERNS (U) sections; the generation-time glossary is omitted from the final file to save tokens.
  • Compression target: The project contrasts its approach with llms.txt files that can exceed 800,000 tokens and claims 90–95% usual reduction from raw documentation, with some examples exceeding 97%.
  • Three-stage Gemini pipeline: It gathers documentation, chunks it, creates and merges a global entity glossary, generates definitions/interactions, then produces usage patterns with consistent cross-references.
  • Multiple input modes: The CLI supports crawling a Python package (--package), a documentation URL (--doc-url), or recursively processing local .md, .txt, and .rst files (--input-folder).
  • Operational constraints: The recommended default model is gemini-2.5-flash-lite-preview-06-17, cited for its 1-million-token context window; generation can take minutes and is estimated at $0.01–$1.00 per moderate-size library. Smaller chunks may avoid Gemini MAX_TOKENS failures.
  • Companion schema is required: Users should provide both llm-min.txt and llm-min-guideline.md to coding assistants so they can decode the SKF notation correctly.

Images & Media

  • llms.txt token comparison — Illustrates the large token counts associated with llms.txt documentation files.
  • llm-min.txt icon — Project icon used in the README’s introduction to the approach.
  • Token Compression Comparison — Compares original llm-full.txt documentation token counts with compressed llm-min.txt outputs.
  • Demo — GIF demonstrating use of compressed documentation as context in an AI-powered IDE.
  • llms.txt — Community initiative for AI-oriented, up-to-date library reference files.
  • Context7 — Service for dynamically delivering contextual documentation to AI tools.
  • llm-min guideline — Schema and decoding guidance for SKF manifests.
  • Google AI Studio API keys — Source for obtaining a Gemini API key.
  • Google Cloud Gemini pricing — Current Gemini API pricing reference.
  • Roocode — AI coding environment reportedly used to develop the project.
  • Rooroo — The author’s custom Roocode configuration.

Keep reading