Skip to main content

Convert Repomix/repominify output into compact AI-friendly codebase summaries using free LLMs.

Project description

savetoken 🪙

Convert your Repomix codebase dump into a compact semantic summary — optimized for AI prompts, with zero raw code.

Instead of pasting 50,000 tokens of source code into ChatGPT or Claude, savetoken uses a free LLM to read the code once and produce a structured codebrief.md you reuse forever.


How it fits in your workflow

Your project
    ↓
npx repomix              # packs codebase → repomix-output.xml
    ↓
savetoken summarize repomix-output.xml   # translates → codebrief.md  ← you are here
    ↓
Paste codebrief.md into your AI prompt   # ~500 tokens instead of 50k+

Install

pip install savetoken

Requires Python 3.10+. Zero dependencies beyond stdlib.


Quick start

# 1. Pack your codebase with Repomix
npx repomix

# 2. Summarize with Gemini Flash (free tier)
export GEMINI_API_KEY=your_key_here
savetoken summarize repomix-output.xml

# Output: codebrief.md — paste it into any AI prompt!

Python API

from savetoken import SaveToken

st = SaveToken(provider="gemini", api_key="...")
summary = st.summarize("repomix-output.xml")
st.save(summary, "codebrief.md")

Providers

Provider Free tier Set env var
Gemini Flash 2.0 ✅ Generous GEMINI_API_KEY
Groq (Llama 3.3 70B) ✅ Fast GROQ_API_KEY
Mistral Small ✅ Available MISTRAL_API_KEY
OpenAI / DeepSeek Paid OPENAI_API_KEY

Gemini is recommended — 1M token context window handles large codebases.


CLI

savetoken summarize repomix-output.xml
savetoken summarize repomix-output.xml --provider groq --output brief.md --lang pt
savetoken summarize repomix-output.xml --force   # ignore cache, regenerate all
savetoken clear-cache
Flag Default Description
--provider gemini LLM provider
--output codebrief.md Output file
--format markdown markdown or json
--lang en Description language
--force off Skip cache
--cache-dir .savetoken_cache Cache location

Caching

savetoken hashes each file's content. On re-runs, only changed files are re-summarized. The cache lives in .savetoken_cache/ — commit it to git to share across your team.


VS Code Extension

Install the extension and use:

  • Command Palette → SaveToken: Summarize Codebase
  • Right-click repomix-output.xmlSaveToken: Summarize
  • Configure provider and API key in Settings → SaveToken

Example output (codebrief.md)

# MyShop — savetoken summary

E-commerce backend built with FastAPI and PostgreSQL.

**Stack:** FastAPI, PostgreSQL, SQLAlchemy, Redis
**Architecture:** Layered MVC
**Entry points:** main.py

## Directory Map
- `src/api` — HTTP route handlers (REST)
- `src/services` — Business logic layer
- `src/models` — SQLAlchemy ORM entities

## Files

### `src/services/order.py`
Manages the full lifecycle of customer orders.

**Entities:**
- Order(id, user_id, total, status: enum[pending, paid, cancelled])

**Functions:**
- create_order(user_id, items) → Order: validates stock and creates order
- cancel_order(order_id) → bool: cancels if status allows
- calculate_total(items) → Decimal: applies discounts and rounds

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

savetoken-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

savetoken-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file savetoken-0.1.0.tar.gz.

File metadata

  • Download URL: savetoken-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for savetoken-0.1.0.tar.gz
Algorithm Hash digest
SHA256 33a20f1775b6ed6fd68858dfa020721efefa0fd01b61516b82e19da32604607d
MD5 979c1c9d283d453edaa655ca875a59ac
BLAKE2b-256 6f9d816daf3da1027edde7c6dae7ed58d788e93c251cb536285e23522ff1ac16

See more details on using hashes here.

File details

Details for the file savetoken-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: savetoken-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for savetoken-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcda5b8d978c0ad0740747dc3af398e9cdc30d4b9b53162c4f922ff50a3dd12f
MD5 36091fe3ac4f9479721969e9a0dfb031
BLAKE2b-256 9765f3a373eef9a82522da33aca024ebb7012a6279f3f0a100e2a16c43c610a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page