scaledown  by scaledown-team

Intelligent framework for LLM context optimization

Created 9 months ago
894 stars

Top 40.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary ScaleDown is an intelligent context optimization framework that significantly reduces Large Language Model (LLM) token usage while preserving semantic meaning. It targets developers and researchers seeking to lower LLM operational costs and improve interaction efficiency through intelligent code selection and prompt compression.

How It Works The framework combines local code optimization with API-powered prompt compression. Local optimization is handled by two modules: HASTE Optimizer, which uses hybrid AST-guided selection (Tree-sitter, BM25, semantic search) for code retrieval, and Semantic Optimizer, employing local embeddings (FAISS, transformer models) for semantically similar code chunk identification. The ScaleDown Compressor then uses an API service to rewrite prompts and context into a token-efficient format. Users can chain these components in a modular pipeline for custom workflows.

Quick Start & Requirements

  • Installation: Core package (pip install scaledown), or with optimizers (pip install scaledown[haste], pip install scaledown[semantic], pip install scaledown[haste,semantic]). Development installation involves cloning the repo and setting up a virtual environment.
  • Prerequisites: Python. An API key (SCALEDOWN_API_KEY) and optional API URL (SCALEDOWN_API_URL) are required for the compression service. Specific optimizers may require additional dependencies.
  • Configuration: API keys can be set via environment variables or programmatically.
  • Links: Homepage: https://scaledown.ai, Documentation: https://docs.scaledown.ai.

Highlighted Details

  • HASTE Optimizer: AST-guided code selection with hybrid search capabilities.
  • Semantic Optimizer: Local embedding-based code search for nuanced relevance.
  • API-Powered Compression: Efficient prompt rewriting via a dedicated service.
  • Modular Pipeline: Flexible chaining of optimizers and compressors.

Maintenance & Community The project is actively maintained on GitHub (https://github.com/scaledown-team/scaledown), with issues tracked at https://github.com/scaledown-team/scaledown/issues. Comprehensive documentation is available at https://docs.scaledown.ai.

Licensing & Compatibility Licensed under the MIT License. This permissive license allows for broad compatibility, including commercial use and integration into closed-source projects.

Limitations & Caveats The primary compression functionality depends on an external API service, necessitating API key management and network access. Certain optimizers require separate installation of specific dependencies. The effectiveness of context reduction is contingent on the input data and query complexity.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
0
Star History
899 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.