Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Sugo logo

Sugo

Documents, reduced. Feed your LLM the sauce, not the water.

CI Python 3.12 AGPL-3.0-or-later Runs 100% offline

🇮🇹 Leggi in italiano


Sugo turns PDFs, Office files, screenshots and images into clean, compact Markdown for RAG systems, AI agents and LLM chats. It removes what only costs tokens (repeated headers and footers, page numbers, hidden text, tracking parameters, app chrome around a screenshot) and keeps the content, the tables and the structure. Everything runs on your computer: no cloud API, no telemetry, nothing sent anywhere.

In Italian, il sugo del discorso means "the gist", and a sugo is a sauce you reduce until only the concentrated flavour remains. That is what Sugo does to your documents.

What it does

A three-page PDF, as a plain text extractor gives it to your model (pages 1 and 3 look the same):

ACME S.p.A. - Annual Report 2025                Confidential
3.2 Revenue
Revenue grew by 12% in the second half, driven by the export market.
Details: https://acme.example/report?utm_source=newsletter&utm_medium=email
Page 14 of 120

What sugo report.pdf prints:

ACME S.p.A. - Annual Report 2025

# 3.1 Costs

Costs fell by 3% thanks to the new suppliers.
Details: https://acme.example/report

# 3.2 Revenue

Revenue grew by 12% in the second half, driven by the export market.
Details: https://acme.example/report

# 3.3 Outlook

The board expects stable growth next year.
Details: https://acme.example/report

The header is kept once instead of on every page; the page numbers, the repeated "Confidential" and the tracking parameters are gone; the text is the same. sugo stats measures the difference: 180 → 97 tokens, 46% saved on this small example. Every removal is recorded with the cleaner that made it and the reason, so you can always check what was dropped. Text that cannot be read is marked as illegible, never guessed.

The same holds across a benchmark corpus in five languages, with no content lost on any document:

Document Tokens saved
Report with a running header, footer and page numbers 33–38%
Chat or code screenshot, Markdown vs. sending the image itself 94–98% cheaper (Claude, Gemini, OpenAI)
A real EU regulation from EUR-Lex, mostly substantive legal text 2.9–3.5%

And it stays fast on an ordinary computer, not just a new one: on a 2010 desktop with 2 cores and no GPU, a 100-page PDF converts in 3.6 s and a phone screenshot in 13.7 s (full numbers in TESTING).

Status

Alpha. The first release, v0.1, is being finished: everything below works today from a source install. The PyPI package comes with v0.1.

Works today Coming next
Native PDFs, DOCX, XLSX, PPTX, XML Scanned-book cleaners, EPUB, email, web pages
Images and screenshots with local OCR (PNG, JPEG, WEBP) Larger tables, normal and quality engine levels
Chat and code screenshot detection Japanese, Chinese, Korean
Markdown, and JSON Lines chunks for vector databases Interactive shell, guided setup
Token metrics per provider (sugo stats) Background service and folder watcher
Command line, MCP server for agents, local web page Work profiles and recipes
Interface and text rules in English, Italian, Spanish, French, German

See the roadmap for the full plan.

Quick start

Sugo needs Python 3.12 and uv.

uv tool install git+https://github.com/Muralnick/sugo

Convert a file and print its Markdown:

sugo report.pdf

More things you can do:

sugo convert *.pdf -o out/            # one NAME.md per file, in out/
sugo convert report.pdf --chunks      # chunks as JSON Lines, ready for RAG
sugo stats screenshot.png             # tokens saved, per LLM provider
sugo clip                             # convert the screenshot in your clipboard
sugo ui                               # open the local web page: drop a file, get Markdown
sugo doctor                           # check the installation

Add --json for output a script can read.

Use it from an AI agent (MCP)

Sugo can serve agents such as Claude Code or Codex over MCP. It reads only inside the folders you name:

claude mcp add sugo -- sugo mcp --root ~/Documents

The agent gets two tools: convert_document and estimate_savings.

On an old computer

Measured on 2026-11-03 on a 2010 desktop: Intel Core i5-650 (2 cores, 4 threads, no AVX), 8 GB RAM, SSD, no usable GPU. Weaker than the 8 GB, 4-core machine Sugo targets.

Task Result Target
Native PDF, 100 pages, cleaning included 3.6 s, about 28 pages/s ≥ 20 pages/s
Peak memory, that PDF 98 MB < 1 GB
Dense phone screenshot (30 lines) → text, OCR 30 of 30 lines, 0% character errors, 411 MB < 1 GB
Same screenshot, time 13.7 s < 2 s

Native documents run well within the targets even on this machine. OCR is accurate but slow on a CPU without AVX; making it faster is on the roadmap. Details and scripts are in TESTING.

Supported files

Type Formats Size limit
Documents PDF (with a text layer), DOCX, XLSX, PPTX 200 MB
Images PNG, JPEG, WEBP (screenshots, photos of text) 50 MB
Data XML 50 MB

Old .doc, .xls and .ppt files and password-protected files are not read: save a new copy first.

How it works

flowchart LR
    F[Your file] --> E[Reader<br/>PDF · Office · OCR · XML]
    E --> IR[Document → Page → Block]
    IR --> C[Cleaners<br/>propose removals]
    C --> K[Core<br/>applies and records them]
    K --> M[Markdown]
    K --> J[JSONL chunks]
    K --> S[Token metrics]

Each reader turns a file into the same structure of pages and blocks. Cleaners only propose changes; the core applies them and marks each removed block with who removed it and why, instead of deleting it. That is what makes the output checkable and reproducible. The full design is in ARCHITECTURE.

Promises

These are written down in PRINCIPLES and checked by tests:

  • Local by principle. Conversion never needs the internet. No cloud API, no telemetry.
  • No guessing. Unreadable text is marked as illegible, never filled in.
  • Nothing silently lost. Every removal is recorded, with its reason.
  • Honest metrics. Savings are measured, and Sugo also tells you when sending the original image would be cheaper.
  • Safe with untrusted files. Size and time limits, XML parsed safely, models verified by checksum. See the threat model.

Documentation

Document Content
ARCHITECTURE Complete system design
FEATURES Features by engine level, work profiles, supported formats
THREAT_MODEL Security analysis
TESTING Testing, benchmarks, performance targets
ROADMAP Development plan and first release scope
ADRs Architecture decision records
PRINCIPLES The promises Sugo never breaks
AI_WORKFLOW How this project is built with AI assistance

Contributing and security

See CONTRIBUTING. Please report vulnerabilities privately, as described in SECURITY, not in public issues.

License

AGPL-3.0-or-later (see ADR-010).

Metadata

Release files for sugo-cli 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sugo-cli 0.1.0a1
File Size Uploaded Provenance Actions
sugo_cli-0.1.0a1.tar.gz 2.0 MB Without provenance Details for sugo_cli-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sugo-cli 0.1.0a1
File Interpreter ABI Platform Actions
sugo_cli-0.1.0a1-py3-none-any.whl Python 3 none any Details for sugo_cli-0.1.0a1-py3-none-any.whl

Total release size: 4.0 MB

Release files / sugo_cli-0.1.0a1.tar.gz

Download URL sugo_cli-0.1.0a1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
f206a431e6cbbb511972d0b281d6c9ab5ed17e69dc741b96bdc7553746011dc9
BLAKE2b-256 checksum
How to use checksums
203fdc10dbfd04bdc5973c1cb96d350596bdc4977f8e5778ca03a28d4249deaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sugo_cli-0.1.0a1-py3-none-any.whl

Download URL sugo_cli-0.1.0a1-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
961495764f68af0aae02eefcb19934ca846fdcee99e271a655a3c7a107361bfc
BLAKE2b-256 checksum
How to use checksums
8dc611c7b5edaa4c0b782ab774158e5c78173ab0093d51f52dc03a14fed42afa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sugo-cli 0.1.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page