Sugo

io.github.Muralnick由 GitHub 账号 Muralnick 发布v0.1.2更新于 Nov 7, 2026

Local, offline conversion of PDFs, Office files and screenshots into compact Markdown.

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

Sugo 在本地把 PDF、Office 文件和截图转换成精简的 Markdown,并通过 MCP 向助手提供文档转换与 token 节省估算工具。

可以做什么
  • 转换文档与图片:把 PDF、DOCX、XLSX、PPTX、XML 以及 PNG/JPEG/WEBP 截图转为 Markdown,图片使用本地 OCR
  • 估算节省:按各 LLM 提供商报告一次转换节省的 token 数量
  • 清理并记录:去除重复页眉页脚、页码、隐藏文字和跟踪参数,并记录每处删除及其原因
  • 输出 RAG 素材:生成 Markdown 或供向量数据库使用的 JSON Lines 分块
适用场景
适合需要让助手读取本地文档或截图、又不希望上传到云服务的场景,也适合用清理后的 Markdown 替代原始提取文本或图片以降低 token 成本。
运行要求
以本地进程方式通过 uvx 运行 PyPI 包 sugo-cli;需要 Python 3.12 至 3.14,并占用约 400 MB 磁盘空间用于 PDF 库、OCR 引擎和模型。MCP 服务器启动时需指定根目录,只读取你指定的文件夹。无需账号、API 密钥或网络访问。
安装前请注意
转换会在磁盘上缓存提取出的文档文本,若文档涉及隐私应删除该缓存,且卸载程序不会清除它。服务器可读取你授权文件夹内的任意文件,应尽量缩小根目录范围。OCR 在带重音的截图上可能误读少量字符。项目仍处于 1.0 之前版本,接口可能变化。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sugo,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Sugo logo]

Sugo

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

[PyPI version] [CI] [Python 3.12, 3.13 and 3.14] [AGPL-3.0-or-later] [Runs 100% offline]

Quick start · What it does · Comparison · MCP · Roadmap · 🇮🇹 Italiano


🔒 100% local
no cloud, no telemetry
✂️ Fewer tokens
33–38% with repeated headers, ~3% on real legal text
🧾 Nothing lost silently
every removal is recorded
🪶 Light
runs on 8 GB RAM, no GPU

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 small generated three-page PDF, as a plain text extractor gives it to your model (pages 1 and 3 look the same):

text
ACME S.p.A. - Annual Report 2025                Confidential3.2 RevenueRevenue grew by 12% in the second half, driven by the export market.Details: https://acme.example/report?utm_source=newsletter&utm_medium=emailPage 14 of 120

What sugo report.pdf prints:

markdown
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 generated example; real documents with less page furniture save much less (see below). 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.

Across a benchmark corpus in five languages, no text went missing in any document (on 3 screenshots the OCR misread a few characters, 1–7%). Savings depend heavily on the document:

DocumentTokens saved
Report with a running header, footer and page numbers33–38%
Chat or code screenshot, Markdown vs. sending the image itself94–98% cheaper (Claude, Gemini, OpenAI)
A real EU regulation from EUR-Lex, mostly substantive legal text2.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).

How it compares

Measured against two well-known alternatives, on the same 31-document benchmark corpus (26 synthetic documents made by the Sugo project plus 5 real EU-regulation PDFs), with the same tokenizer and the same ground truth — full method, raw numbers and limits in docs/comparisons:

SugoDoclingMarkItDown
Documents converted with nothing lost or garbled28 / 3125 / 3114 / 31
OCR on chat/code screenshots✅ no text missing; 1–7% character errors on 3 accented screenshots⚠️ right words, wrong order on some chats❌ empty output
Reads PDFs out of the box✅✅❌ needs an extra
Real EU regulation PDF, every clause kept✅⚠️ 2 of 5 drop a clause❌ every one drops 2–7

A tool that drops content also "saves" tokens on paper — that's data loss, not compression. Every number above is paired with what actually survived the conversion.

Fair caveats: the corpus is small and mostly synthetic, and it was built by the Sugo authors, so treat it as a sanity check, not a verdict. On the report PDFs Docling saves slightly more tokens than Sugo (about 38–48% vs 33–38%) without losing content; it is also several times slower on this corpus. Raw data and the full per-document table are in the linked comparison.

Status

[!NOTE] v0.1.1 is out, on PyPI as sugo-cli (v0.1.0 was the first signed release). It is still 0.x: contracts may change, with notice, before 1.0. Releases are built reproducibly, with an SBOM, Sigstore attestations and PyPI Trusted Publishing.

Works todayComing next
Native PDFs, DOCX, XLSX, PPTX, XMLScanned-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 detectionJapanese, Chinese, Korean
Markdown, and JSON Lines chunks for vector databasesInteractive shell, guided setup
Token metrics per provider (sugo stats)Background service and folder watcher
Command line, MCP server for agents, local web pageWork 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, 3.13 or 3.14. The install is about 400 MB on disk, because the PDF library, the OCR engine and its models come with it. The easiest way to install it is with uv:

bash
uv tool install sugo-cli

Or with pip:

bash
pip install sugo-cli

If sugo is "not recognized" or "not found" after installing with pip, pip put it in a folder your system does not search. This happens on Windows when pip installs for your user only ("Defaulting to user installation"). Either install with uv tool install sugo-cli and run uv tool update-shell once, or add the folder pip names in its warning (on Windows, %APPDATA%\Python\Python3XX\Scripts) to your Path, then open a new terminal.

[!TIP] The package is called sugo-cli because the name sugo on PyPI is held by an unrelated, empty project (a name transfer request is open). The installed command is still sugo; sugo-cli works too. Older instructions with sugo-cli[lite] still work: everything is now included by default.

To run the latest development version from source instead:

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

Convert a file and print its Markdown:

bash
sugo report.pdf

More things you can do:

bash
sugo convert *.pdf -o out/            # one NAME.md per file, in out/sugo convert report.pdf --chunks      # chunks as JSON Lines, ready for RAGsugo stats screenshot.png             # tokens saved, per LLM providersugo clip                             # convert the screenshot in your clipboardsugo ui                               # open the local web page: drop a file, get Markdownsugo 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:

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

The agent gets two tools: convert_document and estimate_savings.

Uninstall

Remove the program the same way you installed it:

bash
uv tool uninstall sugo-cli

Or, if you used pip:

bash
pip uninstall sugo-cli

If you added Sugo to an agent, remove it there too, for example claude mcp remove sugo.

Uninstalling the program does not delete the files Sugo created. They are only on your computer, and you can delete them by hand:

WhatWindowsmacOSLinux
Settings (config.toml)%LOCALAPPDATA%\sugo~/Library/Application Support/sugo~/.config/sugo
Cache (text of converted documents)%LOCALAPPDATA%\sugo\Cache~/Library/Caches/sugo~/.cache/sugo

If you set SUGO_CACHE_DIR, the cache is in that folder instead. The cache holds text from the documents you converted, so delete it if those documents were private. Apart from these two folders and the files you asked it to write (such as -o output or receipts), Sugo keeps nothing else on disk.

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.

TaskResultTarget
Native PDF, 100 pages, cleaning included3.6 s, about 28 pages/s≥ 20 pages/s
Peak memory, that PDF98 MB< 1 GB
Dense phone screenshot (30 lines) → text, OCR30 of 30 lines, 0% character errors, 411 MB< 1 GB
Same screenshot, time13.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

TypeFormatsSize limit
DocumentsPDF (with a text layer), DOCX, XLSX, PPTX200 MB
ImagesPNG, JPEG, WEBP (screenshots, photos of text)50 MB
DataXML50 MB

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

How it works

mermaid
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

DocumentContent
ARCHITECTUREComplete system design
FEATURESFeatures by engine level, work profiles, supported formats
THREAT_MODELSecurity analysis
TESTINGTesting, benchmarks, performance targets
ROADMAPDevelopment plan and first release scope
ADRsArchitecture decision records
PRINCIPLESThe promises Sugo never breaks
AI_WORKFLOWHow 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).

来源:README.md,提交 198f727

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Nov 7, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分