The gadget README.md (20,768 characters) handed verbatim to 58 models, asking for a project summary and then a usage tutorial in Chinese. Grouped by the tool that called them.

下面是开源项目 gadget 的 README。请你完成两件事:
1. 先用中文总结这个项目:它是什么、仓库结构、每个工具分别做什么。
2. 然后写一份详细的中文使用教程,面向第一次接触这个项目的人,覆盖环境准备、安装、配置,以及每个工具的典型用法(给出可以直接复制的命令)。
只依据 README 里写到的内容,不要编造 README 中没有出现的命令或参数。

===== README.md =====
<README.md 全文,20 768 字符>

Summarize the project in Chinese, then write a detailed Chinese tutorial for a first-time user with copy-pasteable commands. Use only what the README says; do not invent commands or flags.

Conditions: one run per model, no system prompt — read the numbers as orders of magnitude. Cloud models ran serially through their agent CLIs (codex exec / claude -p / cursor-agent --print) in an empty directory, prompt on stdin, so time includes CLI startup. Local models ran cold on an RTX 5090 and their speed is pure decode, so the two speeds are not comparable. Fable 5.1 had --effort high pinned; the other Claude models used the default effort.

Metrics (all regex): “Commands” counts code-block lines starting with pip, python, cd, bash and similar; “Not in README” counts those that, comments stripped and whitespace collapsed, cannot be found in the README; “Facts” is how many of 16 word-for-word README facts the output mentions, and “Missed” lists the rest.

Results

Codex (OpenAI)

Model Chars Time Output tokens Speed Commands Not in README Facts Missed
GPT-6.1 Sol 9,278 151 s 4,489 29.8 tok/s 33 1 15/16 GPL-3
GPT-6 Astra 8,800 132 s 4,104 31.2 tok/s 33 1 15/16 GPL-3
GPT-6 Sol 4,765 55 s 2,430 44.0 tok/s 28 — 15/16 GPL-3
GPT-6 Luna 4,781 42 s 2,062 49.1 tok/s 29 1 15/16 GPL-3
GPT-5.6 Sol 11,731 104 s 5,512 52.8 tok/s 39 4 16/16 —
GPT-5.6 Terra 6,622 58 s 2,984 51.7 tok/s 38 5 15/16 GPL-3
GPT-5.6 Luna 7,667 68 s 3,589 52.8 tok/s 39 4 16/16 —
GPT-5.5 8,517 68 s 3,595 52.6 tok/s 46 5 16/16 —
GPT-5.4 Mini 6,730 65 s 4,365 67.3 tok/s 41 3 15/16 GPL-3

Claude Code (Anthropic)

Model Chars Time Output tokens Speed Commands Not in README Facts Missed
Opus 5.5 8,689 60 s 7,284 120.8 tok/s 33 2 16/16 —
Fable 5.1 (effort high) 8,091 86 s 7,048 81.6 tok/s 34 2 16/16 —
Opus 5 12,340 97 s 8,456 87.6 tok/s 43 10 16/16 —
Sonnet 5 5,754 36 s 3,578 99.4 tok/s 31 1 16/16 —
Haiku 4.5 11,235 79 s 7,438 93.6 tok/s 75 29 15/16 GPL-3
haiku-4.5 8,814 48 s 5,446 113.5 tok/s 57 17 14/16 GPL-3 ai-companion
sonnet-4.6 5,588 49 s 3,257 66.1 tok/s 30 3 14/16 GPL-3 ai-companion
opus-4.6 4,660 42 s 2,768 66.6 tok/s 30 1 15/16 ai-companion
sonnet-5 4,407 29 s 2,698 93.3 tok/s 29 2 15/16 ai-companion
opus-4.7 5,138 44 s 3,271 74.6 tok/s 33 5 15/16 ai-companion
opus-4.8 6,270 55 s 4,223 77.2 tok/s 29 1 16/16 —
sonnet-5.5 7,112 31 s 4,522 147.8 tok/s 31 2 16/16 —
opus-5 11,650 88 s 7,860 89.3 tok/s 41 9 16/16 —
fable-5 6,771 51 s 4,520 88.2 tok/s 31 2 16/16 —
fable-5.1 8,881 73 s 6,450 88.7 tok/s 38 6 16/16 —
haiku-5.5 21,088 49 s 11,562 234.4 tok/s 0 — 0/16 .[all] [translator] python -m summarize research_scout.py cd tools/benchmark update.sh python -m translator config.json GADGET_CONFIG --api outputs/ sync.py tokens/ Python 3.10+ GPL-3 ai-companion
mythos-5 149 2 s — — 0 — 0/16 .[all] [translator] python -m summarize research_scout.py cd tools/benchmark update.sh python -m translator config.json GADGET_CONFIG --api outputs/ sync.py tokens/ Python 3.10+ GPL-3 ai-companion
mythos-5.1 151 2 s — — 0 — 0/16 .[all] [translator] python -m summarize research_scout.py cd tools/benchmark update.sh python -m translator config.json GADGET_CONFIG --api outputs/ sync.py tokens/ Python 3.10+ GPL-3 ai-companion

Cursor| Model | Chars | Time | Output tokens | Speed | Commands | Not in README | Facts | Missed |

|—|—|—|—|—|—|—|—|—| | Grok 4.7 High | 13,143 | 79 s | 5,740 | 72.9 tok/s | 36 | 5 | 16/16 | — | | Grok 4.6 High | 11,015 | 89 s | 5,690 | 64.1 tok/s | 32 | 1 | 16/16 | — | | Composer 2.5 | 10,088 | 57 s | 4,119 | 72.5 tok/s | 38 | 5 | 16/16 | — | | Gemini 3.7 Flash | 7,229 | 48 s | 3,165 | 65.9 tok/s | 29 | 1 | 15/16 | GPL-3 | | gpt-5.3-codex-high | 4,293 | 33 s | 3,028 | 92.6 tok/s | 30 | 1 | 16/16 | — | | gpt-5.2-high | 7,699 | 56 s | 3,777 | 66.8 tok/s | 30 | 1 | 15/16 | GPL-3 | | gpt-5.6-sol-high | 7,638 | 39 s | 3,738 | 96.8 tok/s | 33 | 1 | 16/16 | — | | grok-4.5-high | 7,678 | 52 s | 3,311 | 63.8 tok/s | 32 | 2 | 16/16 | — | | gpt-5.6-luna-high | 9,263 | 41 s | 4,975 | 120.1 tok/s | 41 | 7 | 15/16 | GPL-3 | | gemini-4-argon-high | 10,220 | 102 s | 4,345 | 42.8 tok/s | 33 | 1 | 16/16 | — | | muse-wonder-1.0-high | 13,751 | 46 s | 7,545 | 164.7 tok/s | 30 | — | 16/16 | — | | gpt-5.5-high | 6,341 | 32 s | 3,142 | 97.3 tok/s | 34 | 1 | 15/16 | GPL-3 | | gemini-3.8-flash-high | 7,393 | 44 s | 3,223 | 73.0 tok/s | 33 | 2 | 16/16 | — | | muse-spark-1.3-high | 10,692 | 31 s | 6,396 | 209.7 tok/s | 31 | — | 15/16 | GPL-3 | | gpt-5.6-terra-high | 6,552 | 27 s | 3,201 | 117.3 tok/s | 37 | 4 | 15/16 | GPL-3 | | gpt-5.4-high | 14,597 | 69 s | 6,897 | 99.7 tok/s | 74 | 3 | 16/16 | — | | gemini-3.6-flash-high | 5,930 | 42 s | 2,525 | 60.1 tok/s | 29 | 1 | 16/16 | — | | gemini-3.1-pro | 4,422 | 38 s | 2,014 | 52.5 tok/s | 25 | 1 | 13/16 | sync.py GPL-3 ai-companion | | gpt-5.4-mini-high | 6,677 | 32 s | 6,829 | 212.9 tok/s | 34 | 1 | 15/16 | GPL-3 | | gpt-5.4-nano-high | 9,295 | 50 s | 6,143 | 122.3 tok/s | 30 | — | 15/16 | GPL-3 | | gpt-5.1-high | 10,795 | 127 s | 8,294 | 65.5 tok/s | 33 | 2 | 15/16 | GPL-3 | | gemini-3-flash | 2,767 | 18 s | 1,192 | 64.5 tok/s | 15 | 1 | 13/16 | GADGET_CONFIG GPL-3 ai-companion | | gemini-3.5-flash | 5,722 | 44 s | 6,651 | 149.9 tok/s | 29 | 2 | 14/16 | GPL-3 ai-companion | | gpt-5-mini | 9,165 | 70 s | 5,375 | 77.2 tok/s | 41 | 2 | 16/16 | — | | kimi-k3-high | 6,354 | 15 s | 2,491 | 169.1 tok/s | 32 | 2 | 15/16 | ai-companion | | kimi-k2.7-code | 5,907 | 20 s | 2,411 | 121.0 tok/s | 39 | 9 | 15/16 | GPL-3 | | glm-5.2-high | 10,360 | 31 s | 442 | 14.4 tok/s | 42 | 11 | 16/16 | — |

Local Ollama

Model Chars Time Output tokens Speed Commands Not in README Facts Missed
Gemma4 26B 3,442 23 s 1,439 217.8 tok/s 18 1 12/16 GADGET_CONFIG --api sync.py GPL-3
Gemma4 12B 3,465 19 s 1,493 117.4 tok/s 17 2 14/16 GADGET_CONFIG GPL-3
Qwen3.8 27B 8,044 46 s 3,713 122.9 tok/s 32 6 14/16 GADGET_CONFIG GPL-3
Qwen3.6 36B 7,847 31 s 3,288 211.3 tok/s 31 5 15/16 GPL-3

Full outputs

Codex (OpenAI)

GPT-6.1 Sol — 9,278 chars · 15/16 facts

Part One: Project Summary

What are Gadgets

Gadgets (repository directory named gadget/) is a set of daily development tools covering five types of needs: AI conversation summarization, paper research, performance testing, blog publishing, and document translation.

The five tools under tools/ can be used independently. They share the common/ package in the repository root, which provides capabilities such as LLM calls, caching, file writing, translation, and Hugo deployment.

The development workflow and Claude Code skills are placed in another repository, ai-companion, located in the sibling directory ../ai-companion/, and integrated via hooks from this repository.

Repository Structure

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者分析、引用图分析
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客、媒体压缩、构建和发布
│   └── translator/     # Gradio 文档翻译器
├── common/             # 工具共用的基础能力
├── scripts/            # 同步、机器配置、检查等维护脚本
├── docs/               # 设计文档、计划、审计报告、历史归档
├── outputs/            # 可重新生成的输出,已被 Git 忽略
├── AGENTS.md           # AI agent 工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 打包与安装配置

Enter tools/<工具名>/ to modify tool logic; enter common/ to modify common capabilities; check scripts/sync.py to modify synchronization logic; enter the independent ai-companion repository to modify development workflows or skills.

What the Five Tools Do

Tool Main Function Key Features
Summarize Generates daily, weekly, and monthly reports from AI conversations Supports Claude Code, Codex, Cursor Agent, ChatGPT, and general JSON; supports merging after multi-device export; statistics for token usage and costs
Research Discovers papers, analyzes papers and researchers, and analyzes citation relationships Searches sources like arXiv, bioRxiv, PubMed, etc.; provides three-stage LLM evaluation, full paper analysis, OpenReview comment analysis, and researcher profiling
Benchmark Measures CPU/GPU floating-point performance Actual GPU testing supports CUDA, Apple MPS, Intel XPU; covers multiple precisions; results appended to CSV, can generate interactive HTML reports
Website Builds and publishes Hugo blogs Uses PaperMod theme; incremental compression of images and videos; bilingual translation with local models; pushes to GitHub Pages after building
Translator Translates text and files in the browser Based on Gradio; supports .md, .txt, .pdf, .docx, and images; protects content like code blocks, URLs, Hugo shortcodes, etc., in Markdown

common/ also includes JSON parsing and repair, SHA-256 disk caching with namespaces and TTL, atomic writes, and content hashing. scripts/ is responsible for operations; ai-companion is responsible for code change tracking, testing and HTML reports, as well as development processes like /idea → /ccplan → /ccedit.

Part Two: Beginner’s Tutorial

All following commands are from the provided README. Except for Benchmark and commands explicitly containing cd, they are executed in the gadget/ repository root by default.

The README is positioned as an overview and does not provide complete installation and configuration steps. Missing content will be explicitly stated; no speculative commands will be written.

1. Prepare Environment

The required basic environment is as follows:

Environment or Component Requirements in README
Python 3.10 or later
Conda Recommends using an environment named AI, but no creation command is provided
Node.js 18 or later, only required for the independent ai-companion repository
Tool Dependencies See requirements.txt in the corresponding directory
rclone Requires configuration first for cross-device synchronization
Hugo Used for website building and local preview
pngquant, HandBrakeCLI Used for website image and video compression
Local Inference Backend Ollama, vLLM, transformers, or GGUF/llamacpp; specific choices are detailed below

If you already have a AI Conda environment, you can execute:```bash conda activate AI


The README does not provide the clone address for the gadget repository, nor does it provide installation commands for Python, Conda, Ollama, Hugo, rclone, pngquant, or HandBrakeCLI; therefore, a complete "from scratch" installation process cannot be provided here.

**2. Install Python Packages and Tool Dependencies**

Install common base packages:

```bash
pip install -e .

Install common along with the extras for Summarize, Research, Benchmark, and Website:

pip install -e ".[all]"

Note: all does not include Translator. If a translator is needed, install it separately:

pip install -e ".[translator]"

If only the dependencies corresponding to Website are required, the README also provides:

pip install -e ".[website]"

Among them, Website extras include torch and transformers used for translation; Translator extras include Gradio and the GGUF translation stack.

3. Prepare Configuration

In the repository root, copy config.example.json to config.json, then modify as needed. The README does not show the full structure of the configuration fields, so configuration content should not be fabricated.

Relevant configuration entry points are as follows:

Configuration Entry Purpose
Root directory config.json Tool settings
sync section of config.json Data synchronization settings
summarize section of config.json Persistent settings related to local Ollama for Summarize
GADGET_CONFIG Override configuration file path
GADGET_LLM_BACKEND Global selection of LLM backend
GADGET_TRANSLATION_BACKEND Select local translation backend
GADGET_TRANSLATION_MODEL Override translation model
tokens/ API keys and machine initialization configuration table

config.json and tokens/ are ignored by Git; do not commit the contents of tokens/. The README does not provide API key filenames, formats, or assignment examples for the above environment variables.

LLM functionality for Summarize and Research can be selected using --api:

Value Meaning
ollama Default, local Ollama, no API key required; README describes using Gemma4-26B
claude_cli Reuse Claude Code CLI login status, no API key required
anthropic Anthropic API
openai OpenAI API

The README does not provide the full configuration process for these backends, nor does it show complete command examples with --api.

Translation functionality uses local inference. Special attention is needed as the README’s description of the default translation model varies:

  • The Website and Translator sections describe tencent/Hy-MT2-1.8B, which is automatically downloaded upon first use; Translator also lists its GGUF variants.
  • The Environment Requirements and Notes sections describe Ollama defaulting to gemma4:26b, while other in-process backends use tencent/Hy-MT2-1.8B.

Therefore, based solely on this README, one cannot assert that all translation paths default to the same model.

4. Optional: Machine Initialization and Basic Checks

If you wish to configure a new machine, the README provides two paths:

  • Repository-level initialization: Run scripts/onboard.py after filling in tokens/onboard.yaml. It will configure SSH, Claude/Codex installation and authentication, pip extras, ai-companion, tool settings, and rclone bootstrap. The README does not provide the full execution command or YAML examples.
  • Ubuntu server-level initialization: The script is located in the ai-companion repository and supports Ubuntu 22.04/24.04. You can view its help first:
bash ../ai-companion/scripts/onboard-server.sh --help

The --companion-repo of the server script should point to the ai-companion repository git@github.com:TzJ2006/ai-companion.git; after splitting, --companion-ref is no longer required. The README does not provide the full installation command.

After installation, a read-only smoke test can be run:

bash scripts/smoke.sh

It checks the --help, --info, and imports of each tool, without calling LLMs, accessing the network, or writing files.

5. Summarize: Generate AI Conversation Reports

The typical workflow is: export conversation logs from each device → sync via cloud drive or manual aggregation → merge daily to generate daily reports → generate weekly and monthly reports after daily reports have accumulated.

Phase one, export all dates that have not yet been exported:

python -m summarize daily export

In multi-device scenarios, each device exports separately, then records are aggregated. Phase two, sync all dates and merge them daily:

python -m summarize daily merge --sync-all

Generate a weekly report for a specified week based on existing daily reports, and deploy:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate a monthly report for a specified month based on existing daily reports, and deploy:

python -m summarize monthly generate --month 2026-02 --deploy

2026-W12 and 2026-02 are example values from the README; replace them with the target week or month when in use.

You can also run the full automated process:

python -m summarize auto --deploy

It executes export, merge, weekly report, monthly report, and deployment.

This tool uses the source-specific namespace command of ccusage 20.x to count tokens and costs for each agent CLI. The README does not provide the installation command for ccusage, conversation source paths, or exported data formats.

The old daily_summary.py, weekly_summary.py, and monthly_summary.py entry points are still compatible, but using the above python -m summarize format is recommended.

6. Research: Discover Papers, Analyze Researchers, and Citation Relationships

Research uses a single entry point tools/research/research_scout.py.

Run a complete paper research workflow for a project:

python tools/research/research_scout.py report --project my-project

It executes search, three-stage evaluation, and report generation. The three stages are rapid screening, in-depth evaluation, and citation impact analysis.

my-project is an example project name. The README does not explain how projects are defined or provide the project configuration format, so project configuration cannot be completed based solely on this README.

Search using natural language:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

This command will automatically select the search source.

Generate researcher profiles:

python tools/research/research_scout.py profile "Sergey Levine"

The profiling feature combines arXiv, Semantic Scholar, and LLM to analyze research trajectories, calculate hierarchy scores, and discover mentor-student relationships through homepage information and co-authorship patterns. It also supports name disambiguation and reverse lookup.

Analyze paper citation graphs:

python tools/research/research_scout.py citations 2301.12597

Input supports arXiv ID or DOI; analysis includes forward citations, backward references, and LLM impact interpretation.

Deploy research reports to Hugo:

python tools/research/research_scout.py deploy

The README also introduces --insight in-depth paper analysis: downloading full texts, analyzing writing structure, publication strategies, and reusable knowledge, matching OpenReview comments, and synthesizing cross-paper writing guides. However, it does not provide a complete invocation example, so speculative commands are not concatenated here.

7. Benchmark: Test CPU/GPU Performance

Benchmark commands have special directory requirements: enter tools/benchmark/ first.

cd tools/benchmark

Run all tests:

python -m benchmark.cli

Test CPU only:

python -m benchmark.cli --cpu-only

Test GPU only:

python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:

python -m benchmark.cli --report

The /benchmark/ to run tests, generate reports, and publish to Hugo:

python -m benchmark.cli --report --deploy

These are different running methods; choose according to your needs.

Testing uses warm-up, formal measurement, median statistics, and IQR outlier removal, and explicitly synchronizes the GPU. Results are saved to a CSV in an append mode, making it easy to accumulate scores for various hardware.

Actual GPU testing supports NVIDIA CUDA, Apple Silicon MPS, and Intel XPU. OpenCL may appear in the detection results of --info, but it is not listed as an actual GPU testing backend in the README. Precision includes FP64, FP32, FP16, BF16, and experimental FP8.

The README mentions a public leaderboard submission feature but does not provide the submission command, nor does it give specific hardware driver installation steps.

After execution, subsequent tool commands must be run after returning to the gadget/ root directory in the terminal.

8. Website: Preview and Publish Hugo Blog

If Website extras are not yet installed, execute in the root directory:

pip install -e ".[website]"

Local preview:

cd tools/website && hugo server -D

-D indicates including drafts during preview.

Build and publish on macOS/Linux:

cd tools/website && bash update.sh

On Windows, execute in the repository root:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The Windows script will enter its own directory automatically.

The publish script performs incremental media compression, Hugo builds, and pushes to Pages. Incremental compression is based on .last_build: images use pngquant, and videos use HandBrakeCLI.

These update scripts will publish the website, not just generate a local preview. The corresponding site in the README is https://tzj2006.github.io/, and the deployment repository is tzj2006/tzj2006.github.io; the README does not explain how to change to your own site or configure push authentication.

Automatically generated content is written directly to:

  • tools/website/content
  • tools/website/static

These files carry a gadget_generated marker; handwritten files without this marker will not be overwritten.

tools/website/public/ is an independent deployment repository that is automatically committed and pushed by the build script; do not commit directly to it.

9. Translator: Translate Documents in the Browser

Install dependencies in the repository root:

pip install -e ".[translator]"

Start the interface:

python -m translator

It will open the Gradio GUI in your browser. You can translate text, .md, .txt, .pdf, .docx, or image files through the interface, and switch models via the interface’s model management.

Language selection behavior:

  • When the source language is set to auto, it detects based on the proportion of CJK characters in the text.
  • When the target language is set to auto, it toggles between Chinese and English.

The translator reuses common.engine.create_engine() to automatically select the backend: if the model tag has been pulled, it prioritizes Ollama; the fallback for Windows is transformers, Linux prioritizes vLLM, and low-VRAM scenarios provide llamacpp/GGUF options.Models will reside in memory; models are lazy-loaded on demand when switching. Discrepancies between the default model and environment requirements have been explained in the configuration section. The README does not provide commands for manually pulling models, specifying ports, or translating command-line files.

10. Data Synchronization and Output Management

Synchronization is centrally managed by scripts/sync.py, which requires pre-configuring rclone. The configuration is located in the sync section of the root directory config.json.

The basic entry point provided in the README is:

python scripts/sync.py

Cross-device push and pull:

python scripts/sync.py push
python scripts/sync.py pull

The script also supports status, bootstrap, and config operations, covering categories such as summarize, website, research, benchmark, and backups; a special dag category is used to generate and deploy DAG sites. The README does not provide the complete command syntax for these categories.

For Summarize, the local Ollama auxiliary script also provides the following environment loading command:

eval "$(bash scripts/serve_local_llm.sh env)"

This script is used to create an Ollama variant suitable for Summarize and output environment settings; it is not the Ollama installation command provided in the README.

Regular generated artifacts are concentrated in:

outputs/
├── logs/         # 导出日志、运行日志等中间产物
├── reports/      # Markdown、JSON、HTML 报告
├── cache/        # LLM 缓存、搜索缓存
├── data/         # CSV、JSON 画像等结构化数据
├── images/       # 图表和生成图片
└── backups/      # 强制覆盖操作的备份

Website content is a clear exception: it is written directly to tools/website/content|static, with no separate outputs/site staging directory.

Do not include auto-generated content, rclone sync data, build/, gadget.egg-info/, or the deployment and theme repositories under Website in the repository commits.

Key Details Not Yet Provided in the README

To truly complete the initial configuration of all functions, the documents pointed to by the README are also required: the root directory TUTORIAL.md, tutorials for each tool, and the installation instructions for ai-companion. The current content does not provide the fields for JSON/YAML configuration, API key formats, Ollama installation and model preparation, rclone remote configuration, Research project definitions, or deployment settings for personal Hugo sites; therefore, these tutorials maintain these gaps without fabricating commands or parameters.

GPT-6 Astra — 8,800 chars · 15/16 facts

The following is based solely on the README you provided. Since the README is positioned as a project overview, any configuration fields, installation steps, or command parameters not provided will be explicitly marked and will not be fabricated.

I. Project Summary

Gadgets (the repository directory is named gadget/) is a set of practical tools accumulated during the development process, containing five independently usable tools:

Tool Purpose Key Features
Summarize Generates daily, weekly, and monthly reports from AI conversations Supports multi-device aggregation, multiple conversation sources, and token usage/cost statistics
Research Discovers papers, provides in-depth interpretations, and analyzes researchers and citation relationships Integrates arXiv, bioRxiv, PubMed, Semantic Scholar, and LLM
Benchmark Measures CPU/GPU floating-point performance Supports various hardware and precisions, appends results to CSV, and can generate interactive leaderboards
Website Builds and publishes Hugo blogs Includes bilingual translation, incremental image/video compression, and automatic build and push
Translator Translates text and documents via a web interface Local model inference, supports multiple file formats, and protects Markdown special snippets

They all collectively depend on the common/ Python package in the root directory. The development workflow and Claude Code skills come from the independent ai-companion repository.

The repository structure is as follows:

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者分析、引用图
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # LLM、缓存、读写、翻译、Hugo 部署等共享能力
├── scripts/            # 同步、机器初始化、检查和维护脚本
├── docs/               # 设计文档、计划、审计报告、历史归档
├── outputs/            # 生成结果,已被 Git 忽略
├── AGENTS.md           # AI agent 工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 打包和安装配置

To modify a specific tool, enter tools/<工具名>/; to modify shared LLM, cache, translation, or deployment capabilities, enter common/; to modify the development workflow or skills, enter the peer-level ../ai-companion/.

II. Preparation Before Use

Required environments:

Item Requirements in README
Python 3.10 or higher
Conda Recommends using an environment named AI, but no creation command is provided
Node.js 18 or higher, required only for the independent ai-companion repository
Tool Dependencies requirements.txt in each tool directory
Data Synchronization Requires rclone configuration
Website Functions Uses tools such as Hugo, pngquant, HandBrakeCLI, etc.
Local Inference Uses Ollama or the corresponding local inference backend

If the Conda environment recommended by the README has already been created, you can run:

conda activate AI

The README does not provide the clone address for the gadget repository, nor does it provide installation commands for software such as Python, Conda, Ollama, Hugo, or rclone; therefore, these commands are not supplemented here.

Except for Benchmark and commands that explicitly include cd, the following are organized based on being executed in the gadget repository root directory. After entering a subdirectory, please return to the repository root before executing the root directory commands in the next section.

III. Installing Project Dependencies

To install only the shared packages and the basic editable installation of the project:

pip install -e .

If you intend to use Summarize, Research, Benchmark, and Website, you can install the collection provided by the README:

pip install -e ".[all]"

all does not include Translator. If you also need web-based document translation, install it separately:

pip install -e ".[translator]"

If you only intend to use the website functions, the README also provides the corresponding installation method:

pip install -e ".[website]"

Website dependencies include torch and transformers for translation; Translator dependencies include Gradio and GGUF translation components.

These installation methods should be chosen as needed; there is no need to execute them one by one. The generated build/ and gadget.egg-info/ are located in the repository root and are ignored by Git.

IV. Configuring the Project

  1. Prepare the Main Configuration File

    Copy the config.example.json from the root directory to config.json, then fill it in according to actual needs.

    The README explicitly states:

    • Tool settings are located in the root directory config.json.
    • GADGET_CONFIG can override the configuration file path.
    • rclone synchronization configuration is located in the sync section.
    • Summarize’s persistent configuration is located in the summarize section.

    The README does not show specific JSON fields and values, so a reliable complete configuration example cannot be written based on this.

  2. Select LLM Backend

    The LLM functions of Summarize and Research support the following backends:

    Backend Value Description in README
    ollama Default, local Ollama, no API key required, uses Gemma4-26B
    claude_cli Reuses Claude Code CLI login status, no API key required
    anthropic Anthropic API backend
    openai OpenAI API backend

    Switch via the --api parameter, or select globally via GADGET_LLM_BACKEND.

    The README does not provide specific fields for API keys, file formats, or complete backend switching examples; therefore, the original commands are retained below without manually concatenating parameters.

  3. Understanding Translation Configuration

    Translation is performed locally and does not call cloud translation APIs. Relevant configuration entry points are:

    Configuration Entry Function
    GADGET_TRANSLATION_BACKEND Select local translation backend
    GADGET_TRANSLATION_MODEL Override Translator default model
    Model management in Translator interface Manage models within the interface

    Backends involve ollama, llamacpp, vllm, and transformers; among them, GGUF/llamacpp is a low-VRAM option.

    There are discrepancies in the README’s description of the default translation model: The Website and Translator sections mention tencent/Hy-MT2-1.8B, and Translator also lists GGUF versions; however, Environment Requirements and Notes state that the default Ollama path reuses gemma4:26b, while other in-process backends use Hy-MT2. Based solely on this README, all translation scenarios cannot be described as using the same default model.

  4. Saving Sensitive Configurations

    tokens/ is used to save API keys and machine initialization tables; it is ignored by Git, so do not commit its contents. The config.json in the root directory is also ignored by Git.

V. Summarize: Generating Reports from AI Conversations

Supports reading Claude Code, Codex, Cursor Agent, ChatGPT, and general JSON conversation records.

It employs a two-stage process: first exporting from each device, then aggregating and merging to generate daily reports; after accumulating daily reports, weekly and monthly reports can be generated.

Step 1: On each device where conversation records need to be collected, export all dates that have not yet been exported:

python -m summarize daily export

Step 2: Synchronize aggregated export records via cloud drive or manual copying, then sync all dates and merge them day by day:

python -m summarize daily merge --sync-all

Step 3: Generate weekly or monthly reports based on existing daily reports. The following uses example dates from the README and includes deployment operations:

python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy

You can also run the full pipeline, executing export, merge, weekly report, monthly report, and deployment in sequence:

python -m summarize auto --deploy

Tips:

  • --deploy will trigger deployment; relevant website configurations should be prepared before use.
  • Token usage and cost statistics are completed through the various source commands in ccusage 20.x.
  • The old daily_summary.py, weekly_summary.py, and monthly_summary.py entry points are still compatible, but using the module entry points mentioned above is recommended.
  • The README does not provide path configurations for each conversation source, general JSON formats, or the ccusage installation command.

Further explanations are located in TUTORIAL.md and tools/summarize/tutorial.md, but their main text is not included in the provided materials.

VI. Research: Paper Discovery and Scholar Analysis

The unified entry point is tools/research/research_scout.py.

Typical Usage 1: Generate a research report around a project, performing search, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

The three-stage evaluation consists of rapid screening, in-depth evaluation, and citation impact analysis. my-project is an example project name from the README; specific project configuration methods are not provided.

Typical Usage 2: Search directly using natural language:```bash python tools/research/research_scout.py ask “找 Pieter Abbeel 最近的机器人操作论文”


The tool automatically selects the search source, and also supports conference paper search and author search.

Typical Usage 3: Analyzing Researchers:

```bash
python tools/research/research_scout.py profile "Sergey Levine"

Researcher analysis includes papers and citation data, research trajectories, hierarchical scoring, and discovering mentor-student relationships through homepages and co-authorship patterns; it also supports name disambiguation and reverse lookup.

Typical Usage 4: Analyzing the citation relationships of a specific paper:

python tools/research/research_scout.py citations 2301.12597

Supports specifying a paper using arXiv ID or DOI, analyzing subsequent citations and references, and interpreting impact in combination with LLM.

Typical Usage 5: Deploying reports to Hugo:

python tools/research/research_scout.py deploy

The README also describes the --insight deep interpretation feature: downloading full texts, analyzing writing structures, publication strategies, and reusable knowledge, matching OpenReview comments, and synthesizing them into cross-paper writing guides. The original text does not provide the complete invocation command for this parameter, so it is not inferred here which subcommand it should follow.

VII. Benchmark: Testing CPU/GPU Performance

First, enter the specified directory from the repository root:

cd tools/benchmark

The following commands are all run in that directory; choose one according to your needs.

Run all benchmarks:

python -m benchmark.cli

Test only CPU:

python -m benchmark.cli --cpu-only

Test only GPU:

python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:

python -m benchmark.cli --report

Run tests, generate reports, and publish to Hugo via /benchmark/:

python -m benchmark.cli --report --deploy

Results and hardware support:

  • Actual GPU testing supports NVIDIA CUDA, Apple Silicon MPS, and Intel XPU.
  • OpenCL may only appear in the detection information of --info, which does not represent support for actual testing.
  • Covers precisions such as FP64, FP32, FP16, BF16, etc.; FP8 is experimentally supported.
  • Measurements include warmup, formal measurement, and statistical analysis, with explicit GPU synchronization.
  • Results are written to CSV in an append mode without overwriting existing records, facilitating the accumulation of multi-hardware leaderboards.

The README mentions that you can submit to public leaderboards, but does not provide a submission command.

VIII. Website: Previewing and Publishing Hugo Blogs

This website uses the PaperMod theme; the corresponding site in the README is https://tzj2006.github.io/.

When website dependencies are not yet installed, execute in the repository root:

pip install -e ".[website]"

Local preview:

cd tools/website && hugo server -D

Among them, -D will include drafts.

For formal build and publish, choose according to the operating system. For macOS/Linux, run from the repository root:

cd tools/website && bash update.sh

For Windows, run from the repository root:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The Windows script will enter its own directory automatically. These update scripts will execute the website build and publish process, including media incremental compression and pushing to Pages.

File relationships to understand:

  • Automatically generated website content is written directly to tools/website/content and tools/website/static.
  • Automatically generated files carry the gadget_generated tag; handwritten files without this tag will not be overwritten.
  • Images are compressed via pngquant, videos via HandBrakeCLI, processing only media that has changed since .last_build.
  • tools/website/public/ is an independently deployed repository; the build script will automatically commit and push, do not commit directly to it.

The README does not provide configuration steps for changing this site to a personal domain or a personal GitHub Pages repository.

IX. Translator: Translating Text and Files in a Web Page

Install dependencies and start in the repository root:

pip install -e ".[translator]"
python -m translator

After starting, the Gradio interface will open in the browser.

Typical usage process:

  1. Input text to be translated, or provide .md, .txt, .pdf, .docx, or image files.
  2. Select source language and target language.
  3. Select models as needed through the model management in the interface.
  4. Execute translation.

Meaning of automatic language selection:

  • Source language is auto: judged based on the proportion of CJK characters in the text.
  • Target language is auto: toggles between Chinese and English.

The translation engine protects Markdown snippets such as code blocks, URLs, and Hugo shortcodes; models remain resident and are loaded on demand when switching models. The README states that the default Hy-MT2 model will be automatically downloaded upon first use; for specific differences in default models, see the configuration instructions above.

The README does not provide interface ports, listening addresses, or startup parameters, nor does it explain export operations for various file types.

X. Synchronization, Inspection, and New Machine Initialization

Centralized data synchronization entry:

python scripts/sync.py

Cross-device push or pull:

python scripts/sync.py push
python scripts/sync.py pull

Before use, you need to configure rclone and the sync section of the root directory config.json. Synchronization overwrites summarize, website, research, benchmark, backups, and includes the special dag category used for generating and deploying DAG sites. The README also lists status, bootstrap, and config functions, but does not provide detailed parameters.

Run a read-only smoke check:

bash scripts/smoke.sh

This check covers help information, detection information, and imports; it does not call LLMs, access the network, or write files. It can be used for basic checks but cannot prove that API, synchronization, or publishing processes have been successfully configured.

Load environment settings from the local LLM auxiliary script output in Bash:

eval "$(bash scripts/serve_local_llm.sh env)"

The README states that this script is used to create Ollama variants optimized for Summarize and output environment settings, but does not expand on the full service preparation steps.

There are two paths for new machine initialization:

  • Repository-level initialization: Fill in tokens/onboard.yaml, then run scripts/onboard.py, used for SSH, Claude/Codex installation authentication, pip extras, ai-companion, tool configuration, and rclone initialization. The README does not provide YAML fields or complete execution commands.
  • Ubuntu 22.04/24.04 system-level installation: The script is located in the independent ai-companion repository; you can view its help first:
bash ../ai-companion/scripts/onboard-server.sh --help

ai-companion should be at the same level as ../ai-companion/ and requires Node.js 18+. The README provides the repository address git@github.com:TzJ2006/ai-companion.git, but does not provide complete installation commands; installation instructions point to its scripts/install.ts.

XI. Where to Find Results After Running

Generated results are usually concentrated in:

outputs/
├── logs/       # 导出日志、运行日志等中间产物
├── reports/    # Markdown、JSON、HTML 最终报告
├── cache/      # LLM 和搜索缓存
├── data/       # CSV、JSON profiles 等结构化数据
├── images/     # 图表和生成图片
└── backups/    # 强制覆盖时的备份

Website content follows explicit special paths: written directly to tools/website/content and tools/website/static, with no outputs/site temporary directory.

Do not include automatically generated content, rclone synchronized data, build artifacts, or the deployment and theme repositories under tools/website/ in the gadget’s Git commits.

This README is sufficient to provide installation entry points and typical running commands, but complete configuration still requires the TUTORIAL.md it points to, configuration examples, and documentation for each tool; the above does not supplement these unprovided contents.

GPT-6 Sol — 4,765 chars · 15/16 facts

I. Project Overview

Gadgets is a collection of daily development tools covering AI conversation summarization, paper retrieval, performance testing, blog publishing, and document translation. The five tools under tools/ can be used separately; they share the common/ package in the repository root.

Location Role
tools/summarize/ Summarizes conversations from Claude Code, Codex, Cursor Agent, ChatGPT, etc., generating daily, weekly, and monthly reports, and statistics for usage and costs
tools/research/ Retrieves and evaluates papers, analyzes researchers, analyzes citation relationships, and generates research reports
tools/benchmark/ Measures CPU and GPU floating-point performance, accumulates CSV results, and generates interactive HTML reports
tools/website/ Hugo blog; handles media compression, content translation, building, and publishing
tools/translator/ Local document translation page based on Gradio, supporting text and various file formats
common/ Shared LLM calling, caching, file writing, translation, and Hugo publishing capabilities for all tools
scripts/ Operations scripts such as data synchronization, new machine configuration, and smoke checks
docs/ Design documents, plans, and historical materials
outputs/ Generated logs, reports, caches, data, images, and backups; ignored by Git

ai-companion is an independent repository located in ../ai-companion/, providing development workflows and skills, and is not part of the Gadgets tools/. Blog generated content is written directly to tools/website/content or tools/website/static; the website’s public/ is a separate deployment repository.

II. Getting Started from Scratch

The following commands are all from the provided README. Unless otherwise noted, run them in the Gadgets repository root.

1. Environment Preparation and Installation

Python 3.10 or higher is required. The README recommends using a conda environment named AI:

conda activate AI

If using the independent ai-companion repository, Node.js 18 or higher is also required. For specific dependencies of each tool, see the requirements.txt in its directory.

Install the shared package and dependencies for summarize, research, benchmark, and website:

pip install -e ".[all]"

all does not include translator. When translation tools are needed, install separately:

pip install -e ".[translator]"

When preparing only blog-related dependencies, the command given by the README is:

pip install -e ".[website]"

2. Configuration

Tool configurations are located in config.json at the repository root: create this file using config.example.json as a template. The README does not list specific fields and values; check the template before modifying. GADGET_CONFIG can be used to specify other configuration file paths.

LLM functionality uses local Ollama by default; other backends listed in the README include claude_cli, anthropic, and openai, which can be selected via the --api parameter of each tool, or specified globally using GADGET_LLM_BACKEND. claude_cli reuses the login status of the Claude Code CLI; anthropic and openai involve respective API credentials. The README does not provide steps for filling in credentials.Translation uses local inference. The README lists GADGET_TRANSLATION_BACKEND to select the translation backend and GADGET_TRANSLATION_MODEL to override the default translation model. Models may be downloaded upon first use. tokens/ stores API keys and new machine configuration tables; it is Git-ignored, so do not commit its contents.

For cross-device synchronization, rclone must be configured first. The one-time configuration entry for a new machine is to fill in tokens/onboard.yaml and then run scripts/onboard.py; the README does not provide the exact execution command or YAML fields for this script, so they are not supplemented here.

3. Summarize: Generate AI Conversation Reports

First, export unexported conversation dates from each device, then synchronize and merge them day by day:

python -m summarize daily export
python -m summarize daily merge --sync-all

Once sufficient daily reports are available, you can generate and publish reports for a specified week or month:

python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy

You can also run the complete workflow provided in the README to sequentially complete export, merge, weekly report, monthly report, and publishing:

python -m summarize auto --deploy

When using multiple devices, conversation logs can be synchronized via cloud drives or manually copied and aggregated. For specific data formats and step-by-step configuration, refer to TUTORIAL.md and tools/summarize/tutorial.md pointed out in the README.

4. Research: Retrieve Papers and Analyze Researchers

Run the complete project report workflow, which includes retrieval, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

Ask questions in natural language to let the tool select retrieval sources:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate researcher profiles or analyze citation relationships by arXiv ID/DOI:

python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597

Publish reports to Hugo:

python tools/research/research_scout.py deploy

This tool also supports capabilities such as deep full-text paper analysis and OpenReview comment analysis; the README only mentions --insight without providing complete example commands. For project settings and detailed operations of these functions, refer to TUTORIAL.md and tools/research/TUTORIAL.md.

5. Benchmark: Test CPU/GPU Performance

First enter tools/benchmark/; the README explicitly requires the following commands to be executed in this directory:

cd tools/benchmark

Select one running method as needed:

python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy

They represent respectively: run all tests, test CPU only, test GPU only, test and generate HTML report, and test, generate report, and publish to Hugo via /benchmark/. Results are written to CSV in an append mode. Actual GPU testing supports CUDA, Apple MPS, and Intel XPU; OpenCL may only appear in detection information.

6. Website: Preview, Build, and Publish Blog

The blog is based on Hugo. The README provides the local preview command; run from the repository root:

cd tools/website && hugo server -D

-D will include drafts in the development server. The publishing script incrementally compresses images and videos that have changed since the last build, then translates, builds, and pushes the site. Select the corresponding command from the README based on your operating system:

macOS/Linux

cd tools/website && bash update.sh

Windows PowerShell

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The publishing script will automatically handle the separate tools/website/public/ deployment repository; you should not commit directly to it. Generated content carries the gadget_generated tag; handwritten files without this tag will not be overwritten.

7. Translator: Open Document Translation Page

After installing the translator dependencies, start from the repository root:

python -m translator

It will open a Gradio page. Inputs listed in the README include text, .md, .txt, .pdf, .docx, and images; Markdown snippets such as code blocks, URLs, and Hugo shortcodes will be protected during translation. When the source language is set to auto and the target language is set to auto, it will switch between Chinese and English. Models are loaded on demand and may be downloaded upon first use.

8. Common Maintenance Commands and Output Locations

The entry point for data synchronization scripts, and the cross-device push/pull forms provided in the README:

python scripts/sync.py
python scripts/sync.py push/pull

The second line is the README’s combined representation of the two operations; in actual use, choose one from push and pull. Synchronization requires pre-configuring rclone, with settings located in the sync section of config.json.

Perform cross-tool smoke tests without calling LLMs, accessing the network, or writing files:

bash scripts/smoke.sh

View the environment settings output from the local Ollama service script:

eval "$(bash scripts/serve_local_llm.sh env)"

Generated artifacts are concentrated in outputs/: logs/ for intermediate logs, reports/ for final reports, cache/ for cache, data/ for structured data, images/ for charts and images, and backups/ for backups of overwrite operations. This directory is Git-ignored. For finer configuration values, data formats, and troubleshooting, the README explicitly points to the repository’s TUTORIAL.md and each tool’s own documentation; this tutorial does not fabricate those unshown steps.

GPT-6 Luna — 4,781 chars · 15/16 facts

Project Summary

Gadgets is a repository that centralizes commonly used tools in daily development, including AI conversation reports, paper discovery and analysis, performance benchmarking, Hugo blog automation, and document translation. Tools under tools/ are independent of each other; common/ provides shared LLM, cache, file I/O, translation, and Hugo deployment capabilities.

Repository Structure

Path Purpose
tools/summarize/ Generates daily, weekly, and monthly AI conversation reports
tools/research/ Searches for papers, analyzes researchers, and builds citation relationship graphs
tools/benchmark/ Measures CPU/GPU floating-point performance and generates reports
tools/website/ Hugo blog and media compression, building, and publishing
tools/translator/ Local document translator based on Gradio
common/ Foundational capabilities shared by all tools
scripts/ Data synchronization, machine initialization, and maintenance scripts
docs/ Design documents, plans, and historical materials
outputs/ Reports, cache, data, images, and backups generated by tools
../ai-companion/ Independent adjacent repositories providing development workflows and Claude Code skills

Chinese Usage Tutorial

The following only organizes the environment requirements, configuration instructions, and commands provided in the README. For more detailed operations, data formats, and FAQs for each tool, please refer to the TUTORIAL.md pointed out in the README and the documentation of each tool.

1. Environment Preparation

  1. Prepare Python 3.10 or higher. The README recommends using the Conda environment AI:

    conda activate AI
    
  2. Node.js 18 or higher is only for use with the independent ../ai-companion/ repository.

  3. Prepare the dependencies required by the tools as needed. Each tool directory has its own requirements.txt; you can also install dependencies for common, summarize, research, benchmark, and website:

    pip install -e ".[all]"
    

    .[all] does not include translator. If the translator is needed, install it separately:

    pip install -e ".[translator]"
    
  4. The Website’s .[website] installation command will include the torch and transformers required for translation:

    pip install -e ".[website]"
    

2. Configuration Instructions

  • Tool settings are located in config.json at the repository root. The README mentions they can be copied from config.example.json; this file is git-ignored.
  • To use other configuration file paths, you can set GADGET_CONFIG.
  • API keys and machine initialization tables are placed in the git-ignored tokens/ directory; never commit its contents.
  • The LLM backend for Summarize and Research can be selected via --api: ollama (default), claude_cli, anthropic, or openai; you can also specify it globally using GADGET_LLM_BACKEND.
  • Ollama is the default local inference option. The README mentions that website and translation functions use local inference by default; the translation backend can also be specified via GADGET_TRANSLATION_BACKEND.
  • Cross-device data synchronization relies on rclone configuration. Use python scripts/sync.py to view the synchronization entry described in the README.

The README does not list the complete fields for each tool’s configuration files, specific settings for API keys, or the installation command for Ollama; these details must be found in the repository tutorials and tool documentation.

3. Summarize: Generate AI Conversation Reports

This tool reads conversation records from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON formats to generate daily, weekly, and monthly reports via LLM. In multi-device scenarios, first export records on the devices, then synchronize or manually aggregate them, and finally merge them by date to generate reports.

Execute in the repository root:

python -m summarize daily export

After exporting unexported dates, merge all dates:

python -m summarize daily merge --sync-all

Generate and deploy a report for a specified week:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate and deploy a report for a specified month:

python -m summarize monthly generate --month 2026-02 --deploy

You can also run the full process:

python -m summarize auto --deploy

Supports switching LLM backends via --api. The README also states that old entries python tools/summarize/daily_summary.py, weekly_summary.py, and monthly_summary.py are still compatible, but using python -m summarize is recommended.

4. Research: Paper Discovery and Researcher Analysis

Research provides a unified command entry via tools/research/research_scout.py, covering paper search and reporting, researcher profiling, citation graph analysis, and deployment.

Generate a research report for a specific project:

python tools/research/research_scout.py report --project my-project

Query papers using natural language:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate a researcher profile:

python tools/research/research_scout.py profile "Sergey Levine"

Analyze citation relationships by arXiv ID or DOI:

python tools/research/research_scout.py citations 2301.12597

Deploy reports to Hugo:```bash python tools/research/research_scout.py deploy


The LLM capabilities of Research support selecting backends via `--api`. The README also introduces capabilities such as deep paper insights and searching for conference papers and authors; please refer to the tool tutorials for specific parameters and operational steps.

## 5. Benchmark: CPU/GPU Performance Benchmarking

Benchmark measures CPU/GPU floating-point performance. The README requires entering the tool directory first:

```bash
cd tools/benchmark

Run all benchmarks, appending results to a CSV:

python -m benchmark.cli

Test only CPU or only GPU:

python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:

python -m benchmark.cli --report

Generate a report and publish it to Hugo’s /benchmark/:

python -m benchmark.cli --report --deploy

The README mentions that GPU testing will detect CUDA, Apple MPS, and Intel XPU; OpenCL may only appear in --info detection information and is not an actual GPU testing backend.

6. Website: Hugo Blog

Website is a Hugo static blog, including incremental media compression, build, and publishing workflows. Install dependencies:

pip install -e ".[website]"

Execute incremental compression, build, and publish on macOS/Linux:

cd tools/website && bash update.sh

Run the corresponding script on Windows:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (including drafts):

cd tools/website && hugo server -D

The README states that Hugo content is located in tools/website/content|static; automatically generated files are marked with gadget_generated. tools/website/public/ is a separate deployment repository, which is automatically committed and pushed by the build script.

7. Translator: Gradio Document Translator

Translator can translate text as well as .md, .txt, .pdf, .docx and image files, while preserving Markdown formatting as much as possible. It uses a local inference engine, with the default model being tencent/Hy-MT2-1.8B, which is automatically downloaded upon first use; models can also be overridden via GADGET_TRANSLATION_MODEL or through model management in the GUI.

Install and start:

pip install -e ".[translator]"
python -m translator

The command will launch the Gradio graphical interface and open it in a browser. The README does not provide details on step-by-step operations within the GUI.

8. Synchronization, Initialization, and Auxiliary Scripts

Cross-device data synchronization requires rclone configuration. The entry point provided in the README is:

python scripts/sync.py

For initializing a new machine, fill in tokens/onboard.yaml first, then run:

python scripts/onboard.py

This script handles SSH, Claude/Codex CLI installation and authentication, pip extras, ai-companion installation, tool configuration, and rclone initialization.

Run a read-only tool smoke check:

bash scripts/smoke.sh

The README also lists auxiliary scripts such as serve_local_llm.sh, language.py and profile_translation.py, but does not provide their full usage workflows; please consult the corresponding scripts or tutorial documentation before use.

GPT-5.6 Sol — 11,731 chars · 16/16 facts

I. Project Summary

1. What is Gadget

Gadget is a set of practical tools accumulated from daily development, primarily covering five types of tasks:

  • Generation of daily, weekly, and monthly reports for AI conversation logs
  • Academic paper discovery, deep paper analysis, and researcher profiling
  • CPU/GPU floating-point performance testing
  • Hugo blog building, translation, media compression, and automatic publishing
  • Local document translation

The five tools under tools/ are independent of each other and can be used separately. They collectively depend on the common/ package in the repository root. common/ provides general capabilities such as LLM invocation, JSON repair, disk caching, atomic writes, local translation, and Hugo deployment.

The project’s development workflow and Claude Code skills are not in this repository, but in an adjacent independent repository ../ai-companion/, integrated into Gadget via hooks under .claude/ and .codex/.

The project uses the GPL-3 license.

2. Repository Structure

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者分析、引用图谱
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客构建和发布
│   └── translator/     # Gradio 文档翻译器
├── common/             # 所有工具共享的基础设施
├── scripts/            # 同步、初始化、维护脚本
├── docs/               # 设计文档、ECL 计划、审计和历史文档
├── outputs/            # 自动生成的输出,已被 gitignore
├── AGENTS.md           # AI agent 工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 包及 extras 配置

When modifying different types of functions, the corresponding locations are as follows:

Target Location
Modify a specific tool tools/<tool>/
Modify common capabilities like LLM, cache, translation, Hugo deployment, etc. common/
Modify data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Modify development workflow or skill ../ai-companion/
View design and execution plans docs/、docs/ecl/

3. What Each Tool Does

Summarize

Reads AI conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON formats to generate structured daily, weekly, and monthly reports.

It employs a multi-device, two-stage process:

  1. Export conversation logs on each device.
  2. Aggregate them via cloud drive synchronization or manual copying, then generate reports on a daily basis.

Once daily reports accumulate to a certain amount, weekly and monthly trend summaries can be further generated.

It uses the source-specific commands of ccusage 20.x to statistics token usage and costs for different agent CLIs, such as ccusage claude, ccusage codex, and ccusage gemini.

It supports four LLM backends:

  • ollama: Default, runs locally, no API key required
  • claude_cli: Reuses Claude Code CLI login status, no API key required
  • anthropic
  • openai

Research

A unified academic research tool, entry point:

tools/research/research_scout.py

It has four main capabilities:

  • Paper Discovery: Searches for papers from arXiv, bioRxiv, and PubMed; generates research weekly reports through a three-stage LLM process (“Quick Screening → Deep Evaluation → Citation Impact”) and can publish them to Hugo.
  • Deep Paper Insights: Downloads full paper texts, analyzes writing structure, publication strategies, and reusable knowledge; matches OpenReview comments to analyze reviewer consensus and controversies; finally synthesizes cross-paper writing guides.
  • Researcher Profiling: Retrieves paper and citation data from ArXiv and Semantic Scholar to generate research trajectory analysis and stratified scoring, and infers mentor-student relationships through personal homepages and co-authorship patterns.
  • Citation Mapping: Utilizes the Semantic Scholar API to analyze forward citations and backward references, then uses an LLM to interpret the paper’s impact.

It also supports four LLM backends: ollama, claude_cli, anthropic and openai.

Benchmark

A cross-platform CPU/GPU FLOPS floating-point performance testing tool, supporting:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

OpenCL may appear in --info detection results, but the README does not state that it can perform actual GPU tests.

Supported precisions include:

  • FP64
  • FP32
  • FP16
  • BF16
  • FP8, experimental support

The testing process includes warmup, formal measurement, median statistics, IQR outlier removal, and explicit GPU synchronization.

Results are written to a CSV in an append mode and will not overwrite existing results, allowing for the accumulation of data from multiple hardware units to form leaderboards. The tool can also use Plotly to generate interactive HTML reports and publish them to the Hugo website or submit them to public leaderboards.

Website

A Hugo static blog named “TzJ’s Net”, using the PaperMod theme, with the target site being https://tzj2006.github.io/.

Main capabilities include:

  • Only compressing media files that have changed after .last_build
  • Compressing images using pngquant
  • Compressing videos using HandBrakeCLI
  • Generating bilingual content using local models
  • Automatically building the Hugo website
  • Automatically committing and pushing the GitHub Pages deployment repository

Daily, weekly, and monthly reports, research reports, benchmark pages, and images are written directly by the deployment process:

tools/website/content
tools/website/static

Automatically generated files carry the gadget_generated tag. Hand-written files without this tag will not be overwritten.

tools/website/public/ is an independent deployment repository corresponding to tzj2006/tzj2006.github.io; files should not be manually committed to it.

Translator

A Gradio-based local document translation web application with an interface similar to Google Translate.

Supports translating:

  • Plain text
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

It attempts to preserve Markdown formatting and protects snippets like code blocks, URLs, and Hugo shortcodes.

Translation is performed entirely via local inference without using cloud LLM APIs. It automatically selects the backend via common.engine.create_engine():

  • Prioritizes Ollama if the corresponding model has been pulled
  • Falls back to transformers on Windows
  • Prioritizes vLLM on Linux
  • Uses llama.cpp/GGUF for low VRAM scenarios

The default model is:

tencent/Hy-MT2-1.8B

The GGUF version is:

tencent/Hy-MT2-1.8B-GGUF

Models are automatically downloaded upon first use. Once loaded, models remain in memory, with lazy loading applied when switching models as needed.

When the source language is set to auto, it automatically detects based on the proportion of CJK characters in the text; when the target language is set to auto, it automatically switches between Chinese-to-English and English-to-Chinese.

4. Common Modules and Operations Scripts

common/

A common Python package providing:

  • A unified two-layer LLM API
  • JSON parsing and repair
  • SHA-256 disk caching with namespaces and TTL
  • Atomic writes and content hashing
  • Local translation engine
  • Bilingual content generation
  • Cross-platform Hugo deployment

scripts/

Main scripts include:- sync.py:Syncs summarize, website, research, benchmark, and backups data via rclone, and also supports generating and deploying DAG sites.

  • onboard.py:One-time initialization for new machines, responsible for SSH, Claude/Codex CLI, authentication, Python extras, AI Companion, tool configuration, and rclone bootstrap.
  • smoke.sh:Read-only smoke test, checks help, hardware info, and imports without calling LLMs, network, or performing writes.
  • serve_local_llm.sh:Creates Ollama model variants suitable for summarize and outputs environment variables.
  • language.py:Hugo bilingual content audit and summarize report renaming.
  • profile_translation.py:Translation engine GPU profiler.

AI Companion

../ai-companion/ is a standalone Node.js/TypeScript repository providing:

  • Function-level code change logs
  • Test and HTML report generation
  • /idea → /ccplan → /ccedit planning and execution workflow
  • Claude Code and Codex integration
  • Skills such as optimization, debugging, auditing, cleaning, paper writing, etc.

Node.js 18+ is only required when using this standalone repository.


II. Tutorial for First-time Gadget Users

The following tutorial is strictly limited to the information and commands provided in the README. The README places more detailed configuration fields, data formats, and FAQs in TUTORIAL.md and each tool’s own tutorials; therefore, no unprovided configuration items will be guessed here.

1. Environment Preparation

Python

Python 3.10 or higher is required.

The README recommends using a conda environment named AI:

conda activate AI

The README does not provide the command to create this conda environment, so a Python 3.10+ environment must be prepared in advance.

Node.js

Node.js 18+ is only required when using the standalone AI Companion repository:

../ai-companion/

When running only the Python tools of Gadget, the README does not require Node.js to be installed.

Other External Components

Different tools may also require:

  • rclone: Cross-device synchronization
  • Hugo: Blog building and local preview
  • pngquant: Image compression
  • HandBrakeCLI: Video compression
  • Ollama: Default LLM or translation backend
  • PyTorch, NumPy, Plotly: benchmark
  • Gradio, GGUF/transformers: translator

Specific tool dependencies can also be found in requirements.txt within each tool’s directory.

2. Installation

All following commands should be executed in the Gadget repository root directory, unless a directory switch is explicitly requested before the command.

Installing Public Packages

pip install -e .

This is the installation method for the common/ base package that all tools depend on.

After installation, the following may be generated in the repository root:

build/
gadget.egg-info/

These are build artifacts that have been gitignored and should not be committed.

Installing All Extras for Main Tools

pip install -e ".[all]"

This all includes:

  • summarize
  • research
  • benchmark
  • website

But does not include translator.

Installing Translator Separately

pip install -e ".[translator]"
pip install -e ".[website]"

This extras includes torch and transformers required for website translation.

3. Basic Configuration

Root Configuration File

The main settings for all tools are located in the repository root at:

config.json

This file is not tracked by Git. The README requires copying from the following example:

config.example.json

The README does not provide specific copy commands or field contents, so config.json should be created manually by referring to the example file.

To use a different configuration file path, you can set:

GADGET_CONFIG

LLM Backend

Summarize and Research uniformly support the following --api values:

  • ollama
  • claude_cli
  • anthropic
  • openai

The default value is ollama.

You can also select the backend via global environment variables:

GADGET_LLM_BACKEND

Note:

  • ollama uses local Ollama and does not require an API key.
  • claude_cli reuses the login status of Claude Code CLI and does not require an API key.
  • The README does not provide specific variable names or configuration fields for Anthropic and OpenAI keys, so do not guess; please refer to project tutorials or configuration examples.

Translation Configuration

The translation model can be overridden via the following environment variables:

GADGET_TRANSLATION_MODEL

The translation backend can be selected via the following variable:

GADGET_TRANSLATION_BACKEND

Default model:

tencent/Hy-MT2-1.8B

The model will be automatically downloaded upon first use.

Token and Initialization Configuration

API keys and the new machine initialization table are located at:

tokens/

The initialization table is:

tokens/onboard.yaml

tokens/ has been gitignored; never commit its contents.

README note: After filling in tokens/onboard.yaml and running scripts/onboard.py, the repository-level one-time machine configuration will be completed, including:

  • SSH configuration
  • Claude/Codex CLI installation and authentication
  • Python extras installation
  • AI Companion installation
  • Configuration for each tool
  • rclone bootstrap

The README does not provide a full invocation example for onboard.py in the command block, so its parameters are not expanded here.

4. Summarize Usage Tutorial

Summarize recommends using a unified entry point:

python -m summarize

Step 1: Export conversation records on the current device

python -m summarize daily export

This command executes the first stage of the multi-device workflow, exporting all dates that have not yet been exported.

This stage should be executed on every device containing AI conversation records.

Step 2: Sync and merge by day

python -m summarize daily merge --sync-all

This command syncs data for all dates and merges them day by day to generate daily reports.

Generate a weekly report for a specific week

python -m summarize weekly generate --week 2026-W12 --deploy

Where:

  • 2026-W12 represents Week 12 of 2026.
  • --deploy means generate and then deploy.

Generate a monthly report for a specific month

python -m summarize monthly generate --month 2026-02 --deploy

Where:

  • 2026-02 represents February 2026.
  • --deploy means generate and then deploy.

Run the full workflow with one click

python -m summarize auto --deploy

It will sequentially complete:

export → merge → weekly → monthly → deploy

Old Entry Point

The following old scripts are still compatible:

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

But the README recommends using:

python -m summarize

The README does not list specific parameters for the old entry point, so one should not assume the new entry point parameters are identical to the old ones.

5. Research Usage Tutorial

The unified entry point for Research is:

python tools/research/research_scout.py

Full Paper Search and Report Workflow

python tools/research/research_scout.py report --project my-project

This command executes:

搜索 → 三阶段评估 → 生成报告

my-project is the project name used in the README example.

Search for papers using natural language

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

The tool will automatically select search sources based on the question.

Generate researcher profiles

python tools/research/research_scout.py profile "Sergey Levine"

Researcher profiles may include:

  • Paper data from ArXiv and Semantic Scholar
  • Citation data
  • Research trajectory analysis
  • tier score
  • Advisor-student relationship discovery
  • Name disambiguation
  • Reverse lookup

Specific output fields are not detailed in the README.

Analyze paper citation graphs

Using arXiv ID:

python tools/research/research_scout.py citations 2301.12597

The README indicates that this position also supports DOI, but does not provide a DOI example format, so no extra examples are fabricated here.

Analysis content includes:

  • Forward citations
  • Backward references
  • LLM-driven impact interpretation

Deploy reports to Hugo

python tools/research/research_scout.py deploy

Deep Paper Insights

The README states that Research supports --insight, which can:

  • Download full paper text
  • Analyze writing structure
  • Analyze publication strategies
  • Extract reusable core knowledge
  • Match OpenReview
  • Analyze review consensus and controversies
  • Synthesize research writing guides

However, the README does not provide the complete --insight command combination, so it should not be guessed which subcommand it follows. Refer to tools/research/TUTORIAL.md when using it.

6. Benchmark Usage Tutorial

All Benchmark commands must first enter their respective directories:

cd tools/benchmark

Execute all benchmarks

python -m benchmark.cli

Results will be appended to the CSV and will not overwrite existing results.

Test CPU only

python -m benchmark.cli --cpu-only

Test GPU only

python -m benchmark.cli --gpu-only

The tool will automatically detect:

  • CUDA
  • Apple MPS
  • Intel XPU

Execute tests and generate HTML report

python -m benchmark.cli --report

Reports use Plotly to generate interactive charts.

Execute tests, generate reports, and deploy

python -m benchmark.cli --report --deploy

Reports will be published to the Hugo website at:

/benchmark/

Testing employs warmup, formal measurement, median statistics, IQR outlier removal, and GPU synchronization. Since the CSV uses append mode, it can be run repeatedly on different hardware to accumulate leaderboard data.

7. Website Usage Tutorial

Install website dependencies

Run in the repository root:

pip install -e ".[website]"

macOS/Linux: Build and Publish

cd tools/website && bash update.sh

This workflow will execute:

  • Incremental compression of modified images and videos
  • Local model bilingual translation
  • Hugo build
  • Commit and push to the GitHub Pages deployment repository

Windows: Build and Publish

Run in the repository root:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The Windows script will automatically switch to its own directory, so there is no need to execute cd tools/website beforehand.

Local Preview

cd tools/website && hugo server -D

-D will allow the local development server to include draft content.

Website File Notes

Automatically generated content is written directly to:

tools/website/content
tools/website/static

Files marked with gadget_generated may be automatically updated; handwritten files without this mark will not be overwritten.Do not manually submit or directly modify deployment repositories:

tools/website/public/

They are automatically committed and pushed by build scripts.

8. Translator Tutorial

Install Dependencies

pip install -e ".[translator]"

Start Translation Interface

python -m translator

After starting, a Gradio GUI will open in your browser.

In the interface, you can:

  • Input text for translation
  • Upload .md, .txt, .pdf, .docx or images
  • Select source and target languages
  • Manage or switch translation models

On the first run, the default model will be downloaded automatically.

When the source language is set to auto, the tool detects the language via CJK character ratio; when the target language is set to auto, it will automatically perform reverse translation between Chinese and English.

9. Data Synchronization

Synchronization is driven by rclone, with configuration located in the sync section of the root directory config.json.

To view the synchronization tool entry:

python scripts/sync.py

Cross-device pushing and pulling are used via:

python scripts/sync.py push
python scripts/sync.py pull

The README also specifies that sync.py supports:

status
bootstrap
config

as well as summarize, website, research, benchmark, backups, and special dag categories, but does not provide the full command combinations for these operations, so parameters are not expanded here.

10. Local Summarize Ollama Environment

The startup and environment variable loading command provided in the README is:

eval "$(bash scripts/serve_local_llm.sh env)"

This script creates an Ollama variant suitable for Summarize and outputs the environment settings.

Long-term configuration items should be written to the summarize section of the root directory config.json, or you can use GADGET_CONFIG to point to other configuration files.

11. Run Read-only Smoke Test

bash scripts/smoke.sh

This check only performs:

  • --help
  • --info
  • Python import checks

It does not call LLMs, access the network, or write files, making it suitable for basic verification after installation.

12. Where are the output files

All reconstructible artifacts are unified in:

outputs/

The structure is as follows:

outputs/
├── logs/         # 导出日志、运行日志等中间产物
├── reports/      # Markdown、JSON、HTML 最终报告
├── cache/        # LLM 和搜索缓存
├── data/         # CSV、JSON profile 等结构化数据
├── images/       # 图表和生成图片
└── backups/      # 强制覆盖前的备份

Hugo content is not staged via outputs/site but is written directly to:

tools/website/content
tools/website/static

13. Important Notes for Use

  • Do not commit API keys or onboarding configurations in tokens/.
  • Do not commit auto-generated files in outputs/.
  • Do not commit build/ and gadget.egg-info/.
  • Do not commit data synchronized via rclone.
  • Do not directly commit deployment repositories or theme repositories under tools/website/.
  • config.json is a local configuration file and should be created from config.example.json.
  • Translator is not included in .[all]; you need to install .[translator] separately.
  • The website and translation functions use local inference models; downloading tencent/Hy-MT2-1.8B may be required on the first run.
  • For more detailed configuration fields, data formats, troubleshooting, and incomplete usage details such as --insight, please refer to the TUTORIAL.md and tool tutorials in the repository; this README alone cannot reliably supplement them.
GPT-5.6 Terra — 6,622 chars · 15/16 facts

Project Overview

Gadgets is a collection of daily developer tools covering five categories of tasks:

  • Generation of daily, weekly, and monthly reports for AI conversation logs
  • Academic paper retrieval, researcher profiling, and citation mapping
  • CPU/GPU performance benchmarking
  • Automated Hugo blog building, media compression, and publishing
  • Local model-driven document translation

Each directory under tools/ is an independently usable tool; the common/ in the root directory provides shared capabilities such as LLM calls, caching, JSON parsing, atomic writes, translation engines, and Hugo deployment. The development workflow and Claude Code skills are not in this repository but in the sibling independent repository ../ai-companion/.

Repository Structure

gadget/
├── tools/
│   ├── summarize/   # AI 对话日报 / 周报 / 月报
│   ├── research/    # 论文发现、研究者分析、引用图谱
│   ├── benchmark/   # CPU/GPU 性能测试
│   ├── website/     # Hugo 博客及自动发布
│   └── translator/  # Gradio 文档翻译器
├── common/          # 所有工具共享的基础能力
├── scripts/         # 同步、初始化、检查等运维脚本
├── docs/            # 设计文档、ECL 计划、审计与历史资料
├── outputs/         # 可重新生成的输出文件(已忽略 Git)
├── AGENTS.md        # AI Agent 工作流程协议
├── CLAUDE.md        # Claude Code 仓库说明
└── pyproject.toml   # Python 打包与依赖配置

Generated results are unified in outputs/:

outputs/
├── logs/      # 导出及运行日志
├── reports/   # Markdown、JSON、HTML 报告
├── cache/     # LLM 与搜索缓存
├── data/      # CSV、JSON 等结构化数据
├── images/    # 图表和生成图片
└── backups/   # 强制覆盖时的备份

Hugo website content is written directly to tools/website/content and tools/website/static.

Tool Purposes

Tool Purpose
summarize Reads conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON to generate daily, weekly, and monthly reports, and statistics for token usage and costs of various Agent CLIs.
research Discovers papers from sources like arXiv, bioRxiv, PubMed, etc.; can perform deep paper insights, researcher profiling, mentor-student relationship inference, and forward/backward citation analysis.
benchmark Cross-platform testing of CPU/GPU floating-point performance, supporting CUDA, Apple MPS, Intel XPU, and generating HTML charts, leaderboards, and publishing to Hugo.
website Hugo static blog with capabilities for incremental image/video compression, automatic translation, building, and pushing to GitHub Pages.
translator Gradio-based local document translation web interface, capable of translating text, Markdown, TXT, PDF, DOCX, and images while preserving Markdown formatting as much as possible.

Tutorial

1. Environment Preparation

The base environment specified in the README is:

  • Python 3.10+
  • Recommended to use Conda environment AI
  • Node.js 18+: Only required if using the sibling ../ai-companion/ repository
  • Website and translation functions require a local inference engine: Ollama is preferred; Linux can use vLLM, Windows can fall back to transformers
  • Translation model tencent/Hy-MT2-1.8B will be downloaded automatically upon first use

If using Conda:

conda activate AI

Tool settings are located in the root directory config.json, and README instructions should be copied from config.example.json. This configuration file allows overriding paths via environment variables:

GADGET_CONFIG

Do not commit the following to Git:

  • API keys and initialization tables within tokens/
  • outputs/
  • build/
  • gadget.egg-info/
  • Deployment repositories and theme repositories under tools/website/
  • Auto-generated content and data synchronized via rclone

2. Install Dependencies

First, install shared packages and common tool dependencies in the repository root:

pip install -e ".[all]"

Note: all does not include the translator. If the translator is needed, install it separately:

pip install -e ".[translator]"

If only using website functions:

pip install -e ".[website]"

Each tool directory also has its corresponding requirements.txt, which can be consulted when needed.

3. LLM and Translation Backend Configuration

Supported unified LLM backends include:

  • ollama: Default, local Ollama, no API Key required
  • claude_cli: Reuses Claude Code CLI login status, no API Key required
  • anthropic
  • openai

Switching is supported via the --api parameter of each tool, or it can be set globally:

GADGET_LLM_BACKEND

Translation functions use a local inference backend, which can be selected via the following environment variables:

GADGET_TRANSLATION_BACKEND

The default selection order provided in the README is:

ollama → llamacpp / vllm / transformers

The default model is:

tencent/Hy-MT2-1.8B

The translation model can be replaced via the following environment variables:

GADGET_TRANSLATION_MODEL

4. Using the Conversation Summary Tool: Summarize

This tool adopts a two-stage, multi-device workflow:

  1. Export conversation logs from each device.
  2. Aggregate data via cloud drive synchronization or manual copying, and merge by date.
  3. Generate daily reports first, then generate weekly and monthly reports.

Export all dates that have not yet been exported:

python -m summarize daily export

Sync all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate weekly reports and deploy:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate monthly reports and deploy:

python -m summarize monthly generate --month 2026-02 --deploy

Execute the complete one-click workflow from export and merge to weekly/monthly reports and deployment:

python -m summarize auto --deploy

The old entry point remains compatible, but the modular form above is recommended:

python tools/summarize/daily_summary.py
python tools/summarize/weekly_summary.py
python tools/summarize/monthly_summary.py

This tool automatically discovers and summarizes token usage and costs for various Agent CLIs through the source-specific commands of ccusage 20.x. Optional LLM backends are ollama, claude_cli, anthropic, and openai.


5. Using the Paper Research Tool: Research

The unified entry point is:

python tools/research/research_scout.py

Execute a complete paper discovery process for a specific project: search, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

Search for papers using natural language; the tool will automatically route to the appropriate data source:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate a profile for a researcher:

python tools/research/research_scout.py profile "Sergey Levine"

Analyze citation maps based on arXiv ID or DOI:

python tools/research/research_scout.py citations 2301.12597

Deploy research reports to Hugo:

python tools/research/research_scout.py deploy

The research tool includes four types of capabilities:

  • Paper Discovery: From arXiv, bioRxiv, PubMed, through a three-stage process of rapid screening, deep evaluation, and citation impact analysis.
  • Deep Paper Insights: Downloads full texts via --insight to analyze writing structure, publication strategy, and reusable knowledge, and also matches OpenReview peer reviews.
  • Researcher Profiling: Generates research trajectories, scores, and relationship inferences by combining papers and citation data from ArXiv and Semantic Scholar.
  • Citation Mapping: Performs forward citation and reference analysis based on the Semantic Scholar API, with impact interpreted by LLM.

Its LLM backend can also be switched via --api.


6. Using the Performance Testing Tool: Benchmark

All commands require entering the tool directory first:

cd tools/benchmark

Run all benchmarks:

python -m benchmark.cli

Test CPU only:

python -m benchmark.cli --cpu-only

Test GPU only:

python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:```bash python -m benchmark.cli –report


Generate reports and publish to Hugo's `/benchmark/` :

```bash
python -m benchmark.cli --report --deploy

This tool supports actual GPU testing for NVIDIA CUDA, Apple Silicon MPS, and Intel XPU; OpenCL may only appear in --info detection. Results are written to CSV in append mode and will not overwrite existing results, making it suitable for aggregating scores from multiple machines.


7. Using Website Tool: Website

Install website-related dependencies:

pip install -e ".[website]"

Execute incremental compression, Hugo build, and Pages push on macOS or Linux:

cd tools/website && bash update.sh

Execute the corresponding script on Windows:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Start the local Hugo preview server, including draft content:

cd tools/website && hugo server -D

The website automatically handles the following:

  • Compresses only media files that have changed since .last_build.
  • Uses pngquant for images and HandBrakeCLI for videos.
  • Automatically generated daily reports, research reports, Benchmark pages, etc., are written directly to the Hugo content root directory.
  • Generated files will carry the gadget_generated tag; handwritten files without this tag will not be overwritten.
  • The build script will automatically commit and push to the independent GitHub Pages deployment repository in tools/website/public/.

Do not commit content directly to tools/website/public/.


8. Using Document Translator: Translator

Install the translator:

pip install -e ".[translator]"

Start the Gradio GUI:

python -m translator

After starting, the local translation page will open in your browser.

Supported translations:

  • Plain text
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

The translator will protect code blocks, URLs, Hugo shortcodes, etc., in Markdown to preserve the original format as much as possible. The source language can be set to auto, which identifies based on the proportion of CJK characters in the text; when the target language is set to auto, it will automatically switch between Chinese and English.


9. Operations and Sync Scripts

View or execute centralized rclone data synchronization:

python scripts/sync.py

The README explicitly lists the push and pull forms for cross-device synchronization:

python scripts/sync.py push
python scripts/sync.py pull

The sync configuration is located in the config.json section of the root directory sync, and other configuration files can also be specified via GADGET_CONFIG.

One-time initialization process for new machines:

  1. Fill out tokens/onboard.yaml.
  2. Execute:
python scripts/onboard.py

It will complete SSH, Claude/Codex CLI installation and authentication, pip extras, ai-companion, configuration for various tools, and rclone initialization.

Execute a read-only smoke test that produces no network, LLM calls, or writes:

bash scripts/smoke.sh

Create an Ollama variant optimized for summarize and output environment configurations:

eval "$(bash scripts/serve_local_llm.sh env)"

For system-level installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion on Ubuntu 22.04/24.04 servers, refer to the scripts in the sibling repository for help:

bash ../ai-companion/scripts/onboard-server.sh --help
GPT-5.6 Luna — 7,667 chars · 16/16 facts

I. Project Summary

1. What is Gadget

Gadget is a collection of practical development tools composed of multiple independent tools, covering:

  • AI conversation daily, weekly, and monthly report generation
  • Academic paper discovery and researcher analysis
  • CPU/GPU performance benchmarking
  • Hugo blog automatic building and publishing
  • Local model-driven document translation

Each tools/ subdirectory is a tool that can be used independently. The common/ in the repository root provides shared capabilities, including:

  • LLM calls
  • JSON parsing and repair
  • Disk caching
  • Atomic writes
  • Local model translation
  • Hugo deployment

Development workflows, code change tracking, and Claude Code skills are provided by ../ai-companion/ outside the repository.

2. Repository Structure

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者分析、引用图谱
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施
├── scripts/            # 同步、初始化、维护脚本
├── docs/               # 设计文档、计划和历史资料
├── outputs/            # 生成的报告、缓存、数据和图片
├── AGENTS.md           # AI Agent 工作流协议
├── CLAUDE.md           # Claude Code 使用说明
└── pyproject.toml      # Python 打包配置

When modifications are needed:

Target Directory
Modify a specific tool tools/<tool>/
Modify shared capabilities common/
Modify data synchronization scripts/sync.py
Initialize a new machine scripts/onboard.py
Modify development workflow or skills ../ai-companion/

3. Functions of Each Tool

summarize

Reads AI conversation logs from sources such as Claude Code, Codex, Cursor Agent, ChatGPT, etc., and calls LLMs to generate:

  • Daily reports
  • Weekly reports
  • Monthly reports and trend summaries

It uses a multi-device two-stage process:

  1. Each device exports conversation logs
  2. Aggregates data and generates reports by day

It also uses ccusage to statistics token usage and costs for different Agent CLIs.

Supports four LLM backends:

  • ollama: Default, local Ollama, no API Key required
  • claude_cli: Reuses Claude Code login status
  • anthropic
  • openai

research

An academic research tool containing four types of capabilities:

  • Paper Discovery: Searches arXiv, bioRxiv, PubMed, and performs a three-stage LLM evaluation
  • Deep Paper Insights: Analyzes paper writing structure, publication strategies, core knowledge, and OpenReview reviews
  • Researcher Profiling: Combines ArXiv and Semantic Scholar data to analyze research trajectories, citations, and advisor-student relationships
  • Citation Mapping: Analyzes forward citations and backward references of papers

benchmark

A cross-platform CPU/GPU floating-point performance testing tool.

Supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

Supports multiple precisions, including FP64, FP32, FP16, BF16, and experimental FP8.

Results are appended to CSV and will not overwrite historical data; it can also generate Plotly interactive HTML reports and leaderboards.

website

A Hugo-based blog site using the PaperMod theme, published to GitHub Pages.

Main features:

  • Incremental compression of images and videos
  • Automatic translation of bilingual content
  • Automatic building of the Hugo website
  • Automatic commit and push of the deployment repository
  • Receives automatically generated content such as daily reports, weekly reports, research reports, and benchmark pages

Website content writing:

tools/website/content
tools/website/static

tools/website/public/ is a separate deployment repository and should not be committed directly to the current project.

translator

A Gradio-based local document translator, supporting:

  • Text
  • Markdown
  • TXT
  • PDF
  • DOCX
  • Images

It protects Markdown code blocks, URLs, Hugo shortcodes, and other content. It uses the local model tencent/Hy-MT2-1.8B by default, and also supports GGUF versions.

The translation backend is automatically selected by the shared translation engine:

  • Ollama
  • vLLM
  • transformers
  • llama.cpp/GGUF

4. common/, scripts/ and outputs/

common/

A shared Python package used by various tools after installation, containing LLM, cache, IO, translation, and Hugo deployment functionalities.

scripts/

Main scripts include:

  • sync.py: Uses rclone to synchronize data
  • onboard.py: New machine initialization
  • smoke.sh: Performs read-only smoke tests on all tools
  • serve_local_llm.sh: Creates Ollama model variants suitable for summarize
  • language.py: Checks Hugo bilingual content
  • profile_translation.py : Analyzes translation engine GPU performance

outputs/

All generated artifacts are concentrated here:

outputs/
├── logs/
├── reports/
├── cache/
├── data/
├── images/
└── backups/

This directory is ignored by Git and can be automatically regenerated.


II. Chinese User Tutorial

1. Environment Preparation

Project requirements:

  • Python 3.10+
  • Node.js 18+, only required for ../ai-companion/
  • Extra dependencies for each tool can be found in the corresponding directory’s requirements.txt

The README recommends using a conda environment named AI:

conda activate AI

If using AI Companion, it also needs to be placed in the sibling directory of the current repository:

../ai-companion/

It is an independent repository and does not belong to Gadget itself.

2. Installing Basic Dependencies

Execute in the repository root:

pip install -e .

This installs the common/ shared package from the root directory in editable mode.

To install dependencies for summarize, research, benchmark, and website, you can execute:

pip install -e ".[all]"

Note: all does not include translator.

Install translator dependencies:

pip install -e ".[translator]"

If website functionality is needed, you can execute:

pip install -e ".[website]"

Website dependencies include PyTorch and transformers required for translation.

3. Configuration Files and Keys

Tool settings in the project root directory are located at:

config.json

The README states that this file is ignored by Git and should be configured after copying from:

config.example.json

Other configuration file paths can also be specified via environment variables:

GADGET_CONFIG

API Keys and initialization configurations are placed in:

tokens/

This directory is also ignored by Git and cannot be committed to the repository.

LLM backends can be uniformly selected through --api:

  • ollama
  • claude_cli
  • anthropic
  • openai

They can also be set via global environment variables:

GADGET_LLM_BACKEND

The translation backend can be controlled via:

GADGET_TRANSLATION_BACKEND

And the translation model can be overridden via:

GADGET_TRANSLATION_MODEL

4. New Machine Initialization

The project provides a one-time initialization script. The README requires filling out ```text tokens/onboard.yaml

 first, and then running:

```bash
python scripts/onboard.py

This script will automatically handle:- SSH configuration

  • Claude/Codex CLI installation and authentication
  • pip extras installation
  • ai-companion installation
  • Configuration of each tool
  • rclone initialization

The server-level Ubuntu 22.04/24.04 initialization script is located in the ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help

5. Data Synchronization and Basic Checks

The project uses rclone for cross-device data synchronization. See the synchronization script for help:

python scripts/sync.py

Synchronize data:

python scripts/sync.py push
python scripts/sync.py pull

Run a read-only smoke check:

bash scripts/smoke.sh

This check verifies the help information, info detection, and import of each tool; it will not call LLM, access the network, or write data.


III. How to Use Each Tool

1. Summarize: Generate AI Conversation Reports

Daily Report Workflow

Phase 1: Export all dates that have not yet been exported:

python -m summarize daily export

Phase 2: Synchronize all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate a weekly report for a specified week and deploy to Hugo:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate a monthly report for a specified month and deploy to Hugo:

python -m summarize monthly generate --month 2026-02 --deploy

One-click Full Workflow Execution

python -m summarize auto --deploy

This command executes:

导出 → 合并 → 周报 → 月报 → 部署

Legacy entry points are still compatible, for example:

python tools/summarize/daily_summary.py
python tools/summarize/weekly_summary.py
python tools/summarize/monthly_summary.py

But the README recommends using:

python -m summarize

LLM Backend

Summarize uses local Ollama by default, but also supports:

ollama
claude_cli
anthropic
openai

The specific backend is switched via the --api parameter.

2. Research: Paper Search and Researcher Analysis

Generate Research Project Report

python tools/research/research_scout.py report --project my-project

This workflow performs paper searching, three-stage evaluation, and report generation.

Search for Papers Using Natural Language

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

The tool automatically selects data sources based on the question.

Generate Researcher Profiles

python tools/research/research_scout.py profile "Sergey Levine"

It retrieves paper and citation data and generates research trajectory analysis.

Analyze Paper Citation Networks

python tools/research/research_scout.py citations 2301.12597

Parameters can be an arXiv ID or a DOI.

Deploy Research Reports

python tools/research/research_scout.py deploy

The LLM backend for Research also supports:

ollama
claude_cli
anthropic
openai

Switched uniformly via --api.

3. Benchmark: Run CPU/GPU Performance Tests

README special note: All Benchmark commands require entering the directory first:

cd tools/benchmark

Run all benchmarks:

python -m benchmark.cli

Results will be appended to the CSV.

Run only CPU tests:

python -m benchmark.cli --cpu-only

Run only GPU tests:

python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:

python -m benchmark.cli --report

Run tests, generate reports, and deploy to Hugo:

python -m benchmark.cli --report --deploy

The tool automatically detects CUDA, Apple MPS, and Intel XPU. OpenCL may only appear in the --info detection results and does not mean an OpenCL benchmark will be executed.

4. Website: Build and Preview Hugo Website

Install website dependencies:

pip install -e ".[website]"

macOS/Linux: Build and Publish

cd tools/website && bash update.sh

This workflow includes:

  1. Incremental compression of media files
  2. Executing Hugo build
  3. Pushing to GitHub Pages

Images are compressed using pngquant, and videos are processed using HandBrakeCLI.

Windows: Build and Publish

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

This script will automatically switch to its own directory.

Local Preview

cd tools/website && hugo server -D

-D indicates including drafts during preview.

Automatically generated content in the website is written directly to:

tools/website/content
tools/website/static

Automatically generated files with the gadget_generated tag can be updated by the deployment process; handwritten files without this tag will not be overwritten.

5. Translator: Start Local Document Translator

Install translator dependencies:

pip install -e ".[translator]"

Start the Gradio GUI:

python -m translator

A browser will open after starting.

The translator supports text and the following file types:

.md
.txt
.pdf
.docx
图片

The default model is:

tencent/Hy-MT2-1.8B

The GGUF version is:

tencent/Hy-MT2-1.8B-GGUF

The model will be downloaded automatically upon first use. The translator prioritizes local Ollama by default; on Linux, vLLM can be used; on Windows, it can fall back to transformers, and it also supports the low-VRAM GGUF/llama.cpp path.

When the source language is set to auto and the target language is set to auto, it will automatically switch between Chinese and English.


IV. Common Notes

  • Files in outputs/ are automatically generated and should not be committed.
  • tokens/ contains keys and initialization information and cannot be committed.
  • build/ and gadget.egg-info/ are build files produced by installation.
  • Do not directly commit tools/website/public/ or the website theme/deployment repository.
  • Cross-device synchronization requires configuring rclone first.
  • Website and translation functions depend on local inference engines, defaulting to Ollama.
  • ../ai-companion/ is an independent repository responsible for development workflows and skills.
  • The project uses the GPL-3 license.
GPT-5.5 — 8,517 chars · 16/16 facts

The following content is based solely on the README you provided; the summary and tutorial will not supplement commands or parameters not appearing in the README.

I. Project Summary

Gadget is a collection of practical tools accumulated during daily development, covering scenarios such as AI conversation daily/weekly/monthly report generation, paper discovery and researcher analysis, performance benchmarking, Hugo blog automation, document translation, etc.

Its core design is: each directory under tools/ is a tool that can be used independently; the common/ in the repository root is a shared infrastructure package, installed via pip install -e ., providing common capabilities like LLM calling, JSON parsing, disk caching, atomic writing, translation, Hugo deployment, etc., to various tools. The development workflow and Claude Code skills are not within this repository but are provided by the independent repository in the adjacent directory ../ai-companion/ and integrated via hooks.

Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现、研究者分析、引用图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客,媒体压缩,自动构建发布
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包
├── scripts/            # 运维与维护脚本
├── docs/               # 设计文档、ECL 计划、审计报告、历史归档
├── outputs/            # 所有生成产物,gitignored,可重新生成
├── AGENTS.md           # AI agent 工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common 和各工具的 Python packaging 配置

outputs/ is used for centralized storage of generation results:

outputs/
├── logs/         # 中间日志和运行日志
├── reports/      # 最终报告,Markdown / JSON / HTML
├── cache/        # LLM 缓存、搜索缓存
├── data/         # CSV、JSON profiles 等结构化数据
├── images/       # 图表和生成图片
└── backups/      # 强制覆盖备份

Hugo website content is not written to outputs/site first, but is written directly to tools/website/content|static by the deployment process.

Roles of Each Tool

tools/summarize/:AI conversation report generation tool.
Automatically reads AI conversation records from Claude Code, Codex, Cursor Agent, ChatGPT, general JSON, etc., and calls LLMs to generate daily, weekly, and monthly trend summaries. Supports multi-device workflows: each device exports conversation logs, aggregates them via cloud drive synchronization or manual copying, and then generates the final report. Uses ccusage 20.x to statistics token usage and costs for each agent CLI. The LLM backend can be switched uniformly via --api, including ollama, claude_cli, anthropic, and openai.

tools/research/:Academic research tool.
The unified entry point is tools/research/research_scout.py, providing four types of capabilities: paper discovery, deep paper insights, researcher profiles, and citation network analysis. Supports arXiv, bioRxiv, PubMed, Semantic Scholar, and uses LLMs to complete filtering, evaluation, impact analysis, writing structure analysis, research trajectory analysis, etc.

tools/benchmark/:CPU/GPU performance benchmarking tool.
Measures floating-point performance across different hardware and precision levels on multiple platforms, supporting actual GPU execution for NVIDIA CUDA, Apple Silicon MPS, and Intel XPU. Results are appended to a CSV, and it can generate Plotly interactive HTML reports and leaderboards, as well as support deployment to Hugo websites.

tools/website/:Hugo blog site.
This is the Hugo static blog “TzJ’s Net”, using the PaperMod theme, deployed to GitHub Pages. It features an incremental image/video compression workflow, using pngquant for images and HandBrakeCLI for videos. Automatically generated content is written to tools/website/content|static with a gadget_generated tag; handwritten files without this tag will not be overwritten. tools/website/public/ is a separate deployment repository and should not be committed directly.

tools/translator/:Gradio document translator.
Based on the common translation engine, it provides a local translation web page similar to Google Translate. It supports translating text and files such as .md, .txt, .pdf, .docx, and images, while attempting to preserve Markdown formatting and protecting code blocks, URLs, Hugo shortcodes, etc. The default model is tencent/Hy-MT2-1.8B, with a GGUF variant tencent/Hy-MT2-1.8B-GGUF.

common/:Shared infrastructure.
Provides capabilities such as unified LLM calling, JSON parsing and repair, SHA-256 disk caching, atomic writing, content hashing, local inference translation engine, bilingual content generation, and cross-platform Hugo deployment.

scripts/:Operations and maintenance scripts.
Includes sync.py data synchronization, onboard.py new machine initialization, smoke.sh read-only smoke checks, serve_local_llm.sh local Ollama variant configuration, language.py Hugo bilingual auditing and report renaming, profile_translation.py translation engine GPU profiling, etc.

../ai-companion/:Independent repository.
Does not belong to the gadget repository itself. It is responsible for function-level code change records, testing and HTML report generation, the /idea→/ccplan→/ccedit planning and execution workflow, and Claude Code skills.


II. Chinese Usage Tutorial

1. Environment Preparation

The basic requirements listed in the README are as follows:

# Python 版本要求
Python 3.10+

It is recommended to use the conda environment AI:

conda activate AI

If you need to use the adjacent ../ai-companion/ repository, you will need:

Node.js 18+

Specific dependencies for each tool can be found in the corresponding requirements.txt directory.To install the full extras for common, summarize, research, benchmark, and website, you can run the following in the repository root:

pip install -e ".[all]"

Note: all does not include translator. The translator needs to be installed separately:

pip install -e ".[translator]"

The website and translation functions use a local inference engine. The README states that Ollama is used by default; vLLM is available on Linux, and transformers is available as a fallback on Windows. Model tencent/Hy-MT2-1.8B will be automatically downloaded upon the first run.

2. Configuration Preparation

Tool configuration is located in config.json at the repository root, which is gitignored. The README explains that it should be copied from config.example.json.

If you need to override the configuration file path, you can set:

GADGET_CONFIG

The LLM backend can be switched via the --api parameter of each tool. The optional backends mentioned in the README are:

ollama
claude_cli
anthropic
openai

You can also use a global environment variable:

GADGET_LLM_BACKEND

The translation backend is controlled by the following environment variable:

GADGET_TRANSLATION_BACKEND

The README states that the translation path defaults to using a local Ollama server, followed by llamacpp / vllm / transformers. The translation model can be overridden via the following environment variable:

GADGET_TRANSLATION_MODEL

API keys and onboarding sheets are located in the tokens/ directory, which is gitignored; the README specifically warns not to commit its contents.

3. Installation

Install the shared package and main tool dependencies in the repository root:

pip install -e ".[all]"

To use the document translator, install the translator extras:

pip install -e ".[translator]"

If you only target the website functionality, the installation command provided in the README is:

pip install -e ".[website]"

4. New Machine Initialization

The README mentions that new machine configuration can use scripts/onboard.py. The process involves first filling out:

tokens/onboard.yaml

Then running:

python scripts/onboard.py

It will complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras, ai-companion installation, tool configurations, rclone bootstrap, etc.

Server-level system installation has been migrated to ../ai-companion/:

bash ../ai-companion/scripts/onboard-server.sh --help

5. Data Synchronization

Cross-device data synchronization uses scripts/sync.py and requires rclone configuration.

The general running method provided in the README is:

python scripts/sync.py

It also mentions that cross-device synchronization can use:

python scripts/sync.py push
python scripts/sync.py pull

Configuration is located in the sync section of config.json at the repository root; you can also use GADGET_CONFIG to override the configuration path.

If you only want to sync data, the README explicitly states in the repository structure section:

python scripts/sync.py

6. Summarize: AI Chat Daily, Weekly, and Monthly Reports

This tool recommends using the new module entry point:

python -m summarize

A typical workflow is as follows.

Export all dates that have not yet been exported:

python -m summarize daily export

Sync all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate and deploy a weekly report for a specific week:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate and deploy a monthly report for a specific month:

python -m summarize monthly generate --month 2026-02 --deploy

Execute the full workflow in one click: Export, merge, weekly report, monthly report, and deploy:

python -m summarize auto --deploy

The old entry point is still compatible:

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

But the README recommends using:

python -m summarize

The LLM backend can be switched uniformly via --api. Values listed in the README include:

ollama
claude_cli
anthropic
openai

7. Research: Paper Discovery, Researcher Analysis, Citation Graphs

The unified entry point is:

python tools/research/research_scout.py

Run the full paper discovery workflow: Search, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

Natural language search; the tool will automatically route the source:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate researcher profiles:

python tools/research/research_scout.py profile "Sergey Levine"

Perform citation graph analysis by arXiv ID or DOI:

python tools/research/research_scout.py citations 2301.12597

Deploy research reports to Hugo:

python tools/research/research_scout.py deploy

All LLM functions also support switching backends via --api:

ollama
claude_cli
anthropic
openai

8. Benchmark: CPU/GPU Performance Benchmarking

The README explicitly states that all benchmark commands require entering tools/benchmark/ first:

cd tools/benchmark

Run all benchmarks and append results to a CSV:

python -m benchmark.cli

Run CPU only:

python -m benchmark.cli --cpu-only

Run GPU only:

python -m benchmark.cli --gpu-only

Run benchmarks and generate an HTML report:

python -m benchmark.cli --report

Generate reports and publish to Hugo’s /benchmark/:

python -m benchmark.cli --report --deploy

The README explains that the tool automatically detects CUDA, Apple MPS, and Intel XPU. OpenCL may only appear in --info detection, but the README does not provide specific command examples for --info.

9. Website: Hugo Blog

Install website dependencies:

pip install -e ".[website]"

Incremental compression, Hugo build, and push to GitHub Pages under macOS/Linux:

cd tools/website && bash update.sh

Run PowerShell script under Windows; the script will switch to its own directory:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview, including drafts:

cd tools/website && hugo server -D

The README specifically notes:

tools/website/public/ is a separate deployment repository tzj2006/tzj2006.github.io, which is automatically committed and pushed by build scripts; do not commit it directly.

Automatically generated content will be written to:

tools/website/content
tools/website/static

Files with the gadget_generated tag can be managed by the automated process; handwritten files without this tag will not be overwritten.

10. Translator: Gradio Document Translator

Install translator dependencies:

pip install -e ".[translator]"

Start the Gradio GUI:

python -m translator

The interface will open in your browser after starting.

It supports translating text and files; file types listed in the README include:

.md
.txt
.pdf
.docx
images

Default model:

tencent/Hy-MT2-1.8B

GGUF variants:

tencent/Hy-MT2-1.8B-GGUF

The model can be overridden via environment variables:

GADGET_TRANSLATION_MODEL

The source language can be set to auto via text CJK ratio detection; when the target language is auto, it will automatically switch between Chinese and English.

11. Smoke Checks and Local LLM Helper Scripts

Run a read-only smoke check:

bash scripts/smoke.sh

The README explains that this script checks the --help, --info, and imports of each tool without triggering LLMs, network requests, or writes.

Create a summarize-tuned Ollama variant and print environment variables:

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent configuration is placed in the summarize section of config.json at the repository root; you can also use GADGET_CONFIG to override the path.

12. Usage Notes

Do not commit these contents:

tokens/
outputs/
build/
gadget.egg-info/
tools/website/ 下的部署仓库或 theme repo
自动生成内容
rclone 同步数据

The README explicitly states:

  • tokens/ saves API keys and onboarding sheets; it is gitignored, do not commit.
  • outputs/ saves all generated files; it is gitignored.
  • build/ and gadget.egg-info/ are build artifacts generated by pip install -e ..
  • Cross-device synchronization depends on rclone.
  • The project license is GPL-3, see LICENSE.
GPT-5.4 Mini — 6,730 chars · 15/16 facts

The following is organized solely based on the README.md you provided, without adding commands, parameters, or behaviors outside of the README.

What is the project?

Gadgets is a “set of practical tools accumulated during daily development.” The repository splits different functions into 5 independent tools, where each directory can be used separately, while common capabilities are extracted into the common/ package in the root directory.

It mainly covers:

  • AI chat daily/weekly/monthly report generation
  • Paper discovery and researcher analysis
  • CPU/GPU performance benchmarking
  • Hugo blog automated publishing
  • Document translation

One important prerequisite: the development workflow and Claude Code skills are not in this repository, but in the adjacent independent repository ../ai-companion/, integrated via hooks.

Repository Structure

gadget/
├── tools/              # 5 个独立工具
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + citation graph
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # 通用基础能力:LLM / cache / IO / translation / Hugo
├── scripts/            # 运维和维护脚本
├── docs/               # 设计文档、计划、归档
├── outputs/            # 所有生成产物
├── AGENTS.md           # 给 AI agent 的工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # 包装配置

What each tool does

  • tools/summarize/: Reads AI chat records to generate daily / weekly / monthly summaries.
  • tools/research/: Performs paper retrieval, researcher profiling, and citation relationship analysis.
  • tools/benchmark/: Performs cross-platform CPU/GPU performance testing and generates reports.
  • tools/website/: Automates Hugo blog building, compression, and publishing.
  • tools/translator/: Gradio document translator, supporting text and file translation.

common/ is the base library shared by all tools, providing:

  • LLM calls
  • JSON parsing and fixing
  • Disk caching
  • Atomic writes
  • Translation engine
  • Hugo deployment

scripts/ contains some operations scripts:

  • sync.py: rclone synchronization
  • onboard.py: New machine initialization
  • smoke.sh: Read-only smoke tests
  • serve_local_llm.sh: Create summarize-tuned Ollama
  • Others: language.py, profile_translation.py

Beginner’s Tutorial

The following is organized by “Environment Preparation → Installation → Configuration → Usage of each tool.”

1. Environment Preparation

The README explicitly requires:- Python 3.10+

  • Recommended to use conda activate AI
  • Node.js 18+ is only for the adjacent ../ai-companion/ repository
  • ../ai-companion/ is an independent repository, not inside the current repository
  • Specific dependencies required should refer to the requirements.txt under each tool’s directory

If you only intend to use the Python tools in this repository, the focus is on the Python environment; if you also plan to touch ai-companion, prepare Node.js as well.

2. Installation

The installation methods provided in the README consist of three layers:

pip install -e .

This will install the common/ package in the root directory and the basic capabilities of the repository.

If you want to install extra dependencies for most tools, you can use:

pip install -e ".[all]"

README notes:

  • all includes summarize / research / benchmark / website
  • all does not include translator

If you want to use the translator, install it separately:

pip install -e ".[translator]"

Both the website translation function and the translator depend on a local inference engine. The README mentions:

  • Default is Ollama
  • vLLM can be used on Linux
  • transformers can be used on Windows
  • Model tencent/Hy-MT2-1.8B will be automatically downloaded upon the first run

3. Configuration

The configuration points mentioned in the README are as follows:

  • There is a config.json in the root directory
  • config.json is gitignored by default
  • Can be copied from config.example.json
  • Can use GADGET_CONFIG to override the configuration file path

Regarding environment variables:

  • GADGET_LLM_BACKEND: Unified switching of LLM backends
  • GADGET_TRANSLATION_MODEL: Specify translation model
  • GADGET_TRANSLATION_BACKEND: Specify translation backend

The tokens/ directory:

  • Stores API keys and onboarding tables
  • Is also gitignored
  • Cannot be committed

If you are initializing a new machine, the README also mentions:

  • Fill in tokens/onboard.yaml
  • Then run scripts/onboard.py once
  • It will automatically handle SSH, Claude/Codex authentication, pip extras, ai-companion installation, tool configurations, and rclone bootstrap

The README does not expand on the full command details in this section, so I will only retain what is explicitly written here without adding extra commands.


4. Typical Usage of Each Tool

4.1 summarize: AI Conversation Daily / Weekly / Monthly Reports

This tool automatically reads your daily AI conversation records and supports:

  • Claude Code
  • Codex
  • Cursor Agent
  • ChatGPT
  • General JSON

It also combines multi-source command statistics for token and cost using ccusage 20.x.

The recommended command provided in the README is:

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy

These commands represent:

  • daily export: Export all unexported dates
  • daily merge --sync-all: Sync all dates and merge by day
  • weekly generate --week ... --deploy: Generate weekly report and deploy
  • monthly generate --month ... --deploy: Generate monthly report and deploy
  • auto --deploy: One-click full process, referred to as export → merge → weekly → monthly + deploy in the README

Switchable LLM backends:

  • ollama, default
  • claude_cli
  • anthropic
  • openai

The README also mentions that old entry points are still available, but the new form is recommended:

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

4.2 research: Paper Discovery, Researcher Analysis, Citation Graph

The unified entry point for this tool is:

python tools/research/research_scout.py

Typical commands provided in the README:

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy

These commands perform:

  • report: Full process: Search → Three-stage evaluation → Report
  • ask: Natural language search, automatically routes data sources
  • profile: Researcher profiling
  • citations: Citation graph analysis, supports arXiv ID / DOI
  • deploy: Deploy reports to Hugo

Similarly supports switching LLM backends:

  • ollama
  • claude_cli
  • anthropic
  • openai

4.3 benchmark: Performance Benchmarking

The README emphasizes: You must enter the directory before running this tool.

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy

These commands represent:

  • Run all benchmarks by default, results appended to CSV
  • Run CPU only
  • Run GPU only
  • Run benchmarks and generate an HTML report
  • Generate report and publish to Hugo’s /benchmark/

The README also states it supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

As well as several precision levels:

  • FP64
  • FP32
  • FP16
  • BF16
  • FP8 (experimental)

4.4 website: Hugo Blog

This tool is a Hugo static blog site; the README provides three common operations.

Install website-related dependencies:

pip install -e ".[website]"

Build and publish:

  • macOS / Linux:
cd tools/website && bash update.sh
  • Windows:
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview:

cd tools/website && hugo server -D

The README also explains:

  • It performs incremental image / video compression
  • Images use pngquant
  • Videos use HandBrakeCLI
  • Automatically generated content will be written directly to tools/website/content or tools/website/static
  • tools/website/public/ is a separate deployment repository; do not commit directly into it

4.5 translator: Gradio Document Translator

Install dependencies:

pip install -e ".[translator]"

Start GUI:

python -m translator

This tool will open a local translation page in your browser, supporting:

  • Text
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

The README specifically mentions:

  • It preserves Markdown formatting
  • It protects code blocks, URLs, and Hugo shortcodes
  • It uses local inference, not a cloud API
  • The default model is tencent/Hy-MT2-1.8B
  • Can also be changed via GADGET_TRANSLATION_MODEL or the model management within the GUI

5. Operations and Auxiliary Scripts

These are also explicitly mentioned in the README and can be used directly.

sync.py:

python scripts/sync.py

The README says it is responsible for rclone synchronization, covering:

  • summarize
  • website
  • research
  • benchmark
  • backups
  • and one dag category

smoke.sh:

bash scripts/smoke.sh

This is a read-only smoke test; it does not perform LLM, network, or write operations.

serve_local_llm.sh:

eval "$(bash scripts/serve_local_llm.sh env)"

The README explains that it will create a summarize-tuned Ollama variant and output environment variables.

Server onboarding related to ai-companion:

bash ../ai-companion/scripts/onboard-server.sh --help

The README states that this script has been migrated to the ../ai-companion/ repository.


6. The Shortest Onboarding Process

If you just want to get things running, the shortest path supported by the README is:

pip install -e .
pip install -e ".[all]"

If you want to use the translator, add:

pip install -e ".[translator]"

Then select a tool based on what you want to do:

python -m summarize auto --deploy
python tools/research/research_scout.py report --project my-project
cd tools/benchmark && python -m benchmark.cli --report
cd tools/website && hugo server -D
python -m translator

If you wish, in my next step I can organize this content into a version that is “more like a formal document,” modified as:

  1. A long-form version suitable for beginners
  2. A concise version suitable for project documentation
  3. A version rearranged by “Installation / Configuration / Usage / FAQ”

Claude Code (Anthropic)

Opus 5.5 — 8,689 chars · 16/16 facts

I. Project Summary

1. What is this

gadget (Gadgets) is a set of practical tools accumulated by the author during daily development, covering five directions:

  • AI Conversation Daily Reports
  • Paper Discovery
  • Performance Benchmarking
  • Blog Automation
  • Document Translation

Each directory under tools/ is an independent tool that can be used separately. All tools share the common/ package in the repository root, which provides capabilities such as LLM invocation, JSON parsing, disk caching, atomic writes, translation, and Hugo deployment, installed via pip install -e ..

The development workflow (planning, execution, change tracking) and all Claude Code skills are not in this repository; they are provided by another repository, ai-companion. It is located in the sibling directory ../ai-companion/ and connects to this repository through hooks under .claude/ and .codex/.

2. Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包,所有工具都依赖它
├── scripts/            # 运维与维护脚本(sync.py、onboard.py、smoke.sh 等)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档
├── outputs/            # 所有生成产物(已 gitignore,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议
├── CLAUDE.md           # 给 Claude Code 看的仓库指南
└── pyproject.toml      # common/ 和各工具的打包配置

Where to change what:

Purpose Location
Change the logic of a specific tool tools/<tool>/
Change shared capabilities (LLM, cache, translation, Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time configuration for new machines scripts/onboard.py
Change development workflow or skills ../ai-companion/ repository
View planning and design documents docs/ecl/, docs/

3. Functions of Each Tool| Tool | Function | Key Technologies |

|—|—|—| | summarize | Reads conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, and general JSON formats to call LLM for generating daily, weekly, and monthly reports. Supports a two-stage multi-device workflow: export from each device first, then aggregate and merge. Uses ccusage 20.x to statistics token usage and costs for each agent CLI | Claude/OpenAI API, ccusage, matplotlib | | research | Unified entry point is research_scout.py, providing four capabilities: ① Paper discovery (three-stage LLM evaluation for arXiv, bioRxiv, PubMed, generating research weekly reports); ② Deep paper insights --insight (download full text, analyze writing structure, match OpenReview review comments); ③ Researcher profiling (research trajectory, tier scoring, mentor-student relationship discovery, name disambiguation); ④ Citation mapping (forward citation and backward reference analysis) | arXiv/bioRxiv/PubMed, Semantic Scholar, LLM | | benchmark | Cross-platform CPU/GPU FLOPS testing. GPU supports NVIDIA CUDA, Apple MPS, and Intel XPU; precision supports FP64, FP32, FP16, BF16, and experimental FP8. The workflow consists of warmup, formal measurement, and then statistics (median, IQR for outlier removal). Results are written to CSV in append mode, can generate Plotly HTML reports and leaderboards, and be deployed to Hugo | PyTorch, NumPy, Plotly | | website | Hugo static blog “TzJ’s Net” (PaperMod theme), deployed to GitHub Pages. Compression is incremental: images use pngquant, videos use HandBrakeCLI. It also uses local models for Chinese-English bilingual translation, then builds and pushes | Hugo, pngquant, HandBrakeCLI | | translator | A local Gradio web page similar to Google Translate, capable of translating text and files (.md, .txt, .pdf, .docx, images). It preserves Markdown format; code blocks, URLs, and Hugo shortcodes will not be translated. Inference is performed locally without calling cloud APIs | Gradio, GGUF/transformers | | common/ | Shared layer, providing four LLM backends, JSON repair, SHA-256 disk cache, atomic writes, local translation engine, and cross-platform Hugo deployment | — | | scripts/ | sync.py for rclone synchronization; onboard.py for new machine configuration; smoke.sh for read-only smoke testing; serve_local_llm.sh to configure Ollama; language.py and profile_translation.py for other maintenance | rclone, Python |


II. Usage Tutorial

Note: The following commands are taken directly from the README. Where the README does not specify exact command lines, I will mark them; please refer to TUTORIAL.md or the original documentation of each tool as the standard.

Step 1: Environment Preparation

Required Environment:

  • Python 3.10+, recommended to use the conda environment named AI
  • Node.js 18+, only required for the ../ai-companion/ repository
  • Local Inference Engine: Default is Ollama, which is used for both conversation and translation via gemma4:26b. Alternatives are vLLM on Linux and transformers on Windows, which use tencent/Hy-MT2-1.8B and will be automatically downloaded upon first run
  • External Programs (installed as needed):
    • website requires Hugo, pngquant, and HandBrakeCLI
    • data synchronization requires rclone
conda activate AI

Step 2: Installation

Execute in the repository root:

# common 包 + summarize / research / benchmark / website 的依赖
pip install -e ".[all]"

# translator 不包含在 all 里,需要单独安装
pip install -e ".[translator]"

# 只需要 website 时(包含翻译用的 torch 和 transformers)
pip install -e ".[website]"

After installation, build/ and gadget.egg-info/ will be generated in the repository root. They are already gitignored; do not commit them. For specific dependencies of each tool, see requirements.txt in their respective directories.

Optional: Install ai-companion. Only install if you need development workflows and skills.

  • Checkout git@github.com:TzJ2006/ai-companion.git to the sibling directory ../ai-companion/
  • For installation methods, see ../ai-companion/scripts/install.ts

Step 3: Configuration

1. Configuration Files

  • Manually copy config.example.json from the repository root to config.json]. This file is gitignored.
  • If you need to use other paths, specify them using the environment variable GADGET_CONFIG.
  • Purpose of each section:
    • sync section: configuration for sync.py
    • summarize section: persistent parameters for local LLM

2. Keys

API keys and onboarding forms are located in the tokens/ directory. This directory is gitignored; absolutely do not commit it.

3. Selecting LLM Backend

All features involving LLM can switch backends using --api, or set globally via the environment variable GADGET_LLM_BACKEND.

Backend Description
ollama Default. Local Ollama, no key required, uses Gemma4-26B
claude_cli Reuses the login status of Claude Code CLI, no API key required
anthropic Anthropic API
openai OpenAI API

Global setting example:

export GADGET_LLM_BACKEND=claude_cli

4. Translation-related Environment Variables

  • GADGET_TRANSLATION_BACKEND: Values can be ollama (default), llamacpp, vllm or transformers
  • GADGET_TRANSLATION_MODEL: Overrides the default translation model tencent/Hy-MT2-1.8B

5. Optional: Generate Ollama variants optimized for summarize and export environment variables

eval "$(bash scripts/serve_local_llm.sh env)"

6. One-click Configuration for New Machines

First, fill in tokens/onboard.yaml, then run scripts/onboard.py once. It will automatically complete:

  • SSH configuration
  • Claude/Codex CLI installation and authentication
  • pip extras and ai-companion installation
  • Configuration for each tool
  • rclone bootstrap

The README only mentions “run the script once” without providing the full command line arguments.

If you are using an Ubuntu 22.04/24.04 server and require system-level installation, please use the scripts in the ai-companion repository; check the help first:

bash ../ai-companion/scripts/onboard-server.sh --help

7. Verifying Installation

The smoke test is read-only: it only checks if --help, --info and various modules can be imported; it does not call LLM, connect to the internet, or write files.

bash scripts/smoke.sh

Step 4: Tool Usage

4.1 Summarize: AI Conversation Daily / Weekly / Monthly Reports

The workflow is divided into two stages:

  1. Export conversation logs from each device
  2. Aggregate the logs to one place via cloud drive synchronization or manual copying, then merge them day by day to generate daily reports

Once enough daily reports have accumulated, you can generate weekly and monthly reports.

# 阶段 1:导出所有尚未导出的日期
python -m summarize daily export

# 阶段 2:同步所有日期并逐日合并
python -m summarize daily merge --sync-all

# 生成指定周的周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成指定月的月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键跑完整流程:导出 → 合并 → 周报 → 月报 + 部署
python -m summarize auto --deploy
  • Token usage and costs are automatically tracked by ccusage 20.x, which categorizes commands by source: ccusage claude, ccusage codex, ccusage gemini, etc.
  • Old entry points python tools/summarize/daily_summary.py, weekly_summary.py, monthly_summary.py are still available, but using python -m summarize is recommended.
  • For detailed instructions, see tools/summarize/tutorial.md.

4.2 Research: Paper Discovery and Researcher Analysis

# 完整流程:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索,自动路由到合适的数据源
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 研究者画像
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图谱,参数可以是 arXiv ID 或 DOI
python tools/research/research_scout.py citations 2301.12597

# 把报告部署到 Hugo
python tools/research/research_scout.py deploy
  • Deep paper insights are enabled via --insight. The README does not specify which subcommand it is attached to.
  • Both conference paper search and author search are supported, but the README does not provide specific commands.
  • Please refer to tools/research/TUTORIAL.md for the above two items.

4.3 Benchmark: Performance Benchmarking

All commands must be executed within the tools/benchmark/ directory first:

cd tools/benchmark

# 运行全部测试,结果追加写入 CSV
python -m benchmark.cli

# 只测 CPU
python -m benchmark.cli --cpu-only

# 只测 GPU
python -m benchmark.cli --gpu-only

# 运行测试并生成 HTML 报告
python -m benchmark.cli --report

# 生成报告并发布到 Hugo 的 /benchmark/
python -m benchmark.cli --report --deploy
  • GPU will be automatically detected (CUDA, MPS, or XPU).
  • OpenCL will only appear in the detection results of --info and cannot actually run tests.
  • CSV uses append mode and never overwrites, so results run on different machines will naturally accumulate into a leaderboard.

4.4 Website: Hugo Blog

# 安装依赖
pip install -e ".[website]"

# macOS/Linux:增量压缩 + Hugo 构建 + 推送到 Pages
cd tools/website && bash update.sh

# Windows:脚本会自动 cd 到自己所在的目录
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览,启动开发服务器,包含草稿
cd tools/website && hugo server -D

Notes:

  • Content generated by various tools will be written directly to tools/website/content and tools/website/static and will carry the gadget_generated tag. Hand-written files without this tag will not be overwritten.
  • Compression only processes media files that have changed since .last_build.
  • tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed and pushed by build scripts. Do not commit to it manually.
  • The translation model will be automatically downloaded upon the first run.

4.5 Translator: Gradio Document Translator

# 安装 gradio 和 GGUF 翻译栈
pip install -e ".[translator]"

# 启动 GUI,会在浏览器中打开
python -m translator

Backend Selection: The translator will automatically select the inference backend.

  • If the corresponding model tag has been pulled, ollama is prioritized.
  • On Linux, vllm is prioritized.
  • On Windows, it falls back to transformers.
  • When VRAM is low, llamacpp (GGUF format) can be selected.

Models:

  • The default model is tencent/Hy-MT2-1.8B, and the GGUF version is tencent/Hy-MT2-1.8B-GGUF; it will be automatically downloaded upon first use.
  • You can switch models using GADGET_TRANSLATION_MODEL or via model management in the GUI.
  • Models remain resident in memory after loading; they are loaded on demand when switching models.

Languages:

  • When the source language is set to auto, the language is determined by the proportion of CJK characters in the text.
  • When the target language is set to auto, it performs mutual translation between Chinese and English.

4.6 Cross-device Data Synchronization```bash

python scripts/sync.py # 运行同步脚本 python scripts/sync.py push # 推送 python scripts/sync.py pull # 拉取


- Supported operations: push, pull, status, bootstrap, config.
- Synchronized data categories: summarize, website, research, benchmark, backups. There is also a special category `dag` used for generating and deploying DAG sites.
- Before use, rclone must be configured; synchronization settings are written in the `sync` section of `config.json`.

---

## Step 5: Where is the output

All artifacts are under `outputs/`. This directory is gitignored and can be deleted and rebuilt at any time.

```text
outputs/
├── logs/      # 中间产物(导出日志、运行日志)
├── reports/   # 最终报告(Markdown、JSON、HTML)
├── cache/     # LLM 缓存、搜索缓存
├── data/      # 结构化数据(CSV、JSON 画像)
├── images/    # 图表和生成的图片
└── backups/   # 强制覆盖前的备份

Hugo site content is an exception: it is written directly to tools/website/content and tools/website/static.

Common Notes

  • Do NOT git add the following:
    • Automatically generated content
    • Data synchronized via rclone
    • build/ and gadget.egg-info/
    • Deployment repositories and theme repositories under tools/website/
    • The tokens/ directory
  • For step-by-step operations, data formats, and FAQ for each tool, please refer to TUTORIAL.md in the root directory. The Chinese version of the README is in docs/README.zh.md.
  • The project uses the GPL-3 license.
Fable 5.1 (effort high) — 8,091 chars · 16/16 facts

The following is completed based on the README content: first a project summary, then a usage tutorial for beginners. All commands and parameters are taken solely from the README.

I. Project Summary

What it is. gadget is a collection of practical tools accumulated by the author during daily development, covering five directions: AI chat daily report generation, paper discovery and researcher analysis, CPU/GPU performance benchmarking, Hugo blog automation, and document translation. Each tool is located in an independent directory under tools/ and can be used separately. Common capabilities (LLM calls, JSON parsing fixes, disk caching, atomic writes, local translation engine, Hugo deployment) are unified in the common/ package in the repository root, installed via pip install -e .. The development workflow engine and all Claude Code skills are not in this repository, but in a sibling independent repository ai-companion, accessed through hooks under .claude/ and .codex/. The project uses the GPL-3 license.

Repository Structure.

Directory / File Function
tools/summarize/ AI chat daily / weekly / monthly reports
tools/research/ Paper discovery + researcher analysis + citation graphs
tools/benchmark/ CPU/GPU performance benchmarking
tools/website/ Hugo blog (incremental media compression + automatic build and release)
tools/translator/ Gradio document translator
common/ Shared infrastructure package relied upon by all tools
scripts/ Ops scripts: sync.py, onboard.py, smoke.sh, serve_local_llm.sh, language.py, profile_translation.py
docs/ Design documents, ECL plan (docs/ecl/), audit reports, historical archives (docs/archive/)
outputs/ All generated artifacts (gitignored, can be rebuilt automatically), subdivided into logs / reports / cache / data / images / backups
tokens/ API keys and onboarding forms, gitignored, must NEVER be committed
AGENTS.md / CLAUDE.md AI agent working protocols and Claude Code repository guide
pyproject.toml Packaging configuration
config.json Tool settings (gitignored, copied from config.example.json), paths can be overridden by GADGET_CONFIG

What each tool does.

  • Summarize: Reads chat logs from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, and calls LLMs to generate structured daily, weekly, and monthly reports. It uses a multi-device two-stage architecture: each device first exports logs, which are then aggregated via cloud drive synchronization or manual copying before being merged to generate the report. Through the source-specific commands of ccusage 20.x (ccusage claude, ccusage codex, ccusage gemini), it automatically statistics token usage and costs for each agent CLI.
  • Research: A unified entry point via tools/research/research_scout.py providing four types of capabilities. Paper discovery: searches arXiv / bioRxiv / PubMed, and uses a three-stage LLM pipeline (“quick screening → deep evaluation → citation impact”) to generate research weekly reports and deploy them to Hugo, supporting conference paper and author searches. Deep insight (--insight): downloads full texts to analyze writing structures and publication strategies, automatically matching OpenReview reviews. Researcher profiling: combines arXiv + Semantic Scholar data to generate research trajectory analysis and tier scores, automatically discovering mentor-student relationships, and supporting name disambiguation and reverse lookup. Citation graphs: performs forward citation / backward reference analysis based on the Semantic Scholar API.
  • Benchmark: Cross-platform CPU/GPU FLOPS testing, supporting NVIDIA CUDA, Apple MPS, and Intel XPU (OpenCL only appears in --info detection), covering FP64 / FP32 / FP16 / BF16 / FP8 (experimental). It employs a warm-up + formal measurement + statistical analysis (median, IQR for outlier removal) approach, with explicit GPU synchronization to ensure timing accuracy. Results are written to CSV in append mode, and it can generate Plotly interactive HTML reports and leaderboards, supporting deployment to Hugo and submission to public leaderboards.
  • Website: The Hugo static blog “TzJ’s Net” (PaperMod theme), deployed to GitHub Pages. It features built-in incremental media compression (only processes files changed after .last_build, using pngquant for images and HandBrakeCLI for videos) and local model Chinese-English bilingual translation (defaults to Ollama, falls back to vLLM on Linux, transformers on Windows; models in tencent/Hy-MT2-1.8B are automatically downloaded on first run). Automatically generated content is written directly to tools/website/content|static with gadget_generated tags; handwritten files will not be overwritten. tools/website/public/ is an independent deployment repository, automatically committed and pushed by build scripts; do not commit directly to it.
  • Translator: A Gradio web translator based on the common translation engine, providing a local interface similar to Google Translate. It supports text and .md / .txt / .pdf / .docx / image files, protecting Markdown snippets like code blocks, URLs, and Hugo shortcodes during translation. The entire process uses local inference, automatically selecting the backend (ollama / transformers / vllm / llamacpp) via common.engine.create_engine(). Models remain in memory, with lazy loading upon model switching. The source language can be set to auto (detected by CJK ratio), and when the target is auto, it flips between Chinese and English.

Four LLM Backends. All LLM functions are switched uniformly via --api: ollama (default, local Ollama, no key required, Qwen3.8-27B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, and openai. The environment variable GADGET_LLM_BACKEND can also be used for global settings.

II. Usage Tutorial

1. Environment Preparation

  • Python 3.10 or above, recommended to use conda environment AI.
  • Node.js 18 or above, only required for the ../ai-companion/ independent repository.
  • For specific dependencies of each tool, see requirements.txt in the corresponding directory.
  • Website building requires Hugo, pngquant, and HandBrakeCLI.
  • Cross-device synchronization requires configuring rclone.
  • The default LLM backend is local Ollama; if you do not want to install Ollama, you can use --api claude_cli to reuse the Claude Code login state, or use anthropic / openai and place API keys in the tokens/ directory.
conda activate AI

2. Installation

Execute in the repository root. all contains the common package and dependencies for the four tools: summarize / research / benchmark / website, but does not include translator, which must be installed separately.

pip install -e ".[all]"
pip install -e ".[translator]"

When only a single tool is needed, you can also install just the base package or a single extra:

pip install -e .
pip install -e ".[website]"

Installation will generate build/ and gadget.egg-info/ in the repository root; these are gitignored and should not be committed.

3. Configuration

  • Copy config.example.json to config.json and modify as needed. config.json is gitignored. When paths need to be changed, set the environment variable GADGET_CONFIG.
  • sync.py reads the sync section of config.json; persistent settings for serve_local_llm.sh are placed in the summarize section.
  • API keys are placed in the tokens/ directory and must NEVER be committed.
  • Global environment variables: GADGET_LLM_BACKEND sets the LLM backend; GADGET_TRANSLATION_BACKEND sets the translation engine (ollama → llamacpp / vllm / transformers); GADGET_TRANSLATION_MODEL overrides the translation model.For one-time configuration of a new machine, you can follow the onboarding process: fill in tokens/onboard.yaml, and run scripts/onboard.py once; the script will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.
python scripts/onboard.py

After installation, you can run a read-only smoke test to check if all tools’ --help / --info / import are working normally, without triggering LLM, network, or write operations:

bash scripts/smoke.sh

4. Summarize: Daily / Weekly / Monthly Reports

The typical workflow is divided into two stages. First, export unexported dates on each device, then sync and merge them day by day on the aggregation device. Once enough daily reports are accumulated, weekly and monthly reports are generated, and --deploy will be deployed to Hugo together.

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy

auto is a one-click full process: Export → Merge → Weekly Report → Monthly Report + Deployment. To switch LLM backends, add --api, for example --api claude_cli. Old entries python tools/summarize/daily_summary.py ..., weekly_summary.py, and monthly_summary.py are still available, but the new format is recommended.

If you want to create a specially tuned local Ollama variant for summarize and export environment variables:

eval "$(bash scripts/serve_local_llm.sh env)"

5. Research: Paper Discovery and Researcher Analysis

The unified entry point is tools/research/research_scout.py, run from the repository root.

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy
  • report --project: A complete pipeline: Search → Three-stage evaluation → Report generation.
  • ask: Natural language search with automatic data source routing.
  • profile: Researcher profiling.
  • citations: Citation graph generation by arXiv ID or DOI.
  • deploy: Deploy reports to Hugo.
  • For deep paper insights, add the --insight parameter. All LLM features support switching backends via --api.

6. Benchmark: Performance Benchmarking

All commands must first enter the tools/benchmark/ directory. Results are appended to a CSV and will not overwrite old results; multiple runs on multiple hardware will naturally accumulate into a leaderboard.

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy
  • Without parameters: Run all tests.
  • --cpu-only / --gpu-only: Test only CPU or GPU.
  • --report : Run tests and generate an HTML report.
  • --report --deploy : Generate reports and publish to the /benchmark/ page on Hugo.
  • --info : Detect hardware information. GPUs will automatically recognize CUDA / Apple MPS / Intel XPU.

7. Website: Hugo Blog

First, install website extra (which includes torch + transformers required for translation), then run the build script. The script performs incremental compression, translation, and Hugo building, and automatically commits and pushes to the tools/website/public/ deployment repository.

pip install -e ".[website]"
cd tools/website && bash update.sh

For Windows, use the PowerShell script, which will automatically switch to its own directory:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (development server, including drafts):

cd tools/website && hugo server -D

Notes: The first run will automatically download the translation model tencent/Hy-MT2-1.8B. Hand-written articles should be placed directly in tools/website/content]; files without the gadget_generated tag will not be automatically overwritten. Do not commit directly to tools/website/public/], and do not git add the deployment repository or the theme repository.

8. Translator: Document Translator

pip install -e ".[translator]"
python -m translator

After starting, a Gradio interface will open in your browser, allowing you to translate text or upload .md / .txt / .pdf / .docx / images. The default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF)), which will be automatically downloaded upon first use. To change models, set GADGET_TRANSLATION_MODEL or operate within the model management in the interface. Backend selection rules: if a model tag is already pulled, ollama is prioritized; on Windows, it falls back to transformers; on Linux, vllm is prioritized; if VRAM is insufficient, llamacpp is used to load GGUF.

9. Cross-device Data Synchronization

sync.py uses rclone to centrally synchronize data categories such as summarize / website / research / benchmark / backups, supporting push / pull / status / bootstrap / config operations. There is also a special dag category used for generating and deploying DAG sites.

python scripts/sync.py
python scripts/sync.py push
python scripts/sync.py pull

10. Other Scripts and ai-companion

  • scripts/language.py: Hugo bilingual auditing and summarize report renaming.
  • scripts/profile_translation.py: Translation engine GPU performance analysis.
  • ai-companion is an independent Node.js repository that needs to be cloned to ../ai-companion/. It provides code change tracking, a /idea → /ccplan → /ccedit planning and execution pipeline, and all skills; see ../ai-companion/scripts/install.ts for installation instructions.
  • A system-level one-click installation script for Ubuntu 22.04/24.04 servers is also available in that repository:
bash ../ai-companion/scripts/onboard-server.sh --help

In it, --companion-repo directly passes the ai-companion repository address git@github.com:TzJ2006/ai-companion.git, and --companion-ref is no longer required.

11. Output Locations and Submission Norms

All generated products are under outputs/: logs/ intermediate products, reports/ final reports, cache/ LLM and search cache, data/ structured data, images/ charts, and backups/ forced overwrite backups. Hugo content is written directly to tools/website/content|static, with no separate staging directory. Never git add automatically generated content, rclone synchronized data, build/, gadget.egg-info/, or any files under tokens/.

If you need to publish this tutorial as a shareable webpage, just let me know.

Opus 5 — 12,340 chars · 16/16 facts

I. Project Summary

What it is

Gadgets is a collection of practical tools accumulated during daily development, covering AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each directory under tools/ is an independently usable tool; shared infrastructure is unified in the common/ package at the repository root (installed via pip install -e . ), providing common capabilities such as LLM invocation, JSON parsing, disk caching, atomic writing, translation, and Hugo deployment.

The development workflow (planning/execution/change tracking) and all Claude Code skills are provided by ai-companion — an independent repository (git@github.com:TzJ2006/ai-companion.git) checked out in the sibling directory ../ai-companion/, integrated into this repository via hooks. The license is GPL-3.

Repository Structure

gadget/
├── tools/              # 五个独立工具产品(改工具来这里)
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM / 缓存 / IO / 翻译 / Hugo)—— 所有工具依赖它
├── scripts/            # 运维 + 维护脚本(sync.py, onboard.py, language.py, profile_translation.py, …)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 所有生成产物(gitignored,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议(行动前先读)
├── CLAUDE.md           # 给 Claude Code 的仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置(pip install -e .)

build/ and gadget.egg-info/ are generated by pip install -e . (gitignored, always located at the repository root).

Where to go to make changes:

What you want to do Where to go
Change the logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / Cache / Translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time configuration of a new machine scripts/onboard.py
Change development workflow / skill ai-companion repository (sibling ../ai-companion/)
Read plans / design documents docs/ecl/, docs/

What each tool does

tools/summarize/ —— AI Conversation Daily / Weekly / Monthly Reports

Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLM APIs to generate structured daily, weekly, and monthly reports. Multi-device workflow: each device exports conversation logs → sync via cloud drive or manual copy to an aggregation device → generate final daily reports; once enough daily reports are accumulated, weekly and monthly trend summaries are generated. Automatically discovers and statistics token usage and costs for all agent CLIs through the ccusage 20.x namespace-by-source command (ccusage claude, ccusage codex, ccusage gemini…). Four types of AI summary backends, unified via --api for switching. Key technologies: Claude/OpenAI API, ccusage 20.x (multi-source unification), matplotlib.

tools/research/ —— Paper Discovery and Researcher Analysis

A unified academic research toolbox providing four major capabilities through a single CLI entry point tools/research/research_scout.py:

  • Paper Discovery: Search for papers from arXiv / bioRxiv / PubMed, following a three-stage LLM pipeline (fast screening → deep evaluation → citation impact), generating research weekly reports and deploying them to Hugo. Supports conference paper search and author search.
  • Deep Paper Insights (--insight): Download full papers and let the LLM analyze their writing structure, publication strategy, and reusable core knowledge; automatically match OpenReview to obtain peer reviews and analyze consensus and controversy; synthesize cross-paper research writing guides.
  • Researcher Profiling: Scrape paper and citation data from ArXiv + Semantic Scholar, use LLM to generate research trajectory analysis, calculate tier scores, and automatically discover mentor-student relationships through homepage extraction + co-authorship patterns. Supports name disambiguation and reverse lookup.
  • Citation Graph Analysis: Forward citation / backward reference analysis based on the Semantic Scholar API, combined with LLM-driven impact interpretation.

tools/benchmark/ —— Performance Benchmarking SuiteCross-platform CPU/GPU FLOPS benchmarking tool, measuring floating-point performance uniformly across different hardware vendors and precision levels. Supports actual GPU execution for NVIDIA(CUDA), Apple Silicon(MPS), and Intel(XPU) (OpenCL may only appear in --info detection), covering precisions such as FP64 / FP32 / FP16 / BF16 / FP8(experimental). Measurement uses Warm-up + Formal Measurement + Statistical Analysis (median, IQR outlier removal), and explicitly performs GPU synchronization to ensure timing accuracy. Results are accumulated in CSV in append mode (never overwrites, naturally supports multi-hardware cumulative leaderboards), can generate interactive HTML reports and leaderboards with Plotly charts, and supports deployment to Hugo websites and submission to public leaderboards.

tools/website/ —— Hugo Blog

Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/). Built-in incremental image/video compression pipeline (only compresses media changed since .last_build: images via pngquant, videos via HandBrakeCLI) and local model bilingual translation (default Ollama, with vLLM on Linux / transformers on Windows as fallback; model tencent/Hy-MT2-1.8B is automatically downloaded upon first run, without using cloud LLM APIs). Auto-generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly to tools/website/content|static by the deployment pipeline (the unique Hugo content root, files marked with gadget_generated; hand-written files without marks are never overwritten), then translated, compressed, built, and pushed.

⚠️ tools/website/public/ is a standalone deployment repository (tzj2006/tzj2006.github.io), automatically committed + pushed by build scripts —— do not commit directly to it.

tools/translator/ —— Gradio Document Translator

A Gradio document translator based on the common translation engine: a local translation web interface in the style of Google Translate, translating text and files (.md / .txt / .pdf / .docx / images), while preserving Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected). It runs local inference rather than cloud APIs: reuses common.engine.create_engine() to automatically select the backend (automatically prioritizes ollama if the model tag is already pulled; transformers is the Windows fallback, prioritizing vllm on Linux, and llamacpp is the low-VRAM GGUF option), with models staying in memory (warm) and lazily loaded on demand when switching models. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded upon first use, and can be overridden via GADGET_TRANSLATION_MODEL or the model management within the GUI. Source language can be set to auto (detected by CJK text ratio); when the target language is auto, it flips between zh↔en.

common/ —— Shared Infrastructure Package

The shared layer that all tools depend on, installed as a Python package via pip install -e .:

  • LLM calls (unified two-layer API, supporting four backends: ollama(default) / claude_cli / anthropic / openai))
  • JSON parsing and repair
  • SHA-256 disk cache (namespace + TTL)
  • Atomic writes and content hashing
  • Local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation
  • Cross-platform Hugo deployment

scripts/ —— Ops and Maintenance Scripts

  • sync.py —— Centralized rclone data synchronization (push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories; there is also a special dag category for generating + deploying DAG sites). Configured in the sync section of the repository root config.json (paths can be overridden via GADGET_CONFIG).
  • onboard.py —— Repository-level one-time machine initialization: fill out a YAML table (tokens/onboard.yaml), run the script once, and it automatically completes SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.
  • smoke.sh —— Read-only smoke check covering all tools (--help / --info / import; does not involve LLM, network, or writing).
  • serve_local_llm.sh —— Creates an Ollama variant optimized for summarize and prints environment variables. Persistence switches are located in the summarize section of the repository root config.json.
  • Others: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU profiler).

../ai-companion/ —— Independent Repository

An independent Node.js repository, checked out in the sibling directory ../ai-companion/, not within this repository. It records function-level code changes, generates tests and HTML reports, provides a /idea→/ccplan→/ccedit plan-execute pipeline, and hosts all Claude Code skills (methodologies + domains). This repository connects via hooks under .claude/ and .codex/.

It is packaged both as a standard Claude Code plugin and an equivalent Codex integration —— ready to use upon installation without building (the change tracking hook is a pre-built single-file product committed with the repository). All skills (Methodologies: ccplan planning, optimize optimization, cchypothesis debugging, repo-audit auditing, repo-tidy tidying; Domains: summarize code overview, slurm-gpu cluster detection, nature-benchmark / NIPS-2025-paper paper writing advisor) are in that repository; this repository no longer contains the skills/ directory. See ../ai-companion/scripts/install.ts for installation.

outputs/ —— Output Directory

All generated outputs are unified in outputs/ (already gitignored, can be automatically rebuilt):

outputs/
├── logs/         # 中间产物(导出日志、运行日志)
├── reports/      # 最终报告(Markdown、JSON、HTML)
├── cache/        # LLM 缓存、搜索缓存
├── data/         # 结构化数据(CSV、JSON profiles)
├── images/       # 图表和生成的图片
└── backups/      # 强制覆盖备份(website-force 等)

Hugo site content is written directly to tools/website/content|static (no independent outputs/site staging tree).


II. Usage Tutorial (For First-time Users)

This tutorial only covers what is written in the README. For step-by-step operations, configuration, data formats, and FAQs for each tool, please further consult the TUTORIAL.md in the repository and each tool’s own original documentation.

Step 0: Environment Preparation

  • Python 3.10+ (conda environment AI is recommended)
  • Node.js 18+ (only required by the independent repository ../ai-companion/)
  • Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • website / translation functions use a local inference engine (default Ollama; vLLM on Linux, transformers on Windows as fallback), and model tencent/Hy-MT2-1.8B is automatically downloaded upon first run.

Activate the recommended environment:

conda activate AI

Step 1: Installation

Install the common package + extras for summarize / research / benchmark / website:

pip install -e ".[all]"

⚠️ Note: all does not include translator, which must be installed separately:

pip install -e ".[translator]"

If you only want to use a specific tool, you can also install only the corresponding extra:

pip install -e ".[website]"      # website(含 torch + transformers 用于翻译)
pip install -e ".[translator]"   # translator(gradio + GGUF 翻译栈)

After installation, build/ and gadget.egg-info/ will be generated in the repository root (already gitignored, which is normal).

Step 2: Configuration

Tool Configuration Files: config.json at the repository root (already gitignored), copied from config.example.json:

cp config.example.json config.json

To use different paths, set environment variables to override:

export GADGET_CONFIG=/path/to/your/config.json

Among them, the sync section is for scripts/sync.py configuration, and the summarize section is for the scripts/serve_local_llm.sh persistence switch.

API Keys: Placed in the tokens/ directory (already gitignored, never commit its contents).

LLM Backend Selection: All LLM functions use the --api parameter for switching, with four possible values:

Value Description
ollama Default, local Ollama, no key required, Qwen3.8-27B
claude_cli Reuses the login status of Claude Code CLI, no API key needed
anthropic Anthropic API
openai OpenAI API

You can also set it globally using environment variables:

export GADGET_LLM_BACKEND=ollama

Translation Backend: Translation uses the local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama(default when the model is already pulled, uses local Ollama server) → llamacpp / vllm / transformers (in-process), with model tencent/Hy-MT2-1.8B. The translation model can be overridden:

export GADGET_TRANSLATION_BACKEND=ollama
export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B

Step 3 (Optional): One-time Initialization for New Machines

After filling out the tokens/onboard.yaml YAML table, run:

python scripts/onboard.py

It will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.

Server System-level Installation (Ubuntu 22.04/24.04, one-click installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion) has been migrated to the ai-companion repository:```bash bash ../ai-companion/scripts/onboard-server.sh –help


After the repository split, `--companion-repo` is directly passed to the ai-companion repository (`git@github.com:TzJ2006/ai-companion.git`), and `--companion-ref` is no longer needed.

## Step 4: Run a smoke test first

Read-only, no LLM/network/writing, used to confirm installation:

```bash
bash scripts/smoke.sh

Tool 1: Summarize —— AI Chat Daily/Weekly/Monthly Reports

The python -m summarize format is recommended. The typical workflow is two-stage: export on each device first, then aggregate and merge.

python -m summarize daily export                                   # 阶段 1:导出所有尚未导出的日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键全流程:导出 → 合并 → 周报 → 月报 + 部署

Multi-device usage: Run daily export on each device, aggregate the logs together via cloud drive synchronization or manual copying, then run daily merge --sync-all to generate the final daily report; once enough daily reports have accumulated, generate weekly and monthly trend summaries.

Switching AI summary backend:

python -m summarize auto --deploy --api claude_cli

If you want to use the summarize tuning variant with local Ollama:

eval "$(bash scripts/serve_local_llm.sh env)"

Old entries python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available (backward-compatible re-export shim), but the new format above is recommended.

See TUTORIAL.md#summarize and tools/summarize/tutorial.md for details.

Tool 2: Research —— Paper Discovery and Researcher Analysis

Single CLI entry tools/research/research_scout.py:

python tools/research/research_scout.py report --project my-project        # 全流程:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

Use --insight for deep insights; all LLM functions support switching backends via --api, for example:

python tools/research/research_scout.py report --project my-project --api claude_cli

See TUTORIAL.md#research and tools/research/TUTORIAL.md for details.

Tool 3: Benchmark —— Performance Benchmarking

⚠️ All commands require first cd into tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                    # 跑全部基准测试(结果追加到 CSV)
python -m benchmark.cli --cpu-only         # 只跑 CPU
python -m benchmark.cli --gpu-only         # 只跑 GPU
python -m benchmark.cli --report           # 跑测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo /benchmark/

To only view hardware detection results without actually running, use --info (note that OpenCL may only appear in --info detection and does not mean it can actually run). GPU benchmarks will automatically detect CUDA / Apple MPS / Intel XPU. Results are accumulated in append mode and will not overwrite history, so they can be run on multiple machines and accumulated into a leaderboard.

See TUTORIAL.md#benchmark and tools/benchmark/tutorial.md for details.

Tool 4: Website —— Hugo Blog

pip install -e ".[website]"                          # 安装依赖(含 torch + transformers 用于翻译)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自己 cd 到所在目录)
cd tools/website && hugo server -D                   # 本地预览(dev server,包含草稿)

Bilingual auditing and summarize report renaming:

python scripts/language.py

Two red lines you must remember:

  1. tools/website/public/ is an independent deployment repository, which is automatically committed and pushed by build scripts —— do not commit directly to it.
  2. Automatically generated files carry the gadget_generated tag; handwritten files without the tag will never be overwritten —— so handwritten content is safe, but do not add that tag to handwritten files.

See TUTORIAL.md#website and tools/website/CLAUDE.md for details.

Tool 5: Translator —— Gradio Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(在浏览器中打开)

After starting, you can translate text in the web page, or upload .md / .txt / .pdf / .docx / image files. Selecting auto as the source language will automatically detect based on the text CJK ratio; selecting auto as the target language will flip between Chinese and English. You can change models in the model management within the GUI, or set environment variables before starting:

export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF
python -m translator

Models are automatically downloaded upon first use, with full local inference, without using cloud APIs.

For UI wiring see tools/translator/app.py, for translation and file logic see tools/translator/core.py, and for the shared engine see common/engine.py and common/translation.py. See TUTORIAL.md#translator for details.

Cross-device Data Synchronization

python scripts/sync.py           # 查看用法
python scripts/sync.py push      # 推送
python scripts/sync.py pull      # 拉取

Subcommands include push / pull / status / bootstrap / config, covering categories summarize / website / research / benchmark / backups, with a special dag category used for generating + deploying DAG sites. You need to configure rclone first; configuration is in the sync section of config.json.

Common Precautions (Must Comply)

  • tokens/ stores API keys and onboarding tables, which are gitignored —— never commit its contents.
  • All generated file outputs go to outputs/, which is gitignored.
  • Never git add: automatically generated content, rclone synchronized data, build artifacts (build/, gadget.egg-info/), and the deployment and theme repositories under tools/website/.
  • Read AGENTS.md (workflow protocols for all AI agents) before taking action.
  • This project is licensed under GPL-3 (see LICENSE).
Sonnet 5 — 5,754 chars · 16/16 facts

Project Summary

Gadget is a collection of practical tools accumulated during daily development, covering five major categories: AI chat daily report generation, paper discovery, performance benchmarking, blog automation, and document translation.

Repository Structure

gadget/
├── tools/              # 五个独立工具产品
│   ├── summarize/      # AI 对话日/周/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能测评
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/      # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM 调用/缓存/IO/翻译/Hugo 部署),被所有工具依赖
├── scripts/            # 运维维护脚本(sync.py、onboard.py、language.py、profile_translation.py 等)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 所有生成产物(已 gitignore,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ + 各工具的打包配置(pip install -e .)

The development workflow engine and all Claude Code skills are located in the independent repository ai-companion (in the same directory ../ai-companion/ ), connected to this repository through hooks under .claude/ and .codex/.

What Each Tool Does

Tool Function Key Technologies
summarize Reads daily AI chat records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM to generate structured daily/weekly/monthly reports; uses ccusage 20.x to statistics token usage and costs for each Agent CLI Claude/OpenAI API, ccusage 20.x, matplotlib
research Provides paper discovery (arXiv/bioRxiv/PubMed three-stage LLM pipeline), deep paper interpretation (--insight, including OpenReview review matching), researcher profiling (including teacher-student relationship mining), and citation graph analysis via a unified CLI (research_scout.py) arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
benchmark Cross-platform CPU/GPU FLOPS evaluation, supporting NVIDIA/Apple Silicon/Intel, multiple precisions (FP64~FP8), results accumulated as CSV, can generate HTML reports and deploy to Hugo PyTorch, NumPy, Plotly
website Hugo static blog (PaperMod theme), built-in incremental image/video compression (pngquant/HandBrakeCLI) and local model bilingual translation, automatic content writing to `tools/website/content static`
translator Gradio web translator based on the common translation engine, supporting text and files (.md/.txt/.pdf/.docx/images), preserving Markdown format, local inference Gradio, GGUF/transformers

All LLM functions switch backends uniformly through --api: ollama (default, local without keys), claude_cli (reusing Claude Code login state), anthropic, openai.


Usage Tutorial

I. Environment Preparation

  • Python 3.10+ (conda environment AI is recommended)
conda activate AI
  • Node.js 18+ (only when the peer repository ../ai-companion/ is required)
  • GPU evaluation will automatically detect CUDA / Apple MPS / Intel XPU
  • The tokens/ directory stores API keys and onboarding configuration tables, which are gitignored; do not commit them.

II. Installation

Install the common package + dependencies for summarize/research/benchmark/website (all does not include translator):

pip install -e ".[all]"

To use the translator, install separately:

pip install -e ".[translator]"

To use the website tool (including torch + transformers required for translation):

pip install -e ".[website]"

III. Configuration

Tool configurations are stored in config.json at the repository root (gitignored, copied from config.example.json), and the path can be overridden via the GADGET_CONFIG environment variable.

One-time configuration for new machines:

# 先填写 tokens/onboard.yaml,然后运行:
python scripts/onboard.py

This script will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.

Server-level system installation (Ubuntu 22.04/24.04), migrated to the ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help

IV. Typical Usage for Each Tool

1. Summarize —— AI Chat Daily/Weekly/Monthly Reports

python -m summarize daily export                                   # 第一阶段:导出所有未导出的日期
python -m summarize daily merge --sync-all                         # 第二阶段:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 生成周报并部署
python -m summarize monthly generate --month 2026-02 --deploy      # 生成月报并部署
python -m summarize auto --deploy                                  # 一键全流程:导出→合并→周报→月报+部署

Old interfaces python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available (backward compatible), but the python -m summarize format above is recommended.

2. Research —— Paper Discovery and Researcher Analysis

python tools/research/research_scout.py report --project my-project        # 完整流水线:搜索→三阶段评估→生成报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 部署报告到 Hugo

3. Benchmark —— Performance Evaluation

Note: All commands require first cd tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                # 运行所有测评(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 仅 CPU
python -m benchmark.cli --gpu-only     # 仅 GPU
python -m benchmark.cli --report       # 运行测评 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo /benchmark/

4. Website —— Hugo Blog

pip install -e ".[website]"                          # 安装依赖(含 torch + transformers 用于翻译)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自行 cd 到自身目录)
cd tools/website && hugo server -D                   # 本地预览(开发服务器,含草稿)

5. Translator —— Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio 图形界面(浏览器打开)

The default model is tencent/Hy-MT2-1.8B (automatically downloaded upon first use), which can be overridden via the GADGET_TRANSLATION_MODEL environment variable or model management within the GUI.

V. Common Maintenance Scripts```bash

python scripts/sync.py # 集中式 rclone 数据同步(push/pull/status/bootstrap/config) bash scripts/smoke.sh # 全工具只读冒烟测试(–help/–info/imports,无 LLM、网络、写入) eval “$(bash scripts/serve_local_llm.sh env)” # 创建 summarize 专用 Ollama 变体并打印环境变量


## 6. Other Notes

- The output directory is unified in `outputs/` (subdirectories `logs/reports/cache/data/images/backups`), which is gitignored and can be automatically rebuilt.
- The LLM backend can be switched via the `--api` parameter or the global environment variable `GADGET_LLM_BACKEND`: `ollama` (default), `claude_cli`, `anthropic`, `openai`.
- The translation backend is selected by `GADGET_TRANSLATION_BACKEND`: default `ollama` (when models are already pulled) → `llamacpp`/`vllm`/`transformers`.
- Cross-device data synchronization: `python scripts/sync.py push/pull` (requires configuring rclone).
- Never `git add` automatically generated content, rclone synchronized data, build artifacts (`build/`, `gadget.egg-info/`), or the deployment/theme repositories under `tools/website/`.
- The license is GPL-3 (see `LICENSE`).
- For more detailed step-by-step operations, configuration items, data formats, and FAQ, please refer to [TUTORIAL.md](TUTORIAL.md) and the built-in documentation under each tool's directory.

</details>

<details>
<summary><b>Haiku 4.5</b> — 11,235 chars · 15/16 facts</summary>

# Gadget Project Complete Guide

## I. Project Summary

### 1.1 Project Overview

**Gadget** is an open-source toolset that gathers practical tools accumulated during daily development. It covers the following functions:
- **AI Daily Report Generation** — Automatically statistics AI conversation records from multiple devices to generate daily/weekly/monthly reports.
- **Paper Discovery** — Searches and evaluates papers from academic databases, analyzing researchers and citation networks.
- **Performance Benchmarking** — Cross-platform FLOPS testing for CPU/GPU.
- **Blog Automation** — Hugo static site, supporting incremental media compression and automatic deployment.
- **Document Translation** — A Gradio translator with local inference, supporting text and various file formats.

### 1.2 Repository Structure

gadget/ ├── tools/ # 5个独立工具产品 │ ├── summarize/ # AI对话日/周/月报告 │ ├── research/ # 论文发现 + 研究者分析 + 引文图 │ ├── benchmark/ # CPU/GPU性能基准测试 │ ├── website/ # Hugo博客(增量压缩 + 自动发布) │ └── translator/ # Gradio文档翻译器 ├── common/ # 共享基础设施包(所有工具依赖) ├── scripts/ # 运维脚本(数据同步、机器配置等) ├── docs/ # 设计文档和ECL计划 ├── outputs/ # 生成的文件(自动重建,已gitignore) ├── CLAUDE.md # Claude Code 仓库指南 └── pyproject.toml # Python打包配置


### 1.3 Functions of Each Tool

| Tool | Function | Core Features |
|------|------|---------|
| **Summarize** | AI conversation daily/weekly/monthly reports | Multi-device aggregation, multi-source token statistics, switchable between 4 LLM backends |
| **Research** | Paper discovery + Researcher analysis | arXiv/bioRxiv/PubMed search, three-stage evaluation, citation graphs, research trajectory analysis |
| **Benchmark** | CPU/GPU performance testing | Supports CUDA/MPS/XPU, multiple precisions (FP64-FP8), HTML reports + Plotly charts |
| **Website** | Hugo blog | Incremental image/video compression, automatic publishing to GitHub Pages, local bilingual translation |
| **Translator** | Document translator | Local inference, supports MD/TXT/PDF/DOCX/images, preserves formatting |

### 1.4 Infrastructure

- **common/** — Shared capabilities such as LLM calls, disk cache, translation engine, Hugo deployment, etc.
- **scripts/** — Data synchronization (`sync.py`), machine initialization (`onboard.py`), LLM services (`serve_local_llm.sh`), etc.
- **ai-companion/** — A separate Node.js repository (located in `../ai-companion/`), providing code change tracking and all Claude Code skills.

---

## II. Detailed Usage Tutorial

### 2.1 Environment Preparation

#### System Requirements

- **Python 3.10+** (conda environment recommended)
- **Node.js 18+** (only required for the ai-companion repository)
- Git

#### Creating Python Environment

```bash
# 使用conda创建Python 3.10环境
conda create -n AI python=3.10
conda activate AI

# 或者使用venv
python3.10 -m venv venv
source venv/bin/activate  # Linux/macOS
# 或在Windows上: venv\Scripts\activate

2.2 Installation Steps

Step 1: Clone the Repository

git clone <gadget-repository-url>
cd gadget

Step 2: Install Common Packages and All Tools

# 安装common包 + summarize/research/benchmark/website的所有依赖
pip install -e ".[all]"

# 如果需要translator工具,需单独安装
pip install -e ".[translator]"

# 如果需要website工具的完整功能(包含torch+transformers用于翻译)
pip install -e ".[website]"

Step 3: Prepare API Keys and Configuration

# 创建token目录(存放API密钥等敏感信息,已gitignore)
mkdir -p tokens/

# 从示例配置创建主配置文件
cp config.example.json config.json

# 编辑config.json,填入以下信息:
# - LLM API密钥(如果使用anthropic或openai后端)
# - Hugo部署配置(如果使用website工具)
# - rclone数据同步配置(如果需要跨设备数据同步)

If it is a new machine, you can use the automation script to complete all configurations at once:

# 编辑初始化配置表
# 打开 tokens/onboard.yaml,填入SSH/API密钥/工具配置等

# 运行初始化脚本
python scripts/onboard.py

# 这个脚本会自动完成:
# - SSH配置
# - Claude Code / Codex CLI 登录
# - pip 依赖安装
# - 各工具配置
# - rclone 引导启动

Step 5: Verify Installation

# 运行烟雾测试(只读,无LLM调用,无网络,无写入)
bash scripts/smoke.sh

2.3 Tool Configuration

Global LLM Backend Configuration

All tools switch backends via the unified --api parameter:

# 方式1:命令行指定
python -m summarize daily export --api ollama

# 方式2:环境变量全局设置
export GADGET_LLM_BACKEND=claude_cli
python -m summarize daily export  # 自动使用claude_cli

# 可用后端
# - ollama(默认,本地Ollama,无需密钥,模型:Qwen3.8-27B)
# - claude_cli(重用Claude Code CLI登录状态,无需API密钥)
# - anthropic(需要ANTHROPIC_API_KEY环境变量)
# - openai(需要OPENAI_API_KEY环境变量)

Translation Engine Configuration

The translation used by Website and Translator tools uses local inference:

# 方式1:自动选择(推荐)
# - Ollama已安装且模型已拉取 → 使用ollama
# - Linux → vllm优先
# - Windows → transformers优先

# 方式2:指定后端
export GADGET_TRANSLATION_BACKEND=transformers

# 方式3:指定模型
export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF

# 默认模型会在首次使用时自动下载
# 启动Ollama服务并输出环境变量
eval "$(bash scripts/serve_local_llm.sh env)"

# 这会:
# 1. 拉取并启动 Qwen 模型(如果未启动)
# 2. 输出环境变量供后续命令使用
# 3. 持久化配置保存在repo根目录 config.json 的 summarize 字段

2.4 Detailed Usage for Each Tool

2.4.1 Summarize — AI Conversation Daily/Weekly/Monthly Reports

Function: Automatically extracts token usage and conversation content from multi-device AI conversation records to generate structured daily, weekly, and monthly reports.

Workflow:

  1. Export unexported conversation records on each device (Phase 1)
  2. Aggregate via cloud drive synchronization or manual copying (Phase 2)
  3. Generate daily, weekly, and monthly reports

Typical Commands:

# === Phase 1: 导出所有未导出日期的对话记录 ===
python -m summarize daily export

# === Phase 2: 同步所有日期并逐日合并 ===
python -m summarize daily merge --sync-all

# === 生成周报(周号格式:2026-W12,表示2026年第12周)===
python -m summarize weekly generate --week 2026-W12

# 生成周报并自动发布到Hugo博客
python -m summarize weekly generate --week 2026-W12 --deploy

# === 生成月报(月份格式:2026-02)===
python -m summarize monthly generate --month 2026-02

# 生成月报并发布
python -m summarize monthly generate --month 2026-02 --deploy

# === 一键完整流程 ===
# 导出 → 合并 → 生成周报 → 生成月报 + 自动发布
python -m summarize auto --deploy

# === 指定LLM后端 ===
python -m summarize daily export --api anthropic
python -m summarize auto --deploy --api openai

Supported LLM Backends:

  • ollama (default, local, no key required)
  • claude_cli (reuses Claude Code CLI)
  • anthropic (requires ANTHROPIC_API_KEY)
  • openai (requires OPENAI_API_KEY)

Detailed Step-by-Step Tutorial: See TUTORIAL.md — Summarize and tools/summarize/tutorial.md


2.4.2 Research — Paper Discovery and Researcher Analysis

Function: A unified academic research toolkit providing paper discovery, in-depth paper analysis, researcher analysis, and citation graph analysis.

Entry Point: tools/research/research_scout.py

Typical Commands:

# === 论文发现完整流程 ===
# 搜索论文 → 三阶段评估(快速筛选→深度评估→引文影响)→ 生成周报 → 发布Hugo
python tools/research/research_scout.py report --project my-project

# === 自然语言搜索(自动路由源)===
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# === 研究者分析 ===
# 获取论文+引用数据,生成研究轨迹分析,计算分级分数
# 自动发现导师-学生关系
python tools/research/research_scout.py profile "Sergey Levine"

# === 引文图分析 ===
# 基于Semantic Scholar API的前向/后向引用分析
python tools/research/research_scout.py citations 2301.12597

# === 发布报告到Hugo ===
python tools/research/research_scout.py deploy

# === 指定LLM后端 ===
python tools/research/research_scout.py report --project my-project --api claude_cli
python tools/research/research_scout.py profile "Sergey Levine" --api anthropic

LLM Backend Options:

  • ollama (default)
  • claude_cli
  • anthropic
  • openai

Detailed Step-by-Step Tutorial: See TUTORIAL.md — Research and tools/research/TUTORIAL.md


2.4.3 Benchmark — Performance Benchmarking

Function: Cross-platform CPU/GPU FLOPS benchmarking, supporting various hardware and precisions.

Prerequisites:

cd tools/benchmark  # 所有命令必须在此目录执行

Supported Hardware:

  • NVIDIA (CUDA)
  • Apple Silicon (MPS)
  • Intel (XPU)

Supported Precisions: FP64, FP32, FP16, BF16, FP8 (experimental)

Typical Commands:

cd tools/benchmark

# === 运行所有基准测试(结果追加到CSV) ===
python -m benchmark.cli

# === 仅CPU测试 ===
python -m benchmark.cli --cpu-only

# === 仅GPU测试 ===
python -m benchmark.cli --gpu-only

# === 运行测试 + 生成HTML报告 ===
# 生成Plotly交互式图表、排行榜
python -m benchmark.cli --report

# === 生成报告 + 发布到Hugo /benchmark/ 页面 ===
python -m benchmark.cli --report --deploy

# === 提交到公共排行榜(如需要) ===
# 见详细文档

Result Processing:

  • Results are accumulated into a CSV (append mode, never overwritten)
  • Supports generating interactive HTML reports (Plotly)
  • Supports publishing to Hugo website
  • Supports submitting to public leaderboards

Detailed Step-by-Step Tutorial: See TUTORIAL.md — Benchmark and tools/benchmark/tutorial.md


2.4.4 Website — Hugo Blog Automation

Function: A Hugo static blog website, supporting incremental media compression and automated deployment.

Website Information:

  • Website Name: “TzJ’s Net”
  • Theme: PaperMod
  • Deployment: GitHub Pages (https://tzj2006.github.io/)

Features:

  • Incremental image/video compression (only compresses files modified after .last_build)
  • Local bilingual translation (default Ollama, Linux alternative vLLM, Windows alternative transformers)
  • Automatic translation, compression, build, and push

Prerequisite Dependencies:

# 安装website依赖(包含torch + transformers用于本地翻译)
pip install -e ".[website]"

Typical Commands:

# === macOS / Linux ===
cd tools/website
bash update.sh  # 增量压缩 + Hugo构建 + 推送GitHub Pages

# === Windows ===
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
# 脚本自动cd到自己的目录

# === 本地预览(dev server) ===
cd tools/website
hugo server -D  # -D 表示包含草稿,打开 http://localhost:1313

Handling Automatically Generated Content:

  • Daily/weekly/monthly reports, research reports, benchmark pages, charts, etc., are written directly to tools/website/content|static by the publishing process of each tool.
  • All automatically generated files are marked with a gadget_generated tag.
  • Hand-written files (without tags) are never overwritten.

Deployment Repository:

  • tools/website/public/ is a separate deployment repository (tzj2006/tzj2006.github.io).
  • Automatically committed and pushed by the build script.
  • Do not commit directly to this directory.

Detailed Step-by-Step Tutorial: See TUTORIAL.md — Website and tools/website/CLAUDE.md


2.4.5 Translator — Gradio Document Translator

Function: A document translator with local inference, supporting text and various file formats.

Features:

  • Local translation web interface in the style of Google Translate
  • Supported formats: .md / .txt / .pdf / .docx / images
  • Preserves Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected)
  • Local inference, no cloud API calls

Prerequisite Dependencies:

pip install -e ".[translator]"

Starting the Application:

python -m translator
# 自动在浏览器打开 Gradio GUI

Configuration:

# 默认模型(自动在首次使用时下载)
# 模型:tencent/Hy-MT2-1.8B(GGUF变体:tencent/Hy-MT2-1.8B-GGUF)

# 方式1:环境变量指定模型
export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF

# 方式2:在GUI中管理模型

# 方式3:环境变量指定后端
export GADGET_TRANSLATION_BACKEND=ollama

Functionality:

  • Source language can be set to auto (automatically detected via CJK ratio in text)
  • When the target language is auto, it automatically switches between Chinese ↔ English

Detailed Step-by-Step Tutorial: See TUTORIAL.md — Translator

Code Reference:

  • UI Configuration: tools/translator/app.py
  • Translation and File Logic: tools/translator/core.py
  • Shared Translation Engine: common/engine.py, common/translation.py

2.5 Cross-Device Data Synchronization

Function: Centralized rclone data synchronization, supporting push/pull/status/bootstrap/configuration.```bash

查看帮助

python scripts/sync.py

推送到远程

python scripts/sync.py push

拉取从远程

python scripts/sync.py pull

查看同步状态

python scripts/sync.py status

初始化bootstrap(首次setup)

python scripts/sync.py bootstrap

配置同步

python scripts/sync.py config


**Configuration**:
- Saved in the `sync` field of the repo root `config.json`
- Override configuration path: `GADGET_CONFIG` environment variable
- Override scope: summarize / website / research / benchmark / backups / dag (DAG website generation + publishing)

---

### 2.6 Output Directory Structure

All generated files are stored in the `outputs/` directory (already gitignored, can be automatically rebuilt):

outputs/ ├── logs/ # 中间文件(导出日志、运行日志) ├── reports/ # 最终报告(Markdown、JSON、HTML) ├── cache/ # LLM缓存、搜索缓存 ├── data/ # 结构化数据(CSV、JSON研究者数据) ├── images/ # 图表和生成的图像 └── backups/ # 强制覆盖备份(website-force等)


Hugo website content is **written directly** to `tools/website/content|static` (no separate output hierarchical directories).

---

### 2.7 Common Tips and Notes

#### Environment Variables Quick Reference

```bash
# LLM后端选择
export GADGET_LLM_BACKEND=claude_cli

# 翻译后端选择
export GADGET_TRANSLATION_BACKEND=transformers

# 翻译模型选择
export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF

# 配置文件路径(默认./config.json)
export GADGET_CONFIG=/path/to/custom/config.json

First-time Use Checklist

  • Environment preparation (Python 3.10+, conda/venv)
  • Install dependencies (pip install -e ".[all]")
  • Create config.json (copy from config.example.json)
  • Prepare API keys (placed in config.json or environment variables)
  • Run smoke test (bash scripts/smoke.sh)
  • Select a tool to get started

Troubleshooting Common Issues

# 测试特定工具的导入(无网络、无LLM)
python -c "import summarize; print('OK')"
python -c "import research; print('OK')"

# 查看当前配置
cat config.json

# 重置缓存(如遇cache问题)
rm -rf outputs/cache/

# 检查GPU(仅benchmark)
cd tools/benchmark && python -c "import torch; print(torch.cuda.is_available())"

2.8 AI Companion Integration (Optional)

This project provides the following via the ai-companion repository (located at ../ai-companion/):

  • Code change tracking
  • Claude Code planning/execution skills
  • All domain skills (summarize, optimize, etc.)

No extra configuration is required; it is automatically integrated via hooks. For more in-depth information, see ../ai-companion/scripts/install.ts.


2.9 Quick Start Examples

Scenario 1: Generate this week’s AI conversation weekly report

# 激活环境
conda activate AI

# 启动本地Ollama(如未启动)
eval "$(bash scripts/serve_local_llm.sh env)"

# 导出所有记录并生成周报
python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W35 --deploy

Scenario 2: Search for the latest machine learning papers

conda activate AI
python tools/research/research_scout.py report --project ml-papers --api claude_cli

Scenario 3: Test GPU performance and generate a report

conda activate AI
cd tools/benchmark
python -m benchmark.cli --report

Scenario 4: Start the local document translator

conda activate AI
python -m translator
# 浏览器自动打开 http://localhost:7860

This tutorial covers all key steps to using Gadget from scratch. Depending on your specific needs, select the corresponding tool and use it according to the commands above. If you have any questions, please refer to the TUTORIAL.md and source documentation of each tool.

haiku-4.5 — 8,814 chars · 14/16 facts

Gadget Project Summary and Usage Tutorial

Part 1: Project Summary

Project Introduction

Gadget is an open-source toolset that gathers practical tools accumulated during daily development, covering the following functions:

  • AI conversation daily/weekly/monthly report generation
  • Academic paper discovery and researcher analysis
  • Performance benchmarking (CPU/GPU)
  • Technical blog automation (Hugo)
  • Document translation service

Repository Structure

gadget/
├── tools/              # 5 个独立工具产品
│   ├── summarize/      # AI 对话日/周/月报告
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量压缩+自动发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM/缓存/IO/翻译/Hugo)
├── scripts/            # 运维和维护脚本
├── docs/               # 设计文档和存档
├── outputs/            # 生成的所有产物(.gitignore)
├── AGENTS.md           # AI 代理工作流协议
└── CLAUDE.md           # Claude Code 仓库指南

Detailed Tool Functions

Tool Function Key Technologies
summarize Automatically generates daily/weekly/monthly reports of AI conversations Claude/OpenAI API, multi-source token statistics, matplotlib
research Paper discovery, researcher analysis, citation graphs arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
benchmark Cross-platform CPU/GPU FLOPS performance testing PyTorch, NumPy, Plotly
website Hugo technical blog (incremental media compression + auto-publishing) Hugo, pngquant, HandBrakeCLI
translator Gradio document translator Gradio, local inference (GGUF/transformers)
common Shared infrastructure package used by all tools Unified LLM interface, cache, translation engine, Hugo deployment
scripts Operations scripts (data synchronization, machine initialization, etc.) rclone, Python

Part 2: Detailed Usage Tutorial

I. Environment Preparation

1. System Requirements

  • Python 3.10+ (Recommended to use conda environment AI: conda activate AI)
  • Node.js 18+ (Only for optional AI Companion tools)

2. Basic Installation

# 克隆仓库
git clone <gadget-repo-url>
cd gadget

# 安装 common 包及所有工具依赖
pip install -e ".[all]"

# 如果需要翻译工具,单独安装
pip install -e ".[translator]"

3. Configuration Files

  • Copy from config.example.json to config.json (in the repository root)
  • Place API keys in the tokens/ directory (already .gitignore, will not be committed)
  • Override configuration path: Set environment variable GADGET_CONFIG=/path/to/custom/config.json

If it is a new machine, use the one-click configuration script:

# 编辑机器初始化配置(YAML 格式)
vim tokens/onboard.yaml

# 运行初始化脚本:自动配置 SSH、Claude/Codex 认证、pip 依赖、rclone 等
python scripts/onboard.py

II. Summarize (AI Conversation Daily/Weekly/Monthly Reports)

Function Description

Automatically integrates conversation logs from multiple AI assistants (Claude Code, Codex, ChatGPT, etc.) to generate structured daily, weekly, and monthly reports, and statistics for token usage.

Workflow

Two-phase process:

  1. Phase 1 (Export): Export conversation logs from various devices
  2. Phase 2 (Merge): Sync via cloud drive and merge by date

Typical Commands

# Phase 1: 导出所有未导出日期的对话记录
python -m summarize daily export

# Phase 2: 同步所有日期并逐日合并
python -m summarize daily merge --sync-all

# 生成周报(指定周号)
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成月报(指定月份)
python -m summarize monthly generate --month 2026-02 --deploy

# 一键完整流程:导出 → 合并 → 周报 → 月报 + 自动发布
python -m summarize auto --deploy

LLM Backend Switching

By default, it uses local Ollama (no API key required), but you can also switch to cloud-based backends:

# 使用 Claude Code CLI(无需单独 API 密钥)
python -m summarize daily export --api claude_cli

# 使用 Anthropic API
python -m summarize daily export --api anthropic

# 使用 OpenAI API
python -m summarize daily export --api openai

Detailed Documentation

  • Step-by-step tutorial: TUTORIAL.md#summarize
  • Tool source documentation: tools/summarize/tutorial.md

III. Research (Paper Discovery and Researcher Analysis)

Function Description

An academic research toolset providing four major functions:

  • Paper Discovery: Search arXiv/bioRxiv/PubMed papers (three-stage LLM filtering → deep evaluation → citation impact analysis)
  • Deep Paper Insights: Analyze writing structure, publication strategies, and reusable knowledge
  • Researcher Analysis: Generate research trajectory analysis, tiered scoring, and discover student-mentor relationships
  • Citation Graph Analysis: Forward/backward citation analysis and LLM interpretation

Typical Commands

# 完整流程:搜索 → 三阶段评估 → 生成报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 研究者分析(自动从 ArXiv + Semantic Scholar 获取数据)
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图分析(按 arXiv ID 或 DOI)
python tools/research/research_scout.py citations 2301.12597

# 将所有报告部署到 Hugo 博客
python tools/research/research_scout.py deploy

LLM Backend Switching

Same as the Summarize tool, supporting four backends:

# 使用 Claude CLI
python tools/research/research_scout.py report --project my-project --api claude_cli

# 使用 Anthropic API
python tools/research/research_scout.py report --project my-project --api anthropic

Detailed Documentation

  • Step-by-step tutorial: TUTORIAL.md#research
  • Tool source documentation: tools/research/TUTORIAL.md

IV. Benchmark (CPU/GPU Performance Testing)

Function Description

A cross-platform FLOPS benchmarking tool supporting:

  • GPU: NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU)
  • Precision: FP64, FP32, FP16, BF16, FP8 (experimental)
  • Statistics: Warm-up + formal measurement + median/IQR outlier removal
  • Output: Append to CSV (supports multi-hardware leaderboards) + interactive HTML reports + Hugo deployment

Typical Commands

# 进入工具目录(所有命令都需要)
cd tools/benchmark

# 运行所有基准测试(结果追加到 CSV)
python -m benchmark.cli

# 仅测试 CPU
python -m benchmark.cli --cpu-only

# 仅测试 GPU
python -m benchmark.cli --gpu-only

# 运行测试 + 生成 HTML 报告
python -m benchmark.cli --report

# 运行测试 + 生成报告 + 发布到 Hugo 的 /benchmark/ 目录
python -m benchmark.cli --report --deploy

Detailed Documentation

  • Step-by-step tutorial: TUTORIAL.md#benchmark
  • Tool source documentation: tools/benchmark/tutorial.md

V. Website (Hugo Technical Blog)

Function Description

A Hugo static blog site featuring:

  • Automatic Content Generation: Directly writes blog content from summarize/research/benchmark tools
  • Incremental Media Compression: Since the last build, only compresses changed images (pngquant) and videos (HandBrakeCLI)
  • Local Translation: Uses Ollama (default) or vLLM/transformers for bilingual translation with no cloud calls
  • Automatic Publishing: Automatically pushes to GitHub Pages after building

Installation and Running

# 安装网站工具的依赖(包括 torch 和 transformers)
pip install -e ".[website]"

# macOS/Linux: 增量压缩 + Hugo 构建 + GitHub Pages 推送
cd tools/website && bash update.sh

# Windows: 使用 PowerShell 脚本
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(开发服务器,包含草稿)
cd tools/website && hugo server -D

Important Notes

  • Automatically generated content (daily reports, weekly reports, etc.) is written directly to tools/website/content|static
  • Generated files are marked as gadget_generated; handwritten files will not be overwritten
  • tools/website/public/ is a separate deployment repository, automatically committed and pushed by scripts; do not commit manually
  • Translation defaults to using local inference engines (no cloud LLM API calls)

Detailed Documentation

  • Step-by-step tutorial: TUTORIAL.md#website
  • Tool source documentation: tools/website/CLAUDE.md

VI. Translator (Document Translator)

Function Description

A Gradio web translator based on local inference engines:

  • Supports text and file translation (.md, .txt, .pdf, .docx, images)
  • Preserves Markdown format (code blocks, URLs, Hugo shortcodes, etc.)
  • Local inference, no cloud calls
  • Supports automatic source language detection (based on CJK ratio)
  • Automatically switches between zh↔en when the target language is auto

Installation and Running

# 安装翻译工具依赖(gradio + GGUF 翻译栈)
pip install -e ".[translator]"

# 启动 Gradio GUI(自动打开浏览器)
python -m translator

Environment Variable Configuration

# 指定翻译模型(默认为 tencent/Hy-MT2-1.8B)
export GADGET_TRANSLATION_MODEL=your-model-name

# 指定翻译后端(默认 ollama,其他选项:llamacpp, vllm, transformers)
export GADGET_TRANSLATION_BACKEND=ollama

Automatic Model Download

Upon first use, the default model tencent/Hy-MT2-1.8B will be automatically downloaded (or use GGUF variants).

Detailed Documentation

  • Step-by-step tutorial: TUTORIAL.md#translator

VII. Operations Scripts (Scripts)

Data Synchronization

# 中央化 rclone 数据同步(push/pull/status 等)
python scripts/sync.py

# 配置文件:repo 根目录的 config.json 的 sync 部分
# 覆盖路径:GADGET_CONFIG 环境变量

Health Check

# 轻量级无写入测试(--help / --info / imports,无 LLM 调用)
bash scripts/smoke.sh

Local LLM Service

# 创建 summarize 优化的 Ollama 变体
eval "$(bash scripts/serve_local_llm.sh env)"

Other Scripts

  • language.py: Hugo bilingual audit + report renaming
  • profile_translation.py: Translation engine GPU performance analysis

VIII. Global Configuration

Environment Variables

Environment Variable Description Default Value
GADGET_CONFIG Custom configuration file path config.json
GADGET_LLM_BACKEND LLM backend (global) ollama
GADGET_TRANSLATION_MODEL Translation model tencent/Hy-MT2-1.8B
GADGET_TRANSLATION_BACKEND Translation inference engine ollama

LLM Backend Selection

All tools switch backends uniformly via the --api parameter:| Backend | Description | API Key Required | |——|——|———–| | ollama | Local Ollama server (default, using Gemma4-26B) | ❌ None | | claude_cli | Claude Code CLI (no separate API key needed) | ❌ None | | anthropic | Anthropic API | ✅ Required | | openai | OpenAI API | ✅ Required |

Translation Inference Engine Selection

Specify via GADGET_TRANSLATION_BACKEND (in priority order):

  1. ollama (preferred): Local Ollama server, using gemma4:26b chat model
  2. llamacpp: GGUF low VRAM option
  3. vllm: High-performance inference on Linux
  4. transformers: Alternative for Windows, using tencent/Hy-MT2-1.8B

IX. Quick Reference Cheat Sheet for Common Operations

# 一键启动所有依赖(Python 3.10+ conda 环境)
conda activate AI
pip install -e ".[all]"
pip install -e ".[translator]"

# 快速健康检查
bash scripts/smoke.sh

# 生成日报(最常用)
python -m summarize daily export
python -m summarize daily merge --sync-all

# 启动翻译服务
python -m translator

# 本地预览博客
cd tools/website && hugo server -D

# 查看具体工具帮助
python -m summarize --help
python tools/research/research_scout.py --help
cd tools/benchmark && python -m benchmark.cli --help

X. Complete Getting Started Workflow

# 1. 克隆仓库
git clone <url>
cd gadget

# 2. 创建虚拟环境
conda create -n AI python=3.10
conda activate AI

# 3. 安装依赖
pip install -e ".[all]"
pip install -e ".[translator]"

# 4. 配置(可选但推荐)
cp config.example.json config.json
vim tokens/onboard.yaml
python scripts/onboard.py

# 5. 健康检查
bash scripts/smoke.sh

# 6. 尝试第一个工具(以翻译器为例)
python -m translator

# 7. 查看生成的文件
ls -la outputs/

XI. Output File Organization

All generated artifacts are located in the outputs/ directory (already .gitignore’d):

outputs/
├── logs/        # 中间产物(导出日志、运行日志)
├── reports/     # 最终报告(Markdown、JSON、HTML)
├── cache/       # LLM 缓存、搜索缓存
├── data/        # 结构化数据(CSV、JSON 档案)
├── images/      # 图表和生成的图片
└── backups/     # 强制覆盖备份(website-force 等)

Hugo website content is written directly to tools/website/content|static (no separate outputs/site staging tree).


XII. Important Notes

  • ❌ Do not git add automatically generated content, rclone synced data, build artifacts (build/, gadget.egg-info/), or deployment repositories
  • ✅ All tools manage LLM backends uniformly via the --api parameter
  • ✅ Tokens and API keys are placed in the tokens/ directory (already .gitignore’d)
  • ✅ Local translation and inference involve no cloud calls, protecting privacy
  • ✅ Each tool is independent within its tools/<tool>/ directory and can be used separately

This is the complete English getting started guide for gadget. All commands are sourced from the README or corresponding documentation and can be copied directly for use.

sonnet-4.6 — 5,588 chars · 14/16 facts

I. Project Summary

What is the project?

Gadget is a collection of practical tools accumulated by a developer in daily life, covering five areas: AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each tool is independently available and shares the underlying infrastructure package common/.

Repository Structure

gadget/
├── tools/          # 五个独立工具
│   ├── summarize/  # AI 对话日/周/月报
│   ├── research/   # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/  # CPU/GPU 性能基准
│   ├── website/    # Hugo 博客
│   └── translator/ # Gradio 文档翻译器
├── common/         # 共享基础包(LLM/缓存/翻译/Hugo 部署)
├── scripts/        # 运维脚本(sync.py / onboard.py 等)
├── docs/           # 设计文档、ECL 计划、审计报告
├── outputs/        # 所有生成产物(已 gitignore,可重建)
├── AGENTS.md       # AI 代理工作流协议
├── CLAUDE.md       # Claude Code 仓库指南
└── pyproject.toml  # 打包配置

Tool Functions

Tool Function
summarize Reads AI conversation logs from multiple devices (Claude Code/Codex/Cursor/ChatGPT), calls LLM to generate structured daily/weekly/monthly reports; supports ccusage 20.x for token usage and cost statistics
research Searches for papers from arXiv/bioRxiv/PubMed/Semantic Scholar, features a three-stage LLM evaluation (fast screening → deep assessment → citation impact), supports researcher profiling, citation graph analysis, and deep paper insights
benchmark Cross-platform CPU/GPU FLOPS benchmarking, supports NVIDIA CUDA / Apple MPS / Intel XPU, covers FP64~FP8 precision, appends results to CSV, and can generate Plotly interactive HTML reports
website Hugo static blog (PaperMod theme), built-in incremental image/video compression (pngquant/HandBrakeCLI), local model bilingual translation, automatic build and push to GitHub Pages
translator Gradio-based local document translation Web UI, supports .md/.txt/.pdf/.docx/images, local inference (Ollama preferred), protects code blocks/URLs/Hugo shortcodes from being translated
common Shared layer for all tools: LLM calls, JSON parsing fixes, SHA-256 disk caching, atomic writes, translation engines, and cross-platform Hugo deployment
scripts Operations scripts: sync.py (rclone data sync), onboard.py (one-click configuration for new machines), smoke.sh (smoke tests)

II. Detailed Usage Tutorial

Environment Preparation

Prerequisites:

  • Python 3.10+ (recommended to use conda environment AI)
  • Node.js 18+ (only required for Companion diagrams and DAG publishing)
# 推荐:激活 conda 环境
conda activate AI

First step after cloning the repository — Installing base packages:

# 安装 common 包 + summarize/research/benchmark/website 扩展(不含 translator)
pip install -e ".[all]"

# 如果需要 translator,单独安装
pip install -e ".[translator]"

Configuration file preparation:

Tool settings are stored in config.json at the repository root (already gitignored); start by copying one from the example files:

cp config.example.json config.json
# 然后编辑 config.json 填入你的配置

The configuration file path can be overridden via the GADGET_CONFIG environment variable.

API Keys:

Keys are stored in the tokens/ directory (already gitignored, DO NOT git add).


One-click Configuration for New Machines (Optional)

For a brand new machine, you can use onboard.py to automatically complete SSH configuration, CLI installation and authentication, pip extension installation, and rclone bootstrap:

# 1. 填写配置表
# 编辑 tokens/onboard.yaml

# 2. 运行一次
python scripts/onboard.py

Tool 1: summarize — AI Daily/Weekly/Monthly Reports

LLM Backend Selection

Switch via the --api parameter; four options:

  • ollama (default, local Ollama, no API key needed, uses Gemma4-26B)
  • claude_cli (reuses Claude Code CLI login status, no API key needed)
  • anthropic
  • openai

Typical Usage

Two-stage workflow (multi-device scenario):

# 第一阶段:在每台设备上导出尚未导出的日期
python -m summarize daily export

# 第二阶段:同步所有日期并逐天合并生成日报
python -m summarize daily merge --sync-all

Generate weekly report (and deploy to Hugo):

python -m summarize weekly generate --week 2026-W12 --deploy

Generate monthly report (and deploy to Hugo):

python -m summarize monthly generate --month 2026-02 --deploy

One-click full process (Export → Merge → Weekly Report → Monthly Report + Deploy):

python -m summarize auto --deploy

The old entry point python tools/summarize/daily_summary.py ... is still available (backward compatible), but using the python -m summarize format is recommended.


Tool 2: research — Paper Discovery and Researcher Analysis

Entry script: tools/research/research_scout.py

Typical Usage

Full paper search pipeline (Search → Three-stage evaluation → Generate report):

python tools/research/research_scout.py report --project my-project

Natural language search (automatic data source routing):

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Researcher profile analysis:

python tools/research/research_scout.py profile "Sergey Levine"

Citation graph analysis (pass arXiv ID or DOI):

python tools/research/research_scout.py citations 2301.12597

Deploy report to Hugo:

python tools/research/research_scout.py deploy

All LLM functions also support switching backends via the --api parameter (same four options as summarize).


Tool 3: benchmark — Performance Benchmarking

Note: All commands must first be cd to tools/benchmark/.

cd tools/benchmark

Typical Usage

Run all benchmarks (results appended to CSV, does not overwrite historical data):

python -m benchmark.cli

Test CPU only:

python -m benchmark.cli --cpu-only

Test GPU only:

python -m benchmark.cli --gpu-only

Run tests + generate interactive HTML report:

python -m benchmark.cli --report

Generate report and publish to Hugo /benchmark/:

python -m benchmark.cli --report --deploy

Automatic GPU type detection (NVIDIA CUDA / Apple MPS / Intel XPU), precision coverage: FP64 / FP32 / FP16 / BF16 / FP8 (experimental).


Tool 4: website — Hugo Blog

Install dependencies (includes torch + transformers for translation):

pip install -e ".[website]"

Typical Usage

macOS / Linux — Incremental compression + Hugo build + push to GitHub Pages:

cd tools/website && bash update.sh

Windows — Equivalent PowerShell script:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (development server, includes drafts):

cd tools/website && hugo server -D

tools/website/public/ is an independent deployment repository, automatically committed and pushed by the build script; do not manually commit to this directory.


Tool 5: translator — Gradio Document Translator

Install dependencies:

pip install -e ".[translator]"

Start Gradio Web UI (automatically opens in browser):

python -m translator
  • Supported formats: .md / .txt / .pdf / .docx / images
  • Default model: tencent/Hy-MT2-1.8B (automatically downloaded on first run)
  • Switch models via GADGET_TRANSLATION_MODEL environment variable or within the GUI model management
  • When source language is set to auto, it auto-detects based on CJK ratio; when target language is set to auto, it auto-switches between zh↔en

Data Synchronization (Multi-device)

# 推送本地数据到云端
python scripts/sync.py push

# 从云端拉取数据
python scripts/sync.py pull

# 查看同步状态
python scripts/sync.py status

Requires rclone to be configured in advance (can be completed automatically via scripts/onboard.py).


Smoke Test (Verify installation is normal)

Perform read-only smoke checks on all tools (no LLM calls, no network, no writes):

bash scripts/smoke.sh

Global Environment Variable Cheat Sheet

Variable Purpose Default Value
GADGET_CONFIG Overrides config.json path Repository root config.json
GADGET_LLM_BACKEND Globally switch LLM backend ollama
GADGET_TRANSLATION_BACKEND Switch translation inference engine ollama
GADGET_TRANSLATION_MODEL Overrides translation model tencent/Hy-MT2-1.8B
opus-4.6 — 4,660 chars · 15/16 facts

Gadget Project Summary

What it is

Gadget is a collection of practical tools accumulated during daily development, covering five major functions: AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each tool is independently available, with shared infrastructure unified in the common/ package.

Repository Structure

Directory Role
tools/summarize/ AI conversation daily/weekly/monthly report generation
tools/research/ Paper discovery + Scholar analysis + Citation graph
tools/benchmark/ CPU/GPU performance benchmarking
tools/website/ Hugo blog (incremental media compression + automatic build & publish)
tools/translator/ Gradio document translator
common/ Shared infrastructure package (LLM calls, cache, IO, translation, Hugo deployment)
scripts/ Operations scripts (data synchronization, new machine configuration, etc.)
docs/ Design documents, audit reports
outputs/ All generated artifacts (gitignored)

Tool Functions

  • Summarize: Reads AI conversation logs from multiple platforms (Claude Code / Codex / Cursor / ChatGPT, etc.) and generates structured daily, weekly, and monthly reports via LLM. Supports multi-device aggregation and uses ccusage 20.x to statistics token usage and costs. Four LLM backends: ollama (default), claude_cli, anthropic, openai.
  • Research: A unified academic research toolkit—paper searching (arXiv/bioRxiv/PubMed, three-stage LLM filtering), deep paper insights (full-text analysis + OpenReview reviews), scholar profiling (paper/citation data + mentor-student relationship discovery), and citation graph analysis.
  • Benchmark: Cross-platform CPU/GPU FLOPS benchmarking, supporting NVIDIA CUDA / Apple MPS / Intel XPU, multiple precisions (FP64/FP32/FP16/BF16/FP8), results appended to CSV, can generate Plotly interactive HTML reports and deploy them to Hugo.
  • Website: Hugo static blog, featuring a built-in incremental image/video compression pipeline (pngquant + HandBrakeCLI) and local model bilingual translation (default Ollama, translation model tencent/Hy-MT2-1.8B is automatically downloaded on first run), with automatic build and push to GitHub Pages.
  • Translator: A Gradio-based local document translation web interface, supporting .md/.txt/.pdf/.docx/images, preserving Markdown formatting, performing local inference without calling cloud APIs, and automatically selecting backends (ollama/transformers/vllm/llamacpp).
  • common/: The shared layer for all tools—unified LLM calls (four backends), JSON parsing fixes, SHA-256 disk caching, atomic writes, local translation engine, and Hugo deployment.
  • scripts/: sync.py (rclone data sync), onboard.py (one-click new machine configuration), smoke.sh (read-only smoke tests), serve_local_llm.sh (Ollama variant creation), etc.

Gadget User Guide

I. Environment Preparation

  1. Python 3.10+, conda environment recommended:

    conda activate AI
    
  2. Node.js 18+ (only required for Companion graphs and DAG publishing, optional)

  3. Tool-specific dependencies: Each tool directory contains requirements.txt

II. Installation

After cloning the repository, install the shared package in the repository root:

# 安装 common 包 + summarize/research/benchmark/website 的依赖
pip install -e ".[all]"

# translator 需要单独安装
pip install -e ".[translator]"

# 或只装 website 相关
pip install -e ".[website]"

III. Configuration

  • Tool configurations are located in the repository root at config.json (gitignored); copy from config.example.json:

    cp config.example.json config.json
    

    The path can be overridden via the GADGET_CONFIG environment variable.

  • API keys and configurations are placed in the tokens/ directory (gitignored, do not commit).

  • LLM backends are switched uniformly via the --api parameter: ollama (default, keyless), claude_cli (reuses Claude Code login state), anthropic, openai. Can also be set globally via the GADGET_LLM_BACKEND environment variable.

  • Translation backends are selected via GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers.

One-click Configuration for New Machines

Fill in tokens/onboard.yaml, then run:

python scripts/onboard.py

to automatically complete SSH configuration, CLI installation authentication, pip dependencies, tool configuration, and rclone onboarding.

IV. Using Each Tool

1. Summarize — AI Conversation Daily/Weekly/Monthly Reports

# 阶段一:导出所有未导出的日期
python -m summarize daily export

# 阶段二:同步所有日期并逐日合并
python -m summarize daily merge --sync-all

# 生成周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流程:导出 → 合并 → 周报 → 月报 + 部署
python -m summarize auto --deploy

2. Research — Paper Discovery and Scholar Analysis

# 全流程:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 学者画像
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图谱(arXiv ID 或 DOI)
python tools/research/research_scout.py citations 2301.12597

# 部署报告到 Hugo
python tools/research/research_scout.py deploy

3. Benchmark — Performance Benchmarking

Note: All commands require you to first cd into tools/benchmark/.

cd tools/benchmark

# 运行所有基准测试(结果追加到 CSV)
python -m benchmark.cli

# 仅 CPU
python -m benchmark.cli --cpu-only

# 仅 GPU
python -m benchmark.cli --gpu-only

# 运行测试 + 生成 HTML 报告
python -m benchmark.cli --report

# 生成报告 + 部署到 Hugo
python -m benchmark.cli --report --deploy

4. Website — Hugo Blog

# 安装依赖
pip install -e ".[website]"

# macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
cd tools/website && bash update.sh

# Windows
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(含草稿)
cd tools/website && hugo server -D

5. Translator — Gradio Document Translator

# 安装依赖
pip install -e ".[translator]"

# 启动 Gradio 界面(自动打开浏览器)
python -m translator

Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), which is automatically downloaded on first use. You can switch via the GADGET_TRANSLATION_MODEL environment variable or the in-interface model management. Source language supports auto (detected by CJK ratio), and when the target language is auto, it automatically flips between Chinese and English.

V. Operations Scripts

# 数据同步(push/pull/status/bootstrap/config)
python scripts/sync.py

# 只读冒烟测试(不需要 LLM/网络/写入)
bash scripts/smoke.sh

# 创建 summarize 专用 Ollama 变体并输出环境变量
eval "$(bash scripts/serve_local_llm.sh env)"

VI. Important Notes

  • The tokens/ directory stores API keys and is gitignored; never commit it.
  • outputs/ stores all generated artifacts and is gitignored; it can be automatically rebuilt.
  • Do not git add automatically generated content, rclone synchronized data, build artifacts (build/, gadget.egg-info/), or deployment/theme repositories under tools/website/.
  • GPU benchmarking automatically detects CUDA / Apple MPS / Intel XPU.
  • The project uses the GPL-3 license.
sonnet-5 — 4,407 chars · 15/16 facts

Project Summary

Gadget is a collection of practical tools accumulated during daily development, covering five major scenarios: AI conversation daily report generation, paper discovery, performance benchmarking, blog automation, and document translation.

Repository Structure

gadget/
├── tools/          # 五个独立工具
│   ├── summarize/  # AI对话日/周/月报
│   ├── research/   # 论文发现+研究者分析+引用图
│   ├── benchmark/  # CPU/GPU性能跑分
│   ├── website/    # Hugo博客(增量媒体压缩+自动构建发布)
│   └── translator/ # Gradio文档翻译器
├── common/         # 共享基础设施包(LLM调用/缓存/IO/翻译/Hugo部署),所有工具依赖
├── scripts/        # 运维脚本(sync.py、onboard.py、language.py等)
├── docs/           # 设计文档、历史存档
├── outputs/        # 所有生成产物(已gitignore,可重建)
├── AGENTS.md       # AI agent工作协议
└── pyproject.toml  # 打包配置

What Each Tool Does

  • summarize: Reads local AI conversation logs (Claude Code/Codex/Cursor/ChatGPT), calls LLM to generate structured daily/weekly/monthly reports, supports multi-device synchronization and aggregation, and uses ccusage to statistics token usage and costs for each CLI.
  • research: Provides paper searching (arXiv/bioRxiv/PubMed), deep paper interpretation (including OpenReview review matching), researcher profiling (mentor-student relationship inference), and citation graph analysis (Semantic Scholar) through a single entry point at research_scout.py.
  • benchmark: Cross-platform CPU/GPU FLOPS benchmarking, supporting NVIDIA/Apple Silicon/Intel, multiple precisions (FP64~FP8), results are accumulated into CSV, and can generate Plotly interactive reports published to Hugo.
  • website: Hugo static blog site (PaperMod theme), featuring built-in incremental image/video compression (pngquant/HandBrakeCLI) and local model bilingual translation, with automatic build and push to GitHub Pages.
  • translator: A Gradio web-based document translator based on the common translation engine, preserving Markdown formatting and supporting local model inference (Ollama/vLLM/transformers/GGUF).

All LLM functions switch backends uniformly via --api: ollama (default, local keyless), claude_cli, anthropic, openai.


User Guide

I. Environment Preparation

  • Python 3.10+ (conda environment AI recommended: conda activate AI)
  • Node.js 18+ (only required for optional features like Companion graphs/DAG publishing)
  • It is recommended to use local Ollama as the default LLM backend (no API key required)

II. Installation

# 克隆仓库后,在仓库根目录执行

# 安装共享包 + summarize/research/benchmark/website 四个工具的依赖
pip install -e ".[all]"

# translator 需单独安装(all 不包含它)
pip install -e ".[translator]"

III. Configuration

# 复制配置模板
cp config.example.json config.json

Then edit config.json (gitignored, will not be committed). The configuration file path can be overridden using the GADGET_CONFIG environment variable.

For a brand new machine, you can use the one-time onboarding script to automatically complete SSH, Claude/Codex CLI login, pip extras, rclone, and other configurations:

# 先填好 tokens/onboard.yaml,再运行
python scripts/onboard.py

IV. Typical Usage for Each Tool

1. Summarize (AI Conversation Daily/Weekly/Monthly Reports)

python -m summarize daily export                                   # 阶段1:导出所有未导出日期的对话记录
python -m summarize daily merge --sync-all                         # 阶段2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 生成周报并部署
python -m summarize monthly generate --month 2026-02 --deploy      # 生成月报并部署
python -m summarize auto --deploy                                  # 一键全流程:导出→合并→周报→月报+部署

2. Research (Paper Discovery/Researcher Analysis)

python tools/research/research_scout.py report --project my-project        # 完整流程:搜索→三阶段评估→生成报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图分析(arXiv ID/DOI)
python tools/research/research_scout.py deploy                              # 部署报告到 Hugo

3. Benchmark (Performance Benchmarking)

# 注意:所有命令需先 cd 到 tools/benchmark/
cd tools/benchmark
python -m benchmark.cli                     # 运行全部跑分(结果追加到CSV)
python -m benchmark.cli --cpu-only          # 仅CPU
python -m benchmark.cli --gpu-only          # 仅GPU
python -m benchmark.cli --report            # 运行跑分+生成HTML报告
python -m benchmark.cli --report --deploy   # 生成报告并发布到 Hugo /benchmark/

4. Website (Hugo Blog)

pip install -e ".[website]"                          # 安装依赖(含torch+transformers用于翻译)

# macOS/Linux:增量压缩+Hugo构建+推送Pages
cd tools/website && bash update.sh

# Windows(脚本会自动cd到自身目录)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(开发服务器,包含草稿)
cd tools/website && hugo server -D

5. Translator (Document Translator)

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF翻译栈)
python -m translator             # 启动Gradio网页界面(自动打开浏览器)

V. Operations Scripts

python scripts/sync.py            # rclone跨设备数据同步(push/pull/status/bootstrap/config)
python scripts/onboard.py         # 一次性机器配置
bash scripts/smoke.sh             # 只读全工具烟雾测试(--help/--info/imports,无网络无写入)
eval "$(bash scripts/serve_local_llm.sh env)"   # 创建summarize专用Ollama变体并打印环境变量

VI. Important Notes

- tokens/ directory stores API keys and onboarding forms; it is gitignored, do not commit.
  • All generated files are output to the outputs/ directory; it is gitignored.
  • The translation backend is controlled by GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers
  • Do not git add auto-generated content, rclone data synchronization, build artifacts (build/, gadget.egg-info/), or the deployment/theme repositories under tools/website/
  • License is GPL-3

For more detailed step-by-step instructions, refer to TUTORIAL.md in the repository and tutorial.md/CLAUDE.md under each tool directory.

opus-4.7 — 5,138 chars · 15/16 facts

Gadget Project Summary and Usage Tutorial

I. Project Summary

What it is: A collection of practical tools accumulated during daily development, covering AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation.

Repository Structure:

gadget/
├── tools/          # 五个独立工具
│   ├── summarize/  # AI 对话日/周/月报
│   ├── research/   # 论文发现 + 学者分析 + 引用图
│   ├── benchmark/  # CPU/GPU 性能基准
│   ├── website/    # Hugo 博客(增量压缩 + 自动构建发布)
│   └── translator/ # Gradio 文档翻译器
├── common/         # 共享基础设施包(LLM/缓存/IO/翻译/Hugo 部署)
├── scripts/        # 运维脚本(sync.py / onboard.py / smoke.sh 等)
├── docs/           # 设计文档、ECL 计划、历史归档
├── outputs/        # 所有生成产物(gitignore)
├── AGENTS.md / CLAUDE.md
└── pyproject.toml

What each tool does:

Tool Function
summarize Reads AI conversation logs from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, uses LLM to generate structured daily/weekly/monthly reports; uses ccusage 20.x to statistics token usage and costs across CLIs; multi-device two-stage architecture (export → aggregate/merge)
research Unified academic research CLI (research_scout.py), four core capabilities: paper discovery (arXiv/bioRxiv/PubMed three-stage LLM pipeline), deep paper insights (--insight, including OpenReview review matching), scholar profiling (ArXiv + Semantic Scholar, including mentor-student relationship discovery), and citation graph analysis
benchmark Cross-platform CPU/GPU FLOPS benchmarking (NVIDIA CUDA / Apple MPS / Intel XPU; FP64/FP32/FP16/BF16/FP8), results appended to CSV, can generate Plotly interactive HTML reports and deploy to Hugo
website Hugo static blog (PaperMod theme, deployed to GitHub Pages), built-in incremental image/video compression (pngquant + HandBrakeCLI) and local model bilingual translation
translator Gradio-based local translation web page based on common translation engine, supports .md/.txt/.pdf/.docx/images, preserves Markdown format, local inference without cloud APIs
common/ Shared packages: LLM calls (unified API for four backends), JSON repair, SHA-256 disk cache, atomic writes, local translation engine, Hugo deployment
scripts/ sync.py (rclone cross-device sync), onboard.py (one-click initialization for new machines), smoke.sh (read-only smoke tests), serve_local_llm.sh, language.py, profile_translation.py

II. Usage Tutorial

1. Environment Preparation

  • Python 3.10+ (recommended conda environment AI : conda activate AI)
  • Node.js 18+ (only required for optional Companion graph / DAG publishing tools)
  • rclone is required for cross-device data synchronization

2. Installation

# 基础 + summarize/research/benchmark/website 全部 extras(不含 translator)
pip install -e ".[all]"

# translator 需单独装
pip install -e ".[translator]"

# website 单独装(含 torch + transformers 翻译)
pip install -e ".[website]"

3. Configuration

  • Tool configurations are written in config.json at the repository root (gitignored, copy from config.example.json). Use GADGET_CONFIG environment variables to override paths.
  • API Keys and onboarding tables are in the tokens/ directory (gitignored).
  • LLM backends are switched via --api: ollama (default, local no-key, Gemma4-26B) / claude_cli (reuses Claude Code CLI login state) / anthropic / openai; also can be set globally via GADGET_LLM_BACKEND environment variable.
  • Translation backends are switched via GADGET_TRANSLATION_BACKEND: ollama (default, reuses gemma4:26b) → llamacpp / vllm / transformers (uses tencent/Hy-MT2-1.8B, automatic download on first use). Translation models can be overridden via GADGET_TRANSLATION_MODEL.

One-click Initialization for New Machines

# 填好 tokens/onboard.yaml 后运行
python scripts/onboard.py

Automatically completes SSH configuration, Claude/Codex CLI installation and authentication, pip extras, configuration for each tool, and rclone bootstrap.

Smoke Testing

bash scripts/smoke.sh

4. Usage of Each Tool

Summarize — AI Conversation Daily/Weekly/Monthly Reports

# Phase 1:导出所有未导出日期
python -m summarize daily export

# Phase 2:同步所有日期并逐日合并
python -m summarize daily merge --sync-all

# 周报 + 部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 月报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流水线:导出 → 合并 → 周 → 月 + 部署
python -m summarize auto --deploy

Old entry points like python tools/summarize/daily_summary.py are still available (backward compatible shim), but the new format python -m summarize is recommended.

Local LLM variants (optional):

eval "$(bash scripts/serve_local_llm.sh env)"

Research — Paper Discovery and Scholar Analysis

# 完整流水线:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 学者画像
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图(按 arXiv ID / DOI)
python tools/research/research_scout.py citations 2301.12597

# 把报告部署到 Hugo
python tools/research/research_scout.py deploy

All LLM functions can be added with --api ollama|claude_cli|anthropic|openai.

Benchmark — Performance Benchmarking

cd tools/benchmark

python -m benchmark.cli                   # 跑全部(结果追加到 CSV)
python -m benchmark.cli --cpu-only        # 只跑 CPU
python -m benchmark.cli --gpu-only        # 只跑 GPU
python -m benchmark.cli --report          # 跑完生成 HTML 报告
python -m benchmark.cli --report --deploy # 生成报告并发布到 Hugo /benchmark/

All commands must first be cd tools/benchmark/.

Website — Hugo Blog

pip install -e ".[website]"

# macOS / Linux:增量压缩 + Hugo 构建 + 推送 Pages
cd tools/website && bash update.sh

# Windows
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(含草稿)
cd tools/website && hugo server -D

tools/website/public/ is an independent deployment repository; scripts commit and push automatically, do not manually git add.

Translator — Gradio Document Translator

pip install -e ".[translator]"
python -m translator          # 启动 Gradio GUI(浏览器自动打开)

Source language can be set to auto (detected by CJK ratio); when target is set to auto, it flips between zh↔en. Default model is tencent/Hy-MT2-1.8B, automatic download on first use.

Cross-device Data Synchronization

python scripts/sync.py push       # 推
python scripts/sync.py pull       # 拉
python scripts/sync.py status
python scripts/sync.py bootstrap
python scripts/sync.py config

Configured in the sync section of config.json.


5. Precautions

  • Generated artifacts are all in outputs/ (logs/ / reports/ / cache/ / data/ / images/ / backups/), and are gitignored.
  • Hugo content is written directly to tools/website/content|static; only files with gadget_generated markers will be overwritten; manually written files will not be touched.
  • Do not git add: auto-generated content, rclone data synchronization, build/, gadget.egg-info/, or the deployment and theme repositories under tools/website/.
  • License is GPL-3.
opus-4.8 — 6,270 chars · 16/16 facts

I. Project Summary

What is this

Gadget is a collection of practical tools accumulated during daily development, packaged with Python (GPL-3 license). It covers five major capabilities: AI conversation daily/weekly/monthly report generation, paper discovery and researcher analysis, hardware performance benchmarking, Hugo blog automation, and document translation. The design philosophy is: each directory under tools/ is a tool that can be used independently, while common capabilities (LLM calls, JSON parsing, disk cache, atomic writes, translation, Hugo deployment) are centralized in the common/ package at the repository root, installed via pip install -e ..

Repository Structure

Directory/File Role
tools/summarize/ AI conversation daily/weekly/monthly reports (multi-device two-stage architecture)
tools/research/ Paper discovery + researcher analysis + citation graphs
tools/benchmark/ Cross-platform CPU/GPU performance benchmarks
tools/website/ Hugo blog (incremental media compression + automatic build and publish)
tools/translator/ Gradio document translator
common/ Shared infrastructure package used by all tools
scripts/ Operations/maintenance scripts (sync.py, onboard.py, language.py, profile_translation.py, etc.)
docs/ Design documents, ECL plans, audit reports, historical archives
outputs/ All generated artifacts (gitignore, rebuildable)
AGENTS.md Working protocols for all AI agents
CLAUDE.md Claude Code repository guide
pyproject.toml common/ and packaging configurations for each tool

Additionally, ../ai-companion/ (an independent sibling repository) provides optional DAG publishing tools.

What each tool does

  • Summarize: Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM to generate structured daily/weekly/monthly summaries. Multi-device workflow: export conversation logs from each device → sync via cloud drive or manual aggregation → generate daily reports → accumulate to generate weekly reports and monthly trends. Uses ccusage 20.x source-specific commands to automatically statistics token usage and costs for each agent CLI. Four backends: ollama (default, local no-key), claude_cli, anthropic, openai, switched via --api.- Research: A unified academic research tool with a single entry point research_scout.py. Four core capabilities: ① Paper discovery (arXiv/bioRxiv/PubMed, three-stage LLM pipeline: fast screening → deep evaluation → citation impact, generates research weekly reports and deploys to Hugo); ② Deep paper insights (--insight, download full text, analyze writing structure, match OpenReview reviews); ③ Researcher profiling (ArXiv + Semantic Scholar, research trajectory analysis, hierarchical scoring, mentor-student relationship discovery); ④ Citation graph analysis (forward citations/backward references based on Semantic Scholar API).

  • Benchmark: Cross-platform CPU/GPU FLOPS benchmarking. Supports actual execution on NVIDIA(CUDA), Apple Silicon(MPS), and Intel(XPU), covering FP64/FP32/FP16/BF16/FP8 (experimental). Uses warm-up + formal measurement + statistical analysis (median, IQR for outlier removal); results are written to CSV in append mode (naturally supporting multi-hardware cumulative leaderboards), can generate Plotly interactive HTML reports for deployment and submission to public leaderboards.

  • Website: Hugo static blog (“TzJ’s Net”, PaperMod theme, deployed to GitHub Pages). Built-in incremental image/video compression (only processes media changed since .last_build: images via pngquant, videos via HandBrakeCLI) and local model bilingual translation (default Ollama; uses vLLM for Linux and transformers as a fallback for Windows; model tencent/Hy-MT2-1.8B is automatically downloaded on first run). Automatically generated content is written directly to tools/website/content|static; only files with gadget_generated tags will be overwritten, while hand-written files remain untouched. tools/website/public/ is an independent deployment repository, automatically committed and pushed by build scripts; do not commit to it directly.

  • Translator: A Gradio-based document translator powered by the common translation engine, similar to a local version of Google Translate. Translates text and files (.md/.txt/.pdf/.docx/images), preserving Markdown formatting (code blocks, URLs, and Hugo shortcodes are protected). Uses local inference instead of cloud APIs, with automatic engine selection (Ollama preferred / transformers fallback for Windows / vLLM preferred for Linux / llamacpp as a low-VRAM GGUF option); models reside in memory. Default model is tencent/Hy-MT2-1.8B, can be overridden via GADGET_TRANSLATION_MODEL.

  • common/: The shared layer, providing a unified two-level LLM API (four backends), JSON parsing fixes, SHA-256 disk caching (namespace + TTL), atomic writes with content hashing, local inference translation engine, and cross-platform Hugo deployment.

  • scripts/: sync.py (rclone data synchronization: push/pull/status/bootstrap/config, including special dag categories); onboard.py (one-time new machine configuration); smoke.sh (read-only smoke tests); serve_local_llm.sh (creates a dedicated summarize Ollama variant); language.py, profile_translation.py.


II. Detailed Tutorial (For Beginners)

1. Environment Preparation

  • Python 3.10+ (recommended to use conda environment AI):
    conda activate AI
    
  • Node.js 18+ (only required for optional Companion graph / DAG publishing tools)
  • For specific dependencies of each tool, see the corresponding directory’s requirements.txt
  • website/translation functions use a local inference engine (default Ollama, use gemma4:26b; Linux uses vLLM, Windows uses transformers as fallback, use tencent/Hy-MT2-1.8B, automatically downloads on first run)

2. Installation

Install the common package + extras for summarize/research/benchmark/website:

pip install -e ".[all]"

Note: all does not include translator, which must be installed separately:

pip install -e ".[translator]"

Translation dependencies for website (includes torch + transformers):

pip install -e ".[website]"

Executing pip install -e . will generate build/ and gadget.egg-info/ (already gitignored) in the repository root.

3. Configuration

  • Tool settings are located in config.json at the repository root (gitignored, copied from config.example.json). Use GADGET_CONFIG to override paths.
  • The tokens/ directory stores API keys and onboarding tables (gitignored, do not commit).
  • LLM backends are unified and switched via --api: ollama (default), claude_cli, anthropic, openai; can also be set globally via environment variable GADGET_LLM_BACKEND.
  • The backend for translation paths is selected via GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers.

One-time configuration for new machines (after filling in tokens/onboard.yaml):

python scripts/onboard.py

Cross-device data synchronization (requires rclone configuration):

python scripts/sync.py        # 查看/运行同步

Full-tool read-only smoke test (does not touch LLM/network/writes):

bash scripts/smoke.sh

4. Typical Usage for Each Tool

Summarize

python -m summarize daily export                              # 阶段1:导出所有未导出的日期
python -m summarize daily merge --sync-all                    # 阶段2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy  # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy # 月报 + 部署
python -m summarize auto --deploy                             # 一键全流程:导出→合并→周报→月报 + 部署

The old entry point python tools/summarize/daily_summary.py ..., etc., is still compatible, but the above python -m summarize format is recommended.

Research

python tools/research/research_scout.py report --project my-project        # 全流程:搜索→三阶段评估→报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由来源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

Use --insight for deep paper insights. All LLM functions support switching backends via --api.

Benchmark

cd tools/benchmark                         # 注意:所有命令都要先 cd 进该目录
python -m benchmark.cli                     # 跑全部基准(结果追加到 CSV)
python -m benchmark.cli --cpu-only          # 仅 CPU
python -m benchmark.cli --gpu-only          # 仅 GPU
python -m benchmark.cli --report            # 跑基准 + 生成 HTML 报告
python -m benchmark.cli --report --deploy   # 生成报告 + 发布到 Hugo /benchmark/

(Hardware detection is available via --info.)

Website

pip install -e ".[website]"                          # 安装依赖(含翻译用 torch + transformers)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本自己会 cd 到所在目录)
cd tools/website && hugo server -D                   # 本地预览(含草稿的开发服务器)

Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(浏览器打开)

5. Output and Precautions

  • All generated products are in outputs/ (gitignored, can be rebuilt): logs/ intermediate products, reports/ final reports, cache/ cache, data/ structured data, images/ charts, backups/ backups. Hugo site content is written directly to tools/website/content|static.
  • Do not git add automatically generated content, rclone synchronized data, build products (build/, gadget.egg-info/), or deployment/theme repositories under tools/website/.

Note: Everything above is from the README; I have not fabricated any unmentioned commands/parameters (such as TUTORIAL.md or details in each tool’s source documentation). For step-by-step operations, data formats, and FAQs for each tool, please refer to the TUTORIAL.md pointed to by the README and the respective tool’s built-in documentation.

sonnet-5.5 — 7,112 chars · 16/16 facts

Part I: Project Summary

1. What it is

Gadgets is a set of practical tools accumulated by the author during daily development, covering five areas: AI chat daily/weekly/monthly report generation, paper discovery and researcher analysis, CPU/GPU performance benchmarking, Hugo blog automation, and document translation.

  • Each directory under tools/ is an independent tool that can be used separately.
  • Common capabilities are placed in the common/ package in the repository root (installed via pip install -e .), providing LLM calls, JSON parsing fixes, disk caching, atomic writes, translation, Hugo deployment, etc.
  • Optional Companion graph/planning tools are available locally; DAG publishing is provided by the sibling repository ../ai-companion/. Coding Agents follow AGENTS.md and do not pass through Companion interception.
  • Licensed under GPL-3.

2. Repository Structure

gadget/
├── tools/        # 五个独立工具
│   ├── summarize/  research/  benchmark/  website/  translator/
├── common/       # 共享基础设施包
├── scripts/      # 运维脚本(sync.py、onboard.py、language.py、profile_translation.py 等)
├── docs/         # 设计文档、ECL 计划、审计报告、归档
├── outputs/      # 所有生成产物(gitignore,可重建)
├── AGENTS.md     # AI Agent 工作流协议
├── CLAUDE.md     # Claude Code 仓库指南
└── pyproject.toml

build/ and gadget.egg-info/ are generated by pip install -e . (already ignored).

3. What each tool does

Tool Function
summarize Reads chat logs from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, calls LLM to generate daily/weekly/monthly reports; multi-device two-stage process (export → merge); uses ccusage 20.x to statistics tokens and costs
research Unified entry point research_scout.py: paper discovery (arXiv/bioRxiv/PubMed, three-stage LLM pipeline), --insight deep paper insights, researcher profiling (including mentor-student relationship discovery), citation graph analysis (Semantic Scholar)
benchmark Cross-platform CPU/GPU FLOPS testing, supports CUDA / MPS / XPU, precision FP64/FP32/FP16/BF16/FP8 (experimental); results appended to CSV, can generate Plotly HTML reports and leaderboards
website Hugo blog (PaperMod theme, deployed to GitHub Pages); incremental compression of images (pngquant) and videos (HandBrakeCLI); local model bilingual translation
translator Gradio local translation web page, supports text and .md/.txt/.pdf/.docx/图片, protects code blocks, URLs, and Hugo shortcodes; default model is tencent/Hy-MT2-1.8B
common Shared package (see above)
scripts sync.py (rclone sync), onboard.py (one-time configuration for new machines), smoke.sh (read-only smoke check), serve_local_llm.sh (create Ollama variants), etc.

Part 2: Usage Tutorial

Note: The following commands are all from README. I will not fabricate details not written in README (such as specific API Key environment variable names or individual fields in config.json); instead, I will mark them as “please refer to the corresponding documentation”.

I. Environment Preparation

  • Python 3.10+, conda environment AI is recommended:
    conda activate AI
    
  • Node.js 18+: Only required when using the optional Companion graph / DAG publishing tools.
  • For specific dependencies of each tool, see requirements.txt in their respective directories.
  • Prepare external programs as needed:
    • The default LLM backend requires local Ollama (default chat model gemma4:26b).
    • website requires Hugo, pngquant, and HandBrakeCLI.
    • Cross-device synchronization requires rclone.
    • summarize usage statistics depend on ccusage 20.x.

II. Installation

Execute in the repository root:

# common 包 + summarize / research / benchmark / website 全部 extras
pip install -e ".[all]"

# translator 不包含在 all 里,需单独安装
pip install -e ".[translator]"

# 只装 website 依赖(含翻译用的 torch + transformers)
pip install -e ".[website]"

After installation, you can perform a read-only smoke test (no LLM calls, no internet, no file writing):

bash scripts/smoke.sh

III. Configuration

  1. Tool Configuration: The root directory config.json (already gitignored), copy from config.example.json:
    cp config.example.json config.json
    
    The environment variable GADGET_CONFIG can be used to specify other paths. For specific fields, please see config.example.json.
  2. Keys: The tokens/ directory stores API Keys and onboarding tables; it is gitignored, do not commit.
  3. LLM Backend: Add --api ollama|claude_cli|anthropic|openai to each command, or set globally:
    export GADGET_LLM_BACKEND=claude_cli
    
  4. Translation Backend: GADGET_TRANSLATION_BACKEND offers options such as ollama(default), llamacpp, vllm, transformers; the translation model can be overridden using GADGET_TRANSLATION_MODEL.
  5. Local LLM Fine-tuning (optional):
    eval "$(bash scripts/serve_local_llm.sh env)"
    
    Persistent parameters are written in the summarize section of config.json.
  6. One-click Configuration for New Machines: Fill in tokens/onboard.yaml, then run once:
    python scripts/onboard.py
    
    It will configure SSH, Claude/Codex CLI installation and authentication, pip extras, tool configurations, and rclone bootstrap.

IV. Typical Usage of Each Tool

1. Summarize: Daily / Weekly / Monthly Reports

python -m summarize daily export                               # 阶段1:导出所有未导出日期
python -m summarize daily merge --sync-all                     # 阶段2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy   # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy  # 月报 + 部署
python -m summarize auto --deploy                              # 全流程:导出→合并→周报→月报 + 部署
  • Multi-device workflow: Each device exports its own data, synchronizes via cloud drives or manual copying for aggregation, and then merges them to generate daily reports.
  • Switching backends: Append --api claude_cli etc. (README notes that --api is universal for LLM functions).
  • Old entries python tools/summarize/daily_summary.py ..., weekly_summary.py, and monthly_summary.py are still available, but the new syntax is recommended.
  • Detailed documentation: TUTORIAL.md#summarize, tools/summarize/tutorial.md.

2. Research: Paper and Researcher Analysis

python tools/research/research_scout.py report --project my-project       # 全流程:搜索→三阶段评估→报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索
python tools/research/research_scout.py profile "Sergey Levine"            # 研究者画像
python tools/research/research_scout.py citations 2301.12597              # 引用图(arXiv ID / DOI)
python tools/research/research_scout.py deploy                             # 部署报告到 Hugo
  • --insight can perform deep analysis of full papers (including OpenReview reviews), but the README does not provide the complete command; please refer to tools/research/TUTORIAL.md.
  • Similarly supports switching backends via --api.

3. Benchmark: Performance Benchmarking

All commands must first enter tools/benchmark/:

cd tools/benchmark
python -m benchmark.cli                    # 运行全部测试(结果追加到 CSV)
python -m benchmark.cli --cpu-only         # 只测 CPU
python -m benchmark.cli --gpu-only         # 只测 GPU
python -m benchmark.cli --report           # 测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告并发布到 Hugo 的 /benchmark/
  • Results are written to CSV in an append mode and will not be overwritten, making it suitable for accumulating leaderboards across multiple machines.
  • README mentions that --info can be used for hardware detection (OpenCL will only appear within it); see tools/benchmark/tutorial.md for full usage.

4. Website: Hugo Blog

pip install -e ".[website]"                                          # 安装依赖
cd tools/website && bash update.sh                                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1    # Windows
cd tools/website && hugo server -D                                   # 本地预览(含草稿)

Note:

  • Only compresses media files that have changed since .last_build.
  • Translation uses local models; the first run will automatically download tencent/Hy-MT2-1.8B.
  • Automatically generated content carries the gadget_generated tag; handwritten files without this tag will not be overwritten.
  • tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed and pushed by build scripts; do not commit manually.

5. Translator: Gradio Translator

pip install -e ".[translator]"
python -m translator

A local webpage will open in your browser.

  • Supports text and .md/.txt/.pdf/.docx/图片, preserving Markdown format.
  • Source language can be set to auto (detected by CJK ratio); when the target language is auto, it automatically switches between Chinese ↔ English.
  • The default model is automatically downloaded upon first use; you can change it via GADGET_TRANSLATION_MODEL or the model management within the interface.

6. Data Synchronization (scripts/sync.py)

python scripts/sync.py
  • Supports push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories, with an additional special dag category.
  • Configuration is located in the sync section of config.json, and rclone must be configured first.
  • Specific usage mentioned in README includes python scripts/sync.py push/pull and python scripts/sync.py --category dag.

V. Output Locations

All artifacts are located in outputs/ (already gitignored, can be rebuilt): logs/, reports/, cache/, data/, images/, backups/. Hugo site content is written directly to tools/website/content|static.

VI. Precautions

  • Do not git add automatically generated content, rclone synchronized data, build/, gadget.egg-info/, as well as the deployment and theme repositories under tools/website/.
  • Do not commit the contents of tokens/.
  • To change tool logic, go to tools/<tool>/; to change shared capabilities, go to common/.
  • For more detailed steps, see TUTORIAL.md, the Chinese version is docs/README.zh.md.

VII. Suggested Onboarding Order

  1. conda activate AI → pip install -e ".[all]"
  2. cp config.example.json config.json, and prepare Ollama (or switch to --api claude_cli)
  3. bash scripts/smoke.sh to verify installation
  4. Try the simplest cd tools/benchmark && python -m benchmark.cli --cpu-only first, then try python -m translator
  5. Afterwards, configure tools that depend on LLM such as summarize / research
opus-5 — 11,650 chars · 16/16 facts

I. Project Summary

What it is

Gadgets is a collection of practical tools accumulated during daily development, covering AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each directory under tools/ is an independently usable tool; shared capabilities are centralized in the common/ package in the repository root (installed via pip install -e .), providing general functions such as LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc. The license is GPL-3.

Repository Structure

gadget/
├── tools/              # 五个独立工具产品(改工具就来这里)
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 学者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM / 缓存 / IO / 翻译 / Hugo),所有工具依赖
├── scripts/            # 运维维护脚本(sync.py、onboard.py、language.py、profile_translation.py…)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 所有生成产物(gitignore,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议(动手前先读)
├── CLAUDE.md           # Claude Code 的仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置

outputs/ is divided into logs/ (intermediate products), reports/ (final reports in MD/JSON/HTML), cache/ (LLM and search cache), data/ (CSV, JSON profile), images/ (charts and generated images), and backups/ (backups before forced overwrite). Hugo site content is written directly to tools/website/content|static, without a separate outputs/site staging directory. build/ and gadget.egg-info/ are generated by pip install -e ., located in the repository root and already gitignored.

Where to go to change things:

Task Where to go
Change the logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / Cache / Translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time configuration for new machines scripts/onboard.py
Change development workflow / a specific skill ai-companion repository (sibling ../ai-companion/ )
View plans / design documents docs/ecl/, docs/

What each tool does specificallytools/summarize —— AI Conversation Daily/Weekly/Monthly Reports

Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLM APIs to generate structured daily, weekly, and monthly reports. Multi-device workflow: export conversation logs from various devices → sync via cloud drives or manual copy for aggregation → generate final daily reports; once enough daily reports are accumulated, generate weekly and monthly trend summaries. Automatically discovers and statistics token usage and costs for all agent CLI via the source namespace commands of ccusage 20.x https://github.com/ryoppippi/ccusage (ccusage claude, ccusage codex, ccusage gemini…). Key technologies: Claude/OpenAI API, ccusage 20.x (unified multi-source), matplotlib.

tools/research —— Paper Discovery and Scholar Analysis A unified academic research toolkit providing four major capabilities through a single CLI entry tools/research/research_scout.py:

  • Paper Discovery: Search for papers from arXiv / bioRxiv / PubMed using a three-stage LLM pipeline (fast screening → deep evaluation → citation impact), generating research weekly reports and deploying them to Hugo. Supports conference paper search and author search.
  • Deep Paper Insights (--insight): Download full-text papers and let the LLM analyze their writing structure, publication strategies, and reusable core knowledge; automatically match OpenReview to obtain review comments and analyze consensus vs. controversy; synthesize cross-paper research writing guides.
  • Scholar Profiling: Scrape paper and citation data from ArXiv + Semantic Scholar; LLM generates research trajectory analysis, calculates tier scores, and automatically discovers mentor-student relationships via homepage extraction + collaborator patterns. Supports name disambiguation and reverse lookup.
  • Citation Graph Analysis: Performs forward citation / backward reference analysis based on Semantic Scholar API, combined with LLM-driven impact interpretation.

tools/benchmark —— Performance Benchmark Suite A cross-platform CPU/GPU FLOPS benchmarking tool that uniformly measures floating-point performance across different hardware vendors and precision levels. GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL may only appear in --info detection), covering precisions such as FP64 / FP32 / FP16 / BF16 / FP8 (experimental). The measurement method involves warmup + formal measurement + statistical analysis (median, IQR for outlier removal), and explicitly performs GPU synchronization to ensure timing accuracy. Results are accumulated in CSV in append mode (never overwritten, naturally supporting multi-hardware cumulative leaderboards), and can generate interactive HTML reports and leaderboards with Plotly charts, supporting deployment to Hugo websites and submission to public leaderboards.

tools/website —— Hugo Blog A Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/). Includes a built-in incremental image/video compression pipeline (only compresses media changed after .last_build: images via pngquant, videos via HandBrakeCLI), and local model bilingual translation (defaults to Ollama, falls back to vLLM on Linux / transformers on Windows; model tencent/Hy-MT2-1.8B is automatically downloaded on its first run without using cloud LLM APIs). Auto-generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly to tools/website/content|static by the deployment pipeline (the unique Hugo content root, files are tagged with gadget_generated; handwritten files without this tag are never overwritten), then translated, compressed, built, and pushed. tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed + pushed by build scripts—do not commit directly to it.

tools/translator —— Gradio Document Translator A Gradio document translator based on the common translation engine: a local translation web interface similar to Google Translate that translates text and files (.md / .txt / .pdf / .docx / images) while preserving Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected). Local inference instead of cloud APIs: reuses common.engine.create_engine() to automatically select backends (prioritizes ollama when a model tag is pulled; transformers is the Windows fallback, prioritizes vllm on Linux, and llamacpp is the low-VRAM GGUF option), with models residing in memory (warm) and lazy-loading on demand when switching models. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded on first use, and can be overridden via GADGET_TRANSLATION_MODEL or the GUI’s model management. Source language can be set to auto (detected by CJK text ratio); when the target language is auto, it flips between zh↔en.

common/ —— Shared Infrastructure Package The shared layer that all tools depend on, installed as a Python package via pip install -e .: LLM calls (unified two-layer API, supporting four backends: ollama (default) / claude_cli / anthropic / openai), JSON parsing and repair, SHA-256 disk cache (namespace + TTL), atomic writes and content hashing, local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation, and cross-platform Hugo deployment.

scripts/ —— Operations and Maintenance Scripts

  • sync.py —— Centralized rclone data synchronization (push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories; includes a special dag category for generating + deploying DAG sites). Configuration is in the sync section of the repository root tools/research/TUTORIAL.md (paths can be overridden via GADGET_CONFIG).
  • onboard.py —— Repository-level one-time machine configuration: fill out a YAML table (tokens/onboard.yaml), run the script once, and it automatically completes SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap.
  • smoke.sh —— Read-only smoke checks covering all tools (--help / --info / import; does not involve LLM, network, or writes).
  • serve_local_llm.sh —— Creates an Ollama variant optimized for summarize and prints environment variables. Persistent parameters are placed in the summarize section of the root config.json.
  • Others: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU profiler).

../ai-companion/ (Independent Repository) Provides the DAG publishing tool used by scripts/sync.py --category dag, as well as AI code change tracking + plan/execute skill pipelines + all skills (Node.js, TypeScript). The Companion tool is optional and must be explicitly run; this repository has no Companion interception hooks, and onboarding does not install Companion; old install.ai_companion settings will be ignored. Existing local idea graphs, manual graph commands, and skills remain available. Coding agents follow AGENTS.md, without being intercepted by Companion.


II. Usage Tutorial (For Beginners)

The README itself is an overview; step-by-step operations, configurations, data formats, and FAQs for each tool can be found in TUTORIAL.md and each tool’s own source documentation. This tutorial only covers the commands and parameters explicitly mentioned in the README.

Step 0: Environment Preparation

  • Python 3.10+ (conda environment AI is recommended)
  • Node.js 18+ (only if optional Companion graph and DAG publishing tools are needed)
  • Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • GPU benchmarks will automatically detect CUDA / Apple MPS / Intel XPU
  • website / translation functions use a local inference engine (defaults to Ollama, using the same gemma4:26b chat model for translation; falls back to vLLM on Linux / transformers on Windows, both using tencent/Hy-MT2-1.8B, which is automatically downloaded on first run)

Activate the recommended environment:

conda activate AI

Step 1: Installation

# 安装 common 包 + summarize / research / benchmark / website 的 extras
pip install -e ".[all]"

Note: all does not include translator, which must be installed separately:

pip install -e ".[translator]"

You can also install individual extras as needed:

pip install -e ".[website]"      # 含翻译所需的 torch + transformers
pip install -e ".[translator]"   # gradio + GGUF 翻译栈

After installation, you can run a read-only smoke check (which does not trigger LLM, network, or writes) to confirm the environment is normal:

bash scripts/smoke.sh

Step 2: Configuration

Tool Settings File: Tool settings are located in config.json at the repository root (already gitignored), copied from config.example.json:

cp config.example.json config.json

To use a different path, override it using the environment variable GADGET_CONFIG. Within this file, the sync section is for scripts/sync.py configuration, and the summarize section holds persistent parameters for serve_local_llm.sh.

Secrets Directory: The tokens/ directory stores API keys and onboarding tables; it is gitignored — never commit its contents.

LLM Backend: All tools switch backends uniformly via the --api parameter. Options include ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, and openai. You can also set this globally using the environment variable GADGET_LLM_BACKEND.Translation Backend: The translation path uses a local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama (default, local Ollama service, reusing the already serviced chat tag gemma4:26b) → llamacpp / vllm / transformers (in-process, model tencent/Hy-MT2-1.8B). The translation model can be overridden by GADGET_TRANSLATION_MODEL.

Local LLM Environment Variables: Create an Ollama variant optimized for summarize and export the environment:

eval "$(bash scripts/serve_local_llm.sh env)"

One-time Configuration for New Machines: After filling in tokens/onboard.yaml, run it once to automatically complete SSH configuration, Claude/Codex authentication, pip extras, tool configurations, and rclone bootstrap:

python scripts/onboard.py

Server System-level Installation (one-click installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion on Ubuntu 22.04/24.04) scripts have been migrated to the ai-companion repository along with the platform. After the repository split, --companion-repo is directly sent to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), and --companion-ref is no longer required:

bash ../ai-companion/scripts/onboard-server.sh --help

Step 3: Data Synchronization (Cross-device)

Cross-device data synchronization uses scripts/sync.py (requires rclone configuration first). Subcommands include push / pull / status / bootstrap / config, covering categories summarize / website / research / benchmark / backups, with a special dag category for generating + deploying DAG sites:

python scripts/sync.py            # 查看用法
python scripts/sync.py push      # 推送数据
python scripts/sync.py pull      # 拉取数据
python scripts/sync.py --category dag   # 生成 + 部署 DAG 站点

Step 4: Typical Usage of Each Tool

Summarize —— AI Daily/Weekly/Monthly Reports

Multi-device two-stage architecture: export from each device first, then aggregate and merge.

python -m summarize daily export                                   # 阶段 1:导出所有未导出的日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键全流程:导出 → 合并 → 周报 → 月报 + 部署

Switch AI summary backend (four backends unified using --api):

python -m summarize daily export --api claude_cli
python -m summarize daily export --api anthropic
python -m summarize daily export --api openai

Old entries python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available (backward-compatible re-export shim), but the python -m summarize form mentioned above is recommended.

For detailed steps, see TUTORIAL.md#summarize and the source document tools/summarize/tutorial.md.

Research —— Paper Discovery and Scholar Analysis

python tools/research/research_scout.py report --project my-project        # 全流程:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"             # 学者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

Use --insight for deep paper insights; all LLM features support switching backends via --api:

python tools/research/research_scout.py report --project my-project --api claude_cli

For detailed steps, see TUTORIAL.md#research and the source document tools/research/TUTORIAL.md.

Benchmark —— Performance Benchmarking

Note: All commands require first cd into tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                    # 跑全部基准测试(结果追加到 CSV)
python -m benchmark.cli --cpu-only         # 只测 CPU
python -m benchmark.cli --gpu-only         # 只测 GPU
python -m benchmark.cli --report           # 跑基准测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo /benchmark/

Hardware detection is available via --info. Results are accumulated in CSV in append mode and never overwritten, so they can be run repeatedly on multiple machines to build a leaderboard.

For detailed steps, see TUTORIAL.md#benchmark and the source document tools/benchmark/tutorial.md.

Website —— Hugo Blog

pip install -e ".[website]"                          # 安装依赖(含翻译用的 torch + transformers)

cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages

Under Windows (the script will cd to its own directory):

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (development server, including drafts):

cd tools/website && hugo server -D

Hugo bilingual audit (and summarize report renaming):

python scripts/language.py

Important: tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed + pushed by build scripts; do not commit directly to it. Automatically generated content carries the gadget_generated tag; handwritten files without tags will never be overwritten.

For detailed steps, see TUTORIAL.md#website and the source document tools/website/CLAUDE.md.

Translator —— Gradio Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(会在浏览器中打开)

After starting, paste text or upload files (.md / .txt / .pdf / .docx / images) in the web interface to translate. The source language can be set to auto (detected by CJK ratio); when the target language is set to auto, it flips between Chinese and English. To change the model, use environment variables:

GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF python -m translator

You can also switch in the Model Management within the GUI (lazy-loaded on demand). To change the inference backend:

GADGET_TRANSLATION_BACKEND=llamacpp python -m translator   # 低显存 GGUF
GADGET_TRANSLATION_BACKEND=vllm python -m translator       # Linux 优先
GADGET_TRANSLATION_BACKEND=transformers python -m translator  # Windows 回退

GPU performance analysis of the translation engine:

python scripts/profile_translation.py

For UI wiring, see tools/translator/app.py; for translation and file logic, see tools/translator/core.py]; for the shared engine, see common/engine.py and common/translation.py. For detailed steps, see TUTORIAL.md#translator.

Step 5: Essential Disciplines to Remember

  • All generated files are output to the outputs/ directory, which is gitignored and can be automatically rebuilt.
  • NEVER git add: Automatically generated content, rclone synchronized data, build artifacts (build/, gadget.egg-info/), and the deployment and theme repositories under tools/website/.
  • Content in tokens/ must never be committed.
  • Read AGENTS.md (the workflow protocol for all AI agents) before modifying code; for Claude Code, see CLAUDE.md separately.
fable-5 — 6,771 chars · 16/16 facts

Gadget Project Summary

What is this

Gadget is a collection of practical tools accumulated during daily development, covering five major directions: AI daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each directory under tools/ is an independently usable tool, with shared capabilities centralized in the common/ package at the repository root (installed via pip install -e .), providing general functions such as LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc. The project uses the GPL-3 license.

Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报/周报/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM/缓存/IO/翻译/Hugo)
├── scripts/            # 运维脚本(sync.py、onboard.py、smoke.sh 等)
├── docs/               # 设计文档、ECL 计划、审计报告、历史归档
├── outputs/            # 所有生成产物(gitignored,可重建)
├── AGENTS.md / CLAUDE.md
└── pyproject.toml

There is also a sibling repository ../ai-companion/ (independent repo) providing DAG publishing tools and development workflow/skill-related content.

What Each Tool Does

Tool Function
summarize Automatically reads AI conversation logs from various devices (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLMs to generate structured daily, weekly, and monthly reports; uses ccusage 20.x to statistics token usage and costs for each agent CLI. Multi-device two-stage architecture: export from each device → aggregate via cloud drive synchronization → merge to generate daily reports, then accumulate to generate weekly/monthly reports.
research Unified academic research tool (single entry point research_scout.py): ① Paper Discovery—arXiv/bioRxiv/PubMed three-stage LLM pipeline (fast screening → deep review → citation impact), generates research weekly reports and deploys them to Hugo; ② Deep Paper Insights (--insight)—downloads full text to analyze writing structure and automatically matches OpenReview reviews; ③ Researcher Profiling—generates research trajectory analysis, tier scores, and mentor-student relationship discovery based on ArXiv + Semantic Scholar; ④ Citation Graph Analysis.
benchmark Cross-platform CPU/GPU FLOPS benchmarking, supporting NVIDIA CUDA / Apple MPS / Intel XPU, covering FP64/FP32/FP16/BF16/FP8 (experimental). Includes Warm-up + Formal Measurement + Statistical Analysis (median, IQR for outlier removal), results are appended to CSV (naturally supporting multi-hardware cumulative leaderboards), and can generate Plotly interactive HTML reports deployed to Hugo.
website Hugo static blog (“TzJ’s Net”, PaperMod theme, deployed to GitHub Pages). Includes built-in incremental image/video compression (only compresses media that changed after .last_build: images via pngquant, videos via HandBrakeCLI) and local model bilingual translation. Automatically generated content is written directly to `tools/website/content
translator A Gradio-based local translation web app using the common translation engine, translating text and files (.md/.txt/.pdf/.docx/images) while preserving Markdown formatting (code blocks, URLs, and Hugo shortcodes are protected). Purely local inference, automatically selects backends (ollama / vllm / transformers / llamacpp), default model is tencent/Hy-MT2-1.8B, which is automatically downloaded upon first use.

Ops scripts in scripts/: sync.py (rclone data sync, push/pull/status/bootstrap/config), onboard.py (one-time configuration for new machines), smoke.sh (read-only smoke tests), serve_local_llm.sh (create Ollama variants optimized for summarize), language.py (Hugo bilingual audit), profile_translation.py (translation engine GPU performance analysis).


Tutorial (For Beginners)

I. Environment Preparation

  1. Python 3.10+, recommended to use conda environment AI:
    conda activate AI
    
  2. Node.js 18+ (optional, only required for Companion graph and DAG publishing tools).
  3. For specific dependencies of each tool, see requirements.txt in their respective directories.
  4. Local inference (website translation / translator) defaults to using Ollama (chat model gemma4:26b); Linux can use vLLM, and Windows can use transformers as fallback (using tencent/Hy-MT2-1.8B, automatically downloaded on first run).
  5. Cross-device data synchronization requires configuring rclone.

II. InstallationExecute in the repository root:

# common 包 + summarize/research/benchmark/website 的依赖(注意:不含 translator)
pip install -e ".[all]"

# translator 需单独安装
pip install -e ".[translator]"

# 如只需 website(含翻译用的 torch + transformers)
pip install -e ".[website]"

Installation will generate build/ and gadget.egg-info/ in the repository root (gitignored, do not commit).

III. Configuration

  • Main Configuration File: Repository root config.json (gitignored), copied from config.example.json; the path can be overridden using the environment variable GADGET_CONFIG. sync.py reads the sync section within it, and the persistence settings for summarize are located in the summarize section.
  • Keys: Placed in the tokens/ directory (gitignored, do not commit).
  • LLM Backend: All LLM features are unified and switched via the --api parameter, with four options: ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, and openai. The environment variable GADGET_LLM_BACKEND can also be used for global settings.
  • Translation Backend: Selected via GADGET_TRANSLATION_BACKEND (ollama default → llamacpp/vllm/transformers); translation models can be overridden via GADGET_TRANSLATION_MODEL.
  • One-time Configuration for New Machines: Fill in tokens/onboard.yaml and run once:
    python scripts/onboard.py
    
    This will automatically complete SSH configuration, Claude/Codex CLI installation/authentication, pip extras installation, tool configurations, and rclone bootstrap.
  • Verify Installation (Read-only smoke test; does not call LLM, does not connect to the internet, does not write files):
    bash scripts/smoke.sh
    

IV. Typical Usage of Each Tool

1. Summarize — AI Chat Daily/Weekly/Monthly Reports

A two-stage process for multiple devices: first export on each device, then merge and generate on the aggregation device.

python -m summarize daily export                                   # 阶段一:导出所有未导出日期
python -m summarize daily merge --sync-all                         # 阶段二:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 生成周报并部署
python -m summarize monthly generate --month 2026-02 --deploy      # 生成月报并部署
python -m summarize auto --deploy                                  # 一键全流程:导出→合并→周报→月报并部署

Old entries like python tools/summarize/daily_summary.py are still available (compatibility shim), but the new format above is recommended.

Optional: Use bash scripts/serve_local_llm.sh to create a summarize-tuned Ollama variant and import it into environment variables:

eval "$(bash scripts/serve_local_llm.sh env)"

2. Research — Paper Discovery and Researcher Analysis

python tools/research/research_scout.py report --project my-project        # 全流程:搜索→三阶段评估→报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"            # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(arXiv ID / DOI)
python tools/research/research_scout.py deploy                             # 部署报告到 Hugo

All LLM features also support --api ollama|claude_cli|anthropic|openai; use --insight for deep insights.

3. Benchmark — Performance Benchmarking

Note: All commands must first be cd tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                    # 运行全部基准(结果追加到 CSV)
python -m benchmark.cli --cpu-only         # 只测 CPU
python -m benchmark.cli --gpu-only         # 只测 GPU
python -m benchmark.cli --report           # 测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo /benchmark/

GPU automatically detects CUDA / Apple MPS / Intel XPU (OpenCL only appears in --info detection).

4. Website — Hugo Blog

pip install -e ".[website]"                          # 安装依赖(含翻译所需 torch + transformers)

# macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
cd tools/website && bash update.sh

# Windows(脚本会自动 cd 到自己的目录)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(含草稿)
cd tools/website && hugo server -D

Note: Do not commit directly to tools/website/public/ (it is an independently deployed repository, automatically committed and pushed by build scripts); do not git add automatically generated content, deployment/theme repositories.

5. Translator — Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(浏览器打开)

Source language can be set to auto (detected by CJK text ratio); when the target language is auto, it automatically flips between Chinese and English. Models can be overridden via GADGET_TRANSLATION_MODEL or model management within the GUI.

6. Data Synchronization

python scripts/sync.py push    # 推送
python scripts/sync.py pull    # 拉取

Also supports status / bootstrap / config operations, covering summarize / website / research / benchmark / backups categories, as well as the special dag category (generates and deploys DAG sites, depending on the sibling repository ai-companion).

V. Output and Precautions

All generated artifacts are unified under outputs/ (gitignored, can be rebuilt): logs/ (intermediate products), reports/ (final reports), cache/ (LLM/search cache), data/ (structured data), images/ (charts), and backups/ (forced override backups). Hugo site content is written directly to tools/website/content|static, with no separate staging directory.

Key Taboos: Do not commit tokens/ content; do not git add automatically generated content, rclone sync data, build artifacts (build/, gadget.egg-info/), or deployment/theme repositories under tools/website/.

For more detailed step-by-step operations, data formats, and FAQ, see TUTORIAL.md in the repository and the source documents in each tool’s directory.

fable-5.1 — 8,881 chars · 16/16 facts

The project summary and usage tutorial are provided below, all content is based solely on the README.

I. Project Summary

What is Gadgets

Gadgets (repository name gadget) is a collection of practical tools accumulated by the author during daily development, covering five directions: AI chat daily report generation, paper discovery, performance benchmarking, blog automation, and document translation. Each directory under tools/ is an independently usable tool, with common capabilities concentrated in the common/ package in the repository root (installed via pip install -e .), providing general functions such as LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc. The license is GPL-3.

Repository Structure

Path Role
tools/summarize/ AI Chat Daily / Weekly / Monthly Reports
tools/research/ Paper Discovery + Researcher Analysis + Citation Maps
tools/benchmark/ CPU/GPU Performance Benchmarking
tools/website/ Hugo Blog (Incremental media compression + automatic build and publish)
tools/translator/ Gradio Document Translator
common/ Shared Infrastructure Package (LLM / Cache / IO / Translation / Hugo), all tools depend on it
scripts/ Operations and Maintenance Scripts (sync.py, onboard.py, language.py, profile_translation.py, etc.)
docs/ Design Documents, ECL Plans (docs/ecl/), Audit Reports, Historical Archives (docs/archive/)
outputs/ All generated artifacts (gitignored, can be automatically rebuilt)
AGENTS.md Workflow protocols for all AI agents
CLAUDE.md Repository guide for Claude Code
pyproject.toml common/ and packaging configurations for each tool

There is also a sibling independent repository ../ai-companion/ that provides DAG publishing tools and development workflows / skills; this repository does not depend on its interception hooks.

What Each Tool Does

  • Summarize: Reads chat records from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, and calls LLMs to generate structured daily, weekly, and monthly reports. It uses a two-stage architecture for multiple devices: each device first exports data, which is then synchronized via cloud drives or manually copied for aggregation and merging. It utilizes ccusage 20.x to automatically count token usage and costs for various agent CLIs.
  • Research: A single entry point tools/research/research_scout.py with four capabilities: Paper Discovery (arXiv / bioRxiv / PubMed, a three-stage LLM pipeline that generates weekly reports and deploys them to Hugo), Deep Paper Insights (--insight, downloads full texts to analyze writing structures and automatically matches OpenReview reviews), Researcher Profiling (ArXiv + Semantic Scholar, discovering research trajectories, tier scores, and mentor-student relationships), and Citation Map Analysis.
  • Benchmark: Cross-platform CPU/GPU FLOPS testing, supporting NVIDIA CUDA, Apple MPS, and Intel XPU, with precision covering FP64 / FP32 / FP16 / BF16 / FP8 (experimental). It includes Warm-up + Formal Measurement + Statistical Analysis (median, IQR for outlier removal). Results are written to CSV in append mode, and it can generate Plotly interactive HTML reports and leaderboards, supporting deployment to Hugo and submission to public leaderboards.
  • Website: A Hugo static blog “TzJ’s Net” (PaperMod theme), deployed to GitHub Pages. It features built-in incremental image/video compression (pngquant, HandBrakeCLI, compressing only media that changed after .last_build) and local model bilingual translation. Automatically generated content from other tools is written directly to tools/website/content|static with a gadget_generated marker, so handwritten files will not be overwritten. tools/website/public/ is an independently deployed repository that is automatically committed and pushed by build scripts; do not commit manually.
  • Translator: A Gradio-based local translation web interface based on the common translation engine, supporting text and .md / .txt / .pdf / .docx / image files, while preserving Markdown formatting (code blocks, URLs, and Hugo shortcodes are protected). It performs pure local inference, automatically selecting backends (ollama / transformers / vllm / llamacpp), with models resident in memory. The default model is tencent/Hy-MT2-1.8B. The source language can be set to auto (detected by CJK ratio), and when the target is auto, it flips between Chinese and English.

Scripts in scripts/- sync.py: Centralized data synchronization based on rclone (push / pull / status / bootstrap / config), covering summarize / website / research / benchmark / backups categories; an additional dag category is used for generating and deploying DAG sites.

  • onboard.py: One-time configuration for new machines; run once after filling in tokens/onboard.yaml to automatically complete SSH, Claude/Codex CLI installation and authentication, pip extras, various tool configurations, and rclone bootstrap.
  • smoke.sh: Read-only smoke tests (--help / --info / import), which do not call LLMs, do not connect to the internet, and do not write files.
  • serve_local_llm.sh: Creates a specialized Ollama variant for summarize and outputs environment variables.
  • language.py Hugo bilingual audit + summarize report renaming. profile_translation.py: GPU performance profiling for the translation engine.

II. Usage Tutorial

1. Environment Preparation

Basic Requirements

  • Python 3.10 or above. The README recommends using a conda environment named AI.
  • Node.js 18 or above, required only when using the optional Companion graph and DAG publishing tools.
  • For specific dependencies of each tool, see requirements.txt in their respective directories.

External Tools Prepared on Demand

  • Ollama: Both the default LLM backend and translation backend are local Ollama, using the gemma4:26b chat model by default. If you do not want to install Ollama, you can use the claude_cli backend (reuses Claude Code CLI login state, no API key required), or anthropic / openai backends (requires an API key).
  • Hugo, pngquant, HandBrakeCLI: Required for the Website tool’s building and media compression.
  • rclone: Required for cross-device data synchronization.
  • ccusage 20.x: Required for Summarize to track token usage.
  • GPU Drivers: Benchmark will automatically detect CUDA / Apple MPS / Intel XPU.

Activate environment:

conda activate AI

2. Installation

Execute in the repository root. all contains common packages as well as extra dependencies for summarize / research / benchmark / website, but does not include translator; translator must be installed separately.

# common 包 + summarize / research / benchmark / website
pip install -e ".[all]"

# 翻译器(gradio + GGUF 翻译栈),需单独安装
pip install -e ".[translator]"

# 仅 website(含翻译用的 torch + transformers)
pip install -e ".[website]"

Installation will generate build/ and gadget.egg-info/ in the repository root; these are gitignored, do not commit them.

After installation, you can perform a read-only smoke test to confirm that all tools can be imported and --help is available:

bash scripts/smoke.sh

3. Configuration

Main Configuration File

Tool settings are located in config.json at the repository root (already gitignored); copy from the example:

cp config.example.json config.json

The environment variable GADGET_CONFIG can be used to override the configuration file path. sync.py reads the sync section within it, and the persistence parameters for serve_local_llm.sh are placed in the summarize section.

Secrets Directory

The tokens/ directory stores API keys and the new machine configuration table tokens/onboard.yaml; it is gitignored, do not commit its contents.

LLM Backend Selection

All LLM functions are switched via the --api parameter. Optional values: ollama (default), claude_cli, anthropic, openai. It can also be set globally via the environment variable GADGET_LLM_BACKEND.

Translation Backend Selection

Set via GADGET_TRANSLATION_BACKEND: ollama (default, reuses local gemma4:26b), llamacpp, vllm, transformers (the latter three are in-process inference using tencent/Hy-MT2-1.8B, which is automatically downloaded upon first run). The translation model can be overridden by GADGET_TRANSLATION_MODEL.

Local Ollama Variant (Optional, for Summarize)

eval "$(bash scripts/serve_local_llm.sh env)"

One-time Configuration for New Machines (Optional)

Run once after filling in tokens/onboard.yaml:

python scripts/onboard.py

The server-level system installation script has been migrated to the ai-companion repository; see usage here:

bash ../ai-companion/scripts/onboard-server.sh --help

4. Summarize: AI Daily / Weekly / Monthly Reports

The workflow is divided into two stages. Stage one exports conversation logs on each device; stage two synchronizes and merges them daily on a summary device to generate daily reports. Once enough daily reports have accumulated, weekly and monthly reports can be generated. Adding --deploy will simultaneously deploy them to the Hugo blog.

# 阶段 1:导出所有尚未导出的日期(在每台设备上执行)
python -m summarize daily export

# 阶段 2:同步所有日期并逐日合并生成日报
python -m summarize daily merge --sync-all

# 生成 2026 年第 12 周周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成 2026 年 2 月月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流程:导出 → 合并 → 周报 → 月报 + 部署
python -m summarize auto --deploy

Example of switching LLM backends (--api is the unified parameter):

python -m summarize auto --deploy --api claude_cli

The old entry points python tools/summarize/daily_summary.py ..., weekly_summary.py, and monthly_summary.py are still available, but using the python -m summarize format above is recommended.

Data synchronization between multiple devices uses rclone:

python scripts/sync.py push
python scripts/sync.py pull

5. Research: Paper Discovery and Researcher Analysis

The unified entry point is tools/research/research_scout.py, run in the repository root.

# 完整流水线:搜索 → 三阶段评估 → 生成研究周报(按项目名)
python tools/research/research_scout.py report --project my-project

# 自然语言搜索,自动路由到合适的数据源
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 研究者画像(论文、引用、研究轨迹、tier 分数、师生关系)
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图谱分析,参数为 arXiv ID 或 DOI
python tools/research/research_scout.py citations 2301.12597

# 将报告部署到 Hugo 博客
python tools/research/research_scout.py deploy

Deep paper insights are enabled via --insight, which downloads full paper texts, analyzes writing structures and publication strategies, matches OpenReview reviews, and synthesizes them into cross-paper writing guides. The README only provides the parameter name without a complete example command; please refer to tools/research/TUTORIAL.md for specific combinations.

All LLM functions also support switching backends via --api:

python tools/research/research_scout.py profile "Sergey Levine" --api anthropic

6. Benchmark: Performance Benchmarking

All commands must first enter the tools/benchmark/ directory. Results are written to CSV in append mode; results from multiple runs and multiple hardware setups will naturally accumulate into a leaderboard.

cd tools/benchmark

# 运行全部基准测试(结果追加到 CSV)
python -m benchmark.cli

# 只测 CPU
python -m benchmark.cli --cpu-only

# 只测 GPU
python -m benchmark.cli --gpu-only

# 运行测试并生成 HTML 报告
python -m benchmark.cli --report

# 生成报告并发布到 Hugo 站点的 /benchmark/ 路径
python -m benchmark.cli --report --deploy

GPU type is automatically detected (CUDA / MPS / XPU) without needing manual specification. --info can be used to detect hardware information; OpenCL devices will only appear in detection results and will not actually run tests.

7. Website: Hugo Blog

First, install the website dependencies:

pip install -e ".[website]"

Local preview (development server, including drafts):

cd tools/website && hugo server -D

One-click incremental media compression, translation, Hugo build, and push to GitHub Pages:

# macOS / Linux
cd tools/website && bash update.sh

# Windows(脚本会自行切换到所在目录)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Notes:

  • Only compresses images (pngquant) and videos (HandBrakeCLI) that have changed after .last_build.
  • Translation is completed locally, defaulting to Ollama, falling back to vLLM on Linux and transformers on Windows; the model tencent/Hy-MT2-1.8B is automatically downloaded upon first run.
  • The --deploy of other tools will write generated content to tools/website/content|static and mark it with gadget_generated; handwritten files without this mark will not be overwritten.
  • tools/website/public/ is an independent deployment repository, automatically committed and pushed by scripts; do not commit manually, and do not git add the deployment or theme repositories under it.

8. Translator: Gradio Document Translator

Install and start; the interface will automatically open in your browser after starting:

pip install -e ".[translator]"
python -m translator

Usage points:

  • Supports direct text input or uploading .md / .txt / .pdf / .docx / image files, preserving Markdown format during translation.
  • Source language is optional (auto), automatically determined by the proportion of CJK characters in the text; when the target language is auto, it automatically flips between Chinese and English.
  • Automatic backend selection: prioritizes ollama if the model tag has been pulled, falls back to transformers on Windows, prioritizes vllm on Linux, and offers llamacpp (GGUF) for low VRAM.
  • Default model is tencent/Hy-MT2-1.8B (GGUF version is tencent/Hy-MT2-1.8B-GGUF); automatically downloaded upon first use. You can change it via the environment variable GADGET_TRANSLATION_MODEL or through model management in the interface; models are lazy-loaded as needed when switching.

9. Data Synchronization and Output Directories

Synchronization

scripts/sync.py supports push / pull / status / bootstrap / config operations, covering summarize / website / research / benchmark / backups categories; rclone must be configured first. The command format provided in the README is:

python scripts/sync.py
python scripts/sync.py push
python scripts/sync.py pull
python scripts/sync.py --category dag     # 生成并部署 DAG 站点,依赖 ../ai-companion/

Output Directories

All generated files are unified in outputs/, which is gitignored and can be automatically rebuilt:

Subdirectory Content
logs/ Intermediate products such as export logs, runtime logs, etc.
reports/ Final reports (Markdown, JSON, HTML)
cache/ LLM cache, search cache
data/ Structured data (CSV, JSON images)
images/ Charts and generated images
backups/ Backups before forced overwrite

Hugo site content is written directly to tools/website/content|static, with no separate outputs/site staging directory.

10. Summary of Precautions- Do not submit tokens/、outputs/、build/、gadget.egg-info/, rclone data synchronization, as well as the deployment repositories and theme repositories under tools/website/.

  • config.json has been gitignored; new machines need to be copied from config.example.json.
  • Modify tool logic in tools/<tool>/, modify shared capabilities in common/, modify synchronization in scripts/sync.py, and development workflows and skills are in the ai-companion repository.
  • For more detailed steps, data formats, and FAQ, see TUTORIAL.md within the repository and the documentation under each tool directory.
haiku-5.5 — 21,088 chars · 0/16 factsCAQSwXsKEAgTGAI4AUIIdGhpbmtpbmcSDHBGdDws4AGDe45XZRoMxiqevpB/DUrWaAdEIjBBvdtgGLGOdZ0jrG+vfQ6qn8+55Fo/mrnquTzz5UzNPE/4IMMZmTSLaQUWZdt0rOUq3npeLDTLyQn1ui2/+2F0wPJGblD+1I3TV3HJk2uyD2SRIchQpP4JSMp0fOLRtmIXw/kXokEMdM1Z4xmN8jHLv7P4KkwdSz/GxdjkFaba7PK2fbufrW980ji9y6gdYxHtC4iaY0YvQFm0MQDBkBX6fGMh3U4rm1DcoB1QOZxdbOAM0KNgSsdDspyOf0CQSgwO/IAkqOwFmeO3tf5+GJP8OIAqI+0cQhN6d4vnP30kS5Id2gXJnsshZ2rYx/htYCeieM0bmq3NBH2nK4kTo3l8tHy4Tczrq8FRNyHZA3sx3YMzfwxvfzy9iEifm90OzAGmFT6AJIbVRhjEPgFtII+HSLzBj763OXT9PlYFA+7BIbvs3251eeK6483xvp+n3pzSTb4W0pB6FeO+00vPrjyoPRnUBKKpfy8O5obpMNe++es4LynGxwiYb7XWIeiknZVLksk2to/sID/wGhV2CcuLYSXnw4RkNixOBiGNdmPTPfVaoWCi+GsJHU2af6cbWI/rV4auViBE4vR/Rcy23cKSZeXABxm0Xrorn8QXdOW1DZ4n5GfMXo0mP9KMt/E5zzQhROrR2/WB4V8A6pxrkD0+gGD5HsuOiOr4ci1MwUVcA9KTbj+xojBz+OBR1dpi7HIzslc/I0UOXLroa97bRZVpg7+NJYDDb+Me2r37hhmHD5Q6Y5t/R6zT7rItyE/IQI7TLntJcCFNm0W40g5gaZXDqf2FaL3PDOLbJQMiyJewKpb/dTqGVABuFEpIrTV31ZMsEfRsdME8d40Z77soDXhVjbNtmsQAfmS72K60YY+PHClOezxHmFhSLN9szEEDnJe2fndskqVf7JgWCLUW3KLBiq1HukMMvgBEXdvaq6rKEYOapbB7j7KtRKy/pb4OdnEUC4zqNMjTw5+CFbrzwEE5TTkjdaiftVW1tKLryevW/eqJUoWNRZeHlpbsIryifD4PQ1zmKUhafAZN2sWhd4qYVTexYJzjNDrflBrTCf3dKTjnL8PkItHp7Li+bZdRoo/04I63ixAY1bsPEERi6+U/+SQz86BFDHBXVDOncODENAmgiLJEHrnngCcvmY3v+eDAX1strntV8r6YLR1cN+A+RwVMsAIiy7gvmQQBrEbQYSq5fx4OUBI7k0NRwbT2hyDOOnM7QEq+kUz9srw3g+q1dt+6K8YYsu5XnE3EuLJyXvzboRMwUVTgOIHMzFV5IbzuJQ138DfEdsdhZFo3PduntLiIcYJR6N+H+c1aBfKvghNrStzab+C+6VzFZKYKhjogY3/UJFmQ+Xy9PKtZsMNyFcOdxgRlHvOAFQ2ZUUV6rhQcXgUAZWTN8CtB4oFW+OuRwjggik3MfMIPyxawwLyXerFnvbGTVIByMobgNeEF7GDheNUnHYA2P3kEbTcrE7xsT0e4UDCcUfGUP88LmrURjAc2WsNP5EKBBZhFbpiPf/n8qbtSOYNPuphwGmKKH8HBdoxc1ZFjyq0UTY4DQxlQNUJbSsbZ91UqA0yVGfFzSpQ/uzBmca0PG0mQaw2KEY7roM0cDuvX6g/0S5sD2BXjpHea5qpqG1hTD5T3EnR553CKe8vPH3PMeubuWuDk9iG5yamwYAlFlz5ISDe3n6oOJ+34x64SS1sJMJMPB8YwnO9VdlEywbuV8laSyUaK9MSldIbBfnNo/k+00tXzeB2ZfoFQ+CxmOrk697mT4/Y5EFlm+yAbHv7/BaP0JJ1TrFRrMrhKORlHR2yLvznvN1JcmjQNGPKIaTm5SUhvkc746Vv5jYdRlcsg38ZR3JhEnrc6aySF39hMRBo5bZ2hZSXNxievmM+jPKWvyehFJoleZi6gnCyQL/vrLn6CnWYp3A7bQONYdV/SdInX+JEpRu3F22Zonhtsh6HKaJCpTd6WwNWbbNkM6jhZQFnqWBTH9PStG5Yy7nbAmYjWGz954npwLgVRL5fWcAFGRAo3W/z0kKjd06FFXiVpI+ZglgqJMH1o1NhS+SDQ7deInF2CJPqYlmwFqrxRImGXlUVT8ENbzPRtbD8y8DEZKxLwcZp5S+gX9DPC7u3zLhs5B8WVDbAjtnIN/tVirCfl/yyfZWx/j8wSoWAOnu7rpcoh2Viim7O+udVf/ofK7XaVs4JQ+WJMbzsDLzij9wm+1gHcMRuATYFuSJCkKEFnfd5LcM2LrmuglDtQEf7Fd105ys3Fzh7l46XTcMXAAJZJS6T8BSsHPwiRntGZDxoQ1lKECH/RupR4W2S0rS02mtmZ4EtDu2fgWVRutoNHktxUE4RvBjEhRW/W6+2NzZaWdOSDEh9btleLohOzDyC02xuyePbzBKSPVywS8BifN9OaiaMCxThnEJWu6wKE4sMwWnqIqB35RCJRzyxB8reSdNPAXprnISFN9qf+ZZXiz92tbVZlqXkxEU1FbEvdyLVWNfEklUvb2IHt+1fkDVyBfj7fekbRPT7Ay8IqSm125hke2QUubg9Ch4h7ph9pAPnjc30vSIrkDHtBi5UPqN81v99RA7fn98QKP3I9VlajHS4oKtgUUb0oocV36rZ3e9nH39oYAWJIRkDpA6ipI9SuGTKU5mlxL/kfF4VzgcBjSSc0BEzC9qLmp0ENZ2zEbYaEG7KruuZ8GPFdXsW570GZibo5PlQeu3nJUD3GazAwSlYmc2GA+nlpOkfQ3TDp+Tpe+rSyL65v73L0SP/RArc3hZX0KsmNjcVihp1Bjl2Nl5K83hV2NI2ts4dfoMjvnA9RTNczspveWku5nnW4tO+wKwGOLf7n2lkq1RoWKPEcZJ/KNKtIvqtcCgSHbrOuFKd3WTo7PZM63i7W+f2lKaSr10xISYLzp8oEXAjT1/pKf117gQGwrGf2iprhveSVF9lHVE2HXJcq7DC9vX2eAy5SsgeIlHybI2d8BvZso2CzjZeH4Wgk3z+5QN3Nyr/zCMe3zWIqFQ/WGxyEuxEAIGzKbU326VIdIV8mNMptHBb4NB9tZXN+EDOCDvFXlzEwEz70IGFLnreMLKukZGeDv3guMGk7i3cQNYI/f4UanBL0FyXcTG5l4l28uenFH/HoGxa3iY02K1j3hWSbJl123V8gjsOS9jETfLk/T8r905DMg1yhFo5ANC6j+8VsQDp8/cmoewyIxf0fPOebxL1boCXvr5uVL/KGfi9cM/sdpzmXWxYcOxiIbCeqLb9C8Wyl/5MAPzUXvj+txwGffi4ZwTGISbTnAk/iC4WI3P72B5KGwbNSlg6ZXqWs39N9F6Vpg/tOy5WGQmsHjBblC2EJ5EzGETQ7WU9pzMS0m+b41oZxfa8bt004ba6JBFHenKlgikRfICjUFSFah3imL3fawMrg/08/lG5o1rccEpo2Fr6RCla6tzTC5UogShpSmDQ80sElEtdUtygKgXvCEzwmuOF63SOaxsLCLW3TwwcocJXs1kTuec4uqT4FdPY0SRHgjmEa5fpih8akXi1VL2NgVXzuoGRJdWXOcBchckjIyZt0KEw0J9RhzwR+EMmOqBwXHNamyc58rPXuNqqgXGQeSGjkPeDqBx8DbW/8lPoWBynvGvAH5sz/OPFBY9KKhFbHQGa39jSVQUjj51vMpEAD+smhFsR6RF6iO4J41s7QWb0Jox426Bh2aK3cX7dZG0DLUWGXaMNj+ibogoCg3f/qPGqlqOOgyDJMO6+1tsYt0Ns6FE2Z4goMKhxmaUsicUFrNCUJbzPgi3JiDYEkdzQcO0MT/elLsQTf/saZAK6RB2RDWTdsm0zfS6ll6y73y+YdZMXBBmGrtcuH7txLyYSdQZyuLneqMlb8/ceZkcEaSMYM/cAYB+LG3cI97EdUQXySp5TgPAuCc2c309seA4dxIn2QTL3JdFpNQLuJAlY4qEEaGcJi8BgIDFmICqrcXxT/W5R4eUs7fy79YZGq/x7q/zH4OlKUN9aCj0hR3APxVMY/o2+rJ5vh7qWJU0A3wxZ7nlkGTWLKXLIDlQ8V19Xz/uNmy7Uvb5t1N7OmMWyEtWNt5JyGqptANq8fMdf1y9R5dKuxjqsh4RCNrot4/1hV/Hx1zUKaKc4j2RTJLZSwXfMq+r0uYq4Jld0pOACjnVBiUHWxas5GwhtWycjozlk1SYdaexu09QUmEMPH1eHtKODqu8+HCWfr9pa+C5zDg6oenBPJ2BiDSwNAP+0760RzhfUBYtddBkldVBw/1s93XJDbOjGOYtGzDQVdfMeoI+GfGyZ1RkTDnJrhWAycpdH+I2UQzPyOmC5iAyBs0kxTdqwiW7NfxPGqNPJT0RktMkbSB9JQVNPbgqs/r39bT3z+1OpcLP5B4KyrMAT2eJfC3ZDmFz+6MZMvSdQrmEqJ7oiW0McRwVCB8AoF4ig1/lxP3FUVwSggFKBtAF9zVCJrTZiKlAfFCDvKXhaW+42mA5bg0fTEv61v4jgCfXTiIRXDzOn2vhxZ8w65wP/QkEDwUV7xbp/gg5BB47B+uv8bZ16FxDoewlFkZpR5e9AB/QXJ3YtOU2WaE0JKfoEIXg/wAIkO2xf3XX7nwO6aFHu+cRlwKJMtVqf0Wo95lWVHps4Jrc2Cf8YjKLp4/Y8r48TV3/5krg8LMJG1j5UJ3I0KoKqwMayGiC4/pKow6VP8NDHYK8kp9MXUsPqMhdzoRfXNLECAXrZTpuBD7+tWZaaeyTNjSDvmcknkBOHocWXnYtFe55hQjQDDUE5ZECeXMzhJ2MjPqFLDUhDJI3mXdxgaHzRQKR4MD8chLOeFuCOfb+1KOEev3gISzbtCYiEusCLIqQLGLbqVqEZ6BEhpEqzTxvzIUxBLnLCIOYVlDTBdAMXRpAo8k9pzeGvw9pxijsKHwmDuoLDJW/K0KhBPrB9c6qeW+5P13GA9Z79HyNUhNdJ74qxY67NwaNxMJwwVmHMk1Rd6MiUX5N7rLryPtLhqamKmimiqSHtCQw7ysB7tg0K1dUV7eqoURr0iD0fCVW9O5ap2FBrpIr8hObU0ML7Q/bW9/qtr+jf4umCp6XoWTZjMKkUFQvmnilACLYgNIbY98Qxeb5jDv3R6vOOiGAeIJ3M74jXjC+QGDmuRwNfJ+x4P8MRyCvtKU3k4m4OKXoxoR7CtvvmITw5C2pC2IX0LLCu9m0CmLFY+TGcTUYhMplkPgf9fJZ33r7PTqDpuSIKeBWMBGOI1bu4GnU/EOAPIC0TocL6T7lpZCMtluWrKb4bfhzMS40IHu8p84H9P+3kk6ySwui/wLUKfIqtvafCM4zHwn1ffCergfM1v6qsonV2HomBk5RwxLw0kr8NCFRHZWhvRI4PI/v7ZyD8bbaMDl8PnliCi7RubQfqMh3jCOv/n+V59Vg7izFSRvEuDvSGJMgOWDTFJ97mLW3MXf/zvQdrOckZpT4NDLhMZTjmfShVQyq0rxPGmeNv2cJtgvtofeuqr6+x4QzoxpnImLTK9tfni20eQM64ma1/FkJFyDIJP69TT7kcwyS1geUphyRNAroP/nSwgj1z4VRSgl2AjdinetfEapyhvP9fRNBsrEpo2uha3vF8TeV22AxbAzw+Xat9zy7oRywXBsx3i5kbL/hUpr/i2ReenCZq7fTnZ9OF40PhiZMWUa52uCVUObgCRX6JaDrTWZHtSTtOTql26aorbPHjnWOnOfZZdihfyy3Uc4nAyjBHQQRGqoHnRPAMRbiD4ssiDT8eMEz3oaChYxfaQpvs3jBiQiIcSDlVlVBIOJPHy/75rNuq+b3hJiA5UBbuMuDURb4+gA1uB12mDs3ukbI41f4e9S7gKHXaL7H1HM/b4TpcIRO5qYNTxThXTsuy37TiBw11r2jsiPHZHU4xLVkjdiy8uhZqY7kjZTBOgFZG6pUVH1lIP6qU6wVbwLjJZFi4tMf7ILyLc2smVzPIbACdWvh4ROndhXBnsMMmUmxkWOh/CsMod3ZyO6L6ycAUxM9smy1dS2AGRt6LNPzD2Ct/SIg8kHuqaDpXvboMZLJs/s4/j+n3LOdEkaKi5Vj9oQs9NtLu+kffRBkoHxv9nN9P7kfvfSr24ZMMGBEDa6As/d7SpZcp10Atqg6mi/jXATgIQdgNeUbAfO4qwiHRZ1hFu5Ie4Q/bJvIY00OqYV08ncTzlKLF3oT/CnZXxxRpn+g/tTURboPtHK/4ERKcRQ/8EKR2bujUOAg3LD7f28y0nunr75trfy+Mt74SPbQVqvFU/jRhzqmOHqm3uafOQtPiZ4Lz1A/5utg8csfLduO1c4DxicSNS3t/Vy4k5l/i95g8Coj/xtZflNAm8g5wulrY4FmQ94mSXWOUHKtGsXNaZbc+WRGZem9YZtUKhA5yP1cfERwSE3fubNxKXxYgxPJHc4UVRjAZVJ5hvvTpegOJooQvSdBhwqokEPSAoKXXOMv9kKLRofoLhn+qHci6s3eCzbu2jIOQQiA2d+Nx96/ueCS+Uo/FP2hMGpcvG9wFSJKOlm2iCo/2lLViSqCVVFwDlFBpfAbkL0PFZICFPMWR+vQlc8Q4seSIqysJuG+J3LfAFkDbLy/hbHHvrS4fJ46dn4A9JArxgvOgt0uOlM0vsBQ25ldnuUiK/rgzSRbwBIAffr0G4ip8++VOtfHxsYR/mvL9PuLFKivibcvvz+5czEJgmVIU0KKlfEcLvCRJmo0Ogc1Zlg0vZjup+4csvnCRa8deQcLAktcuevuG9DpspgTjn2cWMYSTs0ri3KqhV2F5duKdev1gFQ8vF8hub9zq5M0MRb25FNoEnwPke5/nm8CgZYh0RCJv+c01hBSi9OUGU1W/E6EpDhxNt00TmUiwETVOEpxn4c7e1cXRw7CvPCHwvwH1Y4Ar2QMNru+XwjDZtbo1fpqlqZ2/c3+nzcb+wtsCs1ytSo4k65oV+cMp+1ezrto2I+szOurI1BCw9qDJMlT76oiDp+T+hSVJClNLGXB1LaofGhYV4suFU3sOfEhzxnADVeSNwULeCz/zSWZ2KLSrJpwfRgtjBaBKMav7UbGg6GSCUgKnzMEnff9YRXvwqoBs3wHEnyzlC1bRQCI4M6gIkei6VBDjNATMZqipK0VGyk/K71ZZIisncarVtkyAEfwMut+A5fWehzMcVIUSAIKR7IAt3zB97HaLByW9tVz+V3P9b8CYmrSlb9g5l+J5ll1esuSvY7fZwlv4HEcX0mrN5OUEnMRMh50EbdblFglEAwMdcJM24SslLn6xud2ez6qsMlcTqyoLQ6xttM/nBVZHmSDwtxNenPm6BHy3VfjmpfGdYhk8dE7daIDNyrnqJO87Ri8La7hSnfG4VinqtGp6j8Isk9Fa4MzsftLhhf2kOhaaOUSkh2J40SpJ6R85saAs5OZHl7evrZ9iLQinKfnkUTnwSzv2GgIi+i7P4ZCh/jtTJB2obkupiblBxP/MqaBhbbKzmm/m4BBO+cKaO0kSROqpdguyhJIjXvnxYiwbi8U+TPgaMNai+prFFA0YEGgEWMXXz91a3Y5W885GXDPkTB+11uc1cp8cyDtMvzcShHFtXq/pxY6S5rFSGhutMBOMdrxOLlqbl7J80ZEqg7Gs6eZvjw9b4cdLsnZL/9BqoRK06KurjQTDopF4JgM3OiJ5DKz7WEeoZNTq+8naPExL69FINwwoS5n6XSbkR90CT4F1sEjQHjlFRJ99Rs54IhuRBQGZATj+DDqVz6fFJxilPs0IbADOix4MpqXrP1ubkABZbZMODZTdTEr13kYOATxvVlkW87qY2TvhR45mdalMqNQmliwPLp5xfcaRiqNsfeD86ZjyNGEuDZY97R6qQTvqWTdzXfyjP79vTwAANAXvUSllWXCAZ46l7Ub8hpY5zourBHuLb7Wf54XNswgHHKhpUCq4WgEJG/VVPcNW4Nktq0iSLXI0SRaT6rtFFhblbbN9FM5fjR8OFIS+u7dbauPwnpfyQiakDg6kIQGEj8Pbfsbb0pcEMvJIWWjbv/zoXEASV2RvhaYBWZQ0LcBdk7woYRVhyZthZS6cBFWPiSxQDUkYtryplVYaNL6F3LROyexQGd9lY1y+frQC6Clht0tkeZFA5YQpuBVtTUJYDPf7O3GLyS+Zj2fa1lRpPJOKO8xuO3QTeVVzhcMRVHVKQXikR9J33vOiu6Z0deRuSeRvwexXzDjIH+A30mOYFhPiDDpjzyIvPxW0ZvBhdbPMYfKpQWIO7VS8ahZ4rLQF5DMyIHjUqUCSVTBZYNzwH9evNGAtT/MaEXQX3hIuWB4cwrN1oqQ03K7BWEUfYha88p6MT+w/D1eppKmDZQw8KOAPMajkPFlswf3ggCwAAQz+XDwISbP+o+YDbqWbzjU/sSwjO6I0ZvQEgF32p6VzoJdOtjcp22PKy3E+55acHti8tqFgYRmSiq98OljMwezZAv/KBFJO71NwnY8gWvd/rMFYoL1eJ2Sxho8/Pah2foABnQSc3vgKZrz3jCA5X6DXD2ctWOzKs9K2M+AZBXT0grvqqm2mfW9tkLAO4YoPH+lzuc3Sx58Cq7QSFLERrAQXP7FhdHpJAH2XBvmj3/K1kMOV5rOYjWwtyYxEwMsSKuHu/uhkkgta3C+0egmq/8H11qW43nhiT5iIYyCm9/ArvT92eJOy7woGX8j2E815h435hl0bd6RBJ2Y+hd7xPs8FiEYpF+r7/8Gh3p3M7o35FOUDiTd5WIhi222Z//vE0QevClNM8u+KTSDpsCuRFT2LLxq5BUCtRqpcb2+2cRFenSLRMwToMlkI+gyrMLnEvM3w1dATQG43ZmcR1gFm6pWRBS3z07B96izZ/UP3oiyi5LaOvYosVMLocJLKQyZzFz60Vivay8fsMNHUr5TQzXtHPtYVXUWQwyxbr1gXPmUOa2xXky8BqHLrmf2VvRefOyuoNb441L2zqEiu8HzLnOoavk4ZcMxlLil4y8oS599t8JvAp5W6qRmWwjxOAJUr2XEtk4aAxriVL08sOr7iDimVI5KJiRFE4paJOCok6NEkTJ3yl1aNpqxbnyorSvtpJngmylZMMVJ9+NgM2X/ow0i/TbaOEmkdPlLcuAtmkXUaKi4PVobirdZmkt7Hi7D/JdSqtNmXoAeACkfFVqBURQXNR/uxexGThoWqEBUVQJYwatS9ICKwQAmUpomn44AUW7e8xo2qqfWO5gPAxkAiMN1RJQNVQqEV2ODZBEQoJWuwobTdBjlU0W8dLcIs+y3fV7rJLsNst5hxDTdx1xYylX+m1IZxgcF3ewPxktLP8202qOa4UoN4ieDaQQx/hYRhw8JHuABnlasHFiz+3ffR+MXXfOpgrN6niCWhHFLP8JmWGnDvDkWgyuQ+lmhNsEF2/SlKQg2BKESEwfns5IuqNA8r6cjlY8d5B4TCR+0023HXnprSprjpur230KdhgqCR7WEl5+MjBzydspRSy/00f8Wm2eE/Ec/o4pfLLIQR98tkey2iJ4LP4y+YF4OXnTR+sdp2h30UuFYetXCwMg/7LGdJSmcD97fWRpZOeXra5IaKVMSKRuHFjQap3gEIKyCZ3tOPHkpP07kIsoyl4e0ecO0mllwMLOq+WbROPknpjviExnP75tF3iRHL9yMNHl0a+JthiawSWE2t8FqEXPzGuwDibrO6tMoEM/JeCb+IM5PohGUtD4+eT/LFT0UQR0n88H8yOBD+bpT4chm8nKzlIVaaW1y+8dTthMiZfBG6RB/6NR9G9urVa1rBOt6jc/GLkmc4f/Gh7ASmS4w4ud5thcf85L8diU7bgKUn2T84WNlEfpI4aJYkOV21/boD9E6NRUvcaCIalihaNUCVXYAxAmdWPh+VVnjOqbN4bbMVEpf76t8qlR4hEGfywOElrT5geSmBnA6AbxCf8cb6CFPGDbhMCMulgvk6UPNpn281qHsz/Q29YQHxVy9wxEQ9ZTAws7ukwREqk/lt8WHYXWCL+NeUp8SajwnfZu3+8Kq9DoJzDAphjNklVfFDEHovnlCJKQP+YHcaWLVYWC9+/EKyeMj7n/IdjoElg9YPyp7EFVp5StFtFjZ7jNKuU2/D10Ht98yCaN4/clGR2gxYRdCtLfOEp+/zE1v/+M96P6S1U3Nh0kKH1eHWYCarsu9Ay8YpCOwx6sZw+d0LAvGE2JLL8nwqpPuCw4NgNfaxA1Fjf+TvNFsM7RISuexYR2a7ugSkZrlMEKFfxWpWT5tWeobYstrBFjevp6SxxIePO+2UfLC8g2lPCPV+34GlfLuWM2l2ZmbTjzNeEi6d18L532FKRNYObCLvuhWsmdFSXUwWjvLH/Lv6RW7OZpFM/QOKF3IvLI8Bc5JrE3QRtiQKyO+v+Np6JHwUXhKNyguoT3tgZ9q6IYmrzK+UkZYWVCUbVs/MKjEselzHUe0sM21ecJ3S1BLPX1opj6jE35HCgTu6eTXm1MJeq4lBTG2zTwZVGatklgTb3FZDsMMYFqm7YBsUCeS3A77zZ0Lm5d0pJKfI8y3LVLlwVJmDqGWimryYqS9C4UxJSU/WbEh+txi3Fue+idH433MaHybnABWnzr42GWVJ2vGX7vsIgy/JD5flSaoeOoHj0MuF8LIQ+SNtPzgCIO+PCa4tAHc29R3i8SrcQZULdzpOKJOLbHHM5+8nGi1iMjwA03zGbf/NyB3CtU0YDCtTfquV7hsOfp1fH0EFkRKWgEYiyFxzRVavIT82vjv/t5vRcubfhbbVwh54b6ngHIhLkroq/rBx2gBxZhGGvSpE9m/pV5ptuf9PdKekVQCAO/Hklv6PavfFbM+G9wMBRdx6RBXt+YZyCWhVuiC865PDJ8pG+jVGdjMkhfArySOI9mJhZ/k+nmYBMxnsUEhte2snCj0+GXCI4UBSpn6i3OM/ILrZdqFUCHkemST2S0iJoK4BujqmIcKJjW6sCj4L6pDbEWIorDlXPASbaSCRU3EkH/iDOuikxL9HOP1a7Srmg05m0yq6MZKUH1tkEBKbGvYV7mtWjCrnsapQAEmgKEXE3VBSYNBLUFis7iXjkWWyyHFav2k58SY6V8iUUcTyIYHy55MnSQf4zkJPpNEVRILCXVAW6rP6L8ElKjtHJ8E85WdNRJ+Ze8WwRUe28ZeyollJhZWwexyRhgF1I9pDgB+EJpcSWxeX3UAXDMGczPbCJQvM2ZBkwS9dmikkXWGkBfu2Ka0ebMTXMQriDc9iKCaWzVO0iLxxAglK5UwQf87jCVnHQ/ZkavzARE+QLpEcvObqn/W38vX2ybIOijA9HzuldcA4bQGYzN5ax0OHTZ/7uKLnphXfKUScWKDq805cnVNag2q9thRX2fU/GBH4o9S4I17aYzBw6boiBpCY7xaZdTdirkNV62fQ9iG+NS4o40AKaYn3cq3m9svIOKeAIJr7aXUTWjO/YrmjUR+hoF1FUH/5+t7Wc9VW6mKVcz+uRdG+snqT1tlXJndMvXFNoa9fEIrO/ZepCia0Opu+++Mv2gTFo/IElvp8ZmeBPLnzQDxiAqBGpJLBKaNpTL1CmzGCdpjZgdJrkrqAqt3t5iCZZPz/8zXqgPk4oeHHgkkTIiFwt8ySjme59xviFNiIlEYNxMY26T7CjqzSLs554hHCUgQ6b9F141tlVWvkcFTiSjL2Cfuis0EHNy6SP89dEextwjIOzbIqE0vPiHKX/NtYs9N9gbbQf/rNKNLyJf/3VHkU8tcPBXxsIqIXpuOSwzlm0OJ7zkZfSoAKATfxauoc7QVOqPtlWC4JDZpFEctqKDAzszkRf2prndSiYmg8QMRRBhpnh5YCcs2WNUs1tXrH9AcUtWg3YUJHVfqTAxIsmvG55QcBSTfR0Z+0vP/me4GqLdQ/FTFcHsGkoBLtxoAEPHHKEJ0tjgCPUVgyvZIGtl69+et3D4jXZfqwFT3MyFoBzlGFOrup4rdzCpfHFXSzquomsl/E/3IzMpTuaKQfhom6EgNHE/XsP4lb54rnYwVimglT1ZOTgZmlUggey5nIBLLFogZxUhHbusNXrceJy2vLzKaSj6Id5AAT+8cZjkUPdsDij6iUt7wuWdixAUDRZVzNvLx/oLNn6DkSAFhg18wiPkDVuT1GOjjPkzjS58oEH3sLySHM8fgft6qcEF+L/+VkCqEiC9T7jcbZBjfQ1ttt349mKuf3+bQ3IMBRmog4P3TdsMrvExuOwrJoUrsShry8+YzNo2tyqb5/aVPcc7caGTCJs+JKPjBM0Mm+1huysnoDx1nIcaRg/JnDan+y0D/UT3291tFBmGbBDSsRjDTKE0QmYdJMTnxb80zGJPu6qPTckSnuIbG57Hv0FfVadZ1TKVktklm2iXf7rf/82VZipERCk2Jfjb7rdoD9OwqT4UzVxigbJmJc7ArRv0WSzhHFu9VA73BO8fd9VT8QM6n6eNCL8sT73hhNhPyfyWIuBUszhHuUjNBfRM1qbhBYizKE17aB5bZT24DxcDWu1kXybVtJnPluMhhrUEIUi4CWlgqaLUuYeQ4vxgbyeK17G43+MGbqFEfddhlQFy4o4/Majze/GYi8QDIbEgEAuZlVKFtGVNgQ9fO9IAhFulWSFMkPj9fSHe/Fk9OPwVwWzNduTMrEB5seNeti/bKoYcsDS6tNCrHYLsbZvI+U6mi56s7BCyYqI7ADQyeE2jv11vGYt1ookQpswsUR5nL81ERr0kEO7x6sancVr3/jYQWmRv85WEbE+UW+UemjCsbpZ9nGFS4zoSXw75+JAwGGOONDVYfN+NXOsxPKP3CpifiBPhU/aZEFo/25ynTJfoJ8udt0BBUwV4m7kzS3teisKWUxU9XIPAwDcjgJcZmtXHybMkBh5gDnEC9VHnYJwJQsRhb+gis8CK5mb5CoemaS900FMmNj3dXzty39jjf9xLG+F1+q1ACeuhZ/aAkD6qjA5EtF3EvihEce8Ad6pAUJ4wFnTPYhCqeH2xzQw58e1ch+kKx8lC68YDKKKU04rw4c2FWTZE8hIIgELLmUbWVBLnJKvkAUSzbrQhkgwZ9HMJ7FT4zxHInaIkKXikuVhCsXP0Q18mXBABFsFuC9a0j/1RJcrbdfs060rUQ2LyMQjIS7z/gAPmS1RrAB7Nl/arWu4ZGQRrvM5r9UWrSfT5++o58tRns3zLtyRgdnbOAdV9ri9+hDtn3WibGZjufRtMZrSdQS96K72sZe7Qd3DpSVZc4ywJErdDSVHGracW7MRS7uL7hg9ntbq7RYqyD0k8Oy19/PDJAhi0SggVvWKnH47IfWBAXNokk147pxl2hFKl+YJ1m6I2a/xVZKVV8b0B18Q2Z7pcd0DXL/V00f3USz/oE6yN+AjgD8A0Kl8u/06UWLnXHHTy2uZO0ZAv4/96K5umoMmoM1ColI4QV1vWLML9rTVueOuSEifQ6G5x2Q0QTREJQFpQWSroINBp2gVN6oJ17o6hWxWPLC0whaA94IG0c/8c6Ce8KGeAcg/3zpj7AQ6ZP0qD6duniGXgaAIbI3V6sE/GVa4qJO8eAPTt1hxbzn1tW6aXGWiFvpEiS4KfMztedIS2FjrkFhEbNILk14sm/pLZchjUgPiLJYYCFZpTiLXOsWqsrDCRb88pMRLy8+lWPIvEAfsMIrbaWISAFJfzyl8hZQWJ0FsxBkL7U2GQWO6aAztmj02mxI8D3HmctlsmR7JQuxNERFgSIsoQCOuAQoW4kpxXvjxzpouuIIVjOT77WjebWvBJu6Z7Py+LT2vndRpREMF7ExbPhuyko0kcM1cck0iSmWIh7VN9sJq6KzHgfSVVmLSqscFVjnx5eywpQ2pk8eCFK1knXV0SlASaP8n85VI/6vh4OLFhwulwy943orsyx+Z8X577FDiqzfHwhln1cF3RlWH8rFVV5EfYaVbOD21QkVYQmYGoEJuLHuBUkZot1ctpq+ttB7Ap9WDPTLTLddq2W+tMf6tAkVqBsU9o8uz5/CGEWUzPurZFZma5rI4K4ZEcboMILhOJGmUrcLo9hD3oE0yaHgaCYNOHoslerxPZ/r/3om2NwB/EhsxuUPpJeii1PV21gqKslvCe/HHYYwVFM700JfavoDExYvBQSbosvxcUpY3UMAOGCqwCsyN3BDU4LY5n+AiT2CseXRksMi8uRDrSjO467AG8IeFyHVugXNoQVv1aO+hAqBG5uIh34IIyzLidk1ykdHVtJgV+jsrl36b5iJG04+OnsM8PETgrurudtWpY5lkwJqdgHSKpidSyHPdI1vc9dNry6xdhzEOK07ZzDBK1vboeCmzA+8qdWKS4rreUXs1oq5CBV2kvDYE4WaJc5ViZ6TjnS2b3COgBYgFHAXNhEgrC+RPxohOZLvGmx7Iwe1URkyIJILh8FplayLaXj9wSs7EOMTf4luFidNZprpVd4ndfXJLgbSrpkqYCxJVFO9o0fFeuDaUAyK2eVTaFExWiRn5WGqkwl5TIll40mjd5sN2SNxwE7TJpf21e/9O5xh+9NQ+wZlmdWRqaONNdRrrp4S184brrABFfifC0nQTbICApbQ1CoNjz/wxOKtIlxU3+RmNlXVqb6a2boXcdIIEj9+e+OG/xDYTR9LMmbkfvAFwQZcPDLJhAnx7QCQkiAe8V3CgMIMqJBv6EMBXLp4QAVF12T9mVMe9Wy9VDVvsal/8kEtgwEPZyoC26wfypw8mE1oaDc/TNFD3l1xwG5u5muG6y0rFLrzlQ3zYoEGK019lDWuPV/cskZh8LGFP+aJronWAaG6FgXLWEeaOmNXcxSLQXHRUP7SlKjJ7GDqhLUg55VFw9LActbEQ7Rx5Awety12PMDR9gycQVFamm4d43hRZNl4onFwZ+k7TaE90yQj/7GEMmsD7A7asHrWhtmOtGAv97+kGCOhD55fTz4k6Iaqiuu8NdkvP7yHQSQotOLvFXqbavsGpH9Xp7ITmqRSLDkK37Yw4DrzyBgpZCkyBKMBcJgHp1zvXMhAn+6pz9SQDVMJp75UKchAPp3WO1QUcIt3y5PyD6HpE81uxFX85c73V5GFh2S2qPoKLDA/V2NwcnqB2s19Fnnk3rCcZWWCtKwvu2zWuuSL7cuDT9yBH4OhbnP4TXX7tvhP0hu0N9C30HufNFSz6QnCxF63aPHGBfUHBcbwz93Kmibsd/le7BUaN/JUzUSDynRlLQSQYrScMt3a1oG4AfhOeG0wMhYIl71yyt5VALCGL9x+8f9WLYFVrALSKPSkVIgxjQHbEY/3z+SdkrSYcegJksDPmzhmiBMn0X6uB+KcGJMIDAXfEOo5JcJ+jz0qjAEhzb7dEUMxTlMO34xwdmMT0ll7YJHV2rUuVsArDV4McXQrsVafyXRatS86oetd3zOIrXIXaz1zqZpZag1HP+YuLsCcIXuy6V42VRptcjK+X1yz/qCjyL7l7+pJDv/yBuUbJtEV/qckPxUrJn7AxK/qQ0yisL67BJL2jeOm+q3TdFOJlSL/nStSqF+cHhBLn+1ItBhsf6QaBBiZjMljawI/usXOguPvWdXOImdbRITYL/t7/S/Zor3ZoLSGdgcQQdWayFSs3vN0K9q+khbUbaxf46TIwUqo3khkbMxmQ754LqxP4KB0QiVROdh3Hi6g1LeXo339IOXSrdzcJ4nOA0rKHZI0Ru5XAQ8Q9MO7rIFJ4PhpzARRleZ0EjNjW6DTmPGB/FpeW+DtNCNHccSgNbjA5PoA1UF9B57LszSYMtnScSGntGvd0+CJ1H21UcuKXtr5t2gecOABDeBTRamAGJBdaKrqqy/uB0LydjkHMlvdkLvjikUfHp76xzsTdsZe3DtblWvmzZIJRIaBxyrRQ2QT7vlUfalAKt/xY8sD5IPS7blfBIsOEv3HhB0jE0NyA8o04uLJT7XipOzxd7GPOaGaNb42hxw7jVeNIR06tkXNezp6S7rdLC849NVY77jrbzd/2KBp+NKoY9sSh6Z7CPxvvsBJMuRh82uae5k3N9a2g6zJpnqB/2xDWUH7OGFWbJo6xHoLZniXD45Z5JVmvxvP7v9J2dN7YiiW519LWWEp90nEVOvcvrGqRKeDlIey7SXv6VkmbtXwBwj8Qv3g5B/JbAobErV69e578d63t2QVNojttAZpyGpLgxAbKEALhoIhletTHHZpuq1k4tmzQ65eLeTENFG1JbIC5mChHXI4RXDpfffe6yO/iJGA5v61JUsEEFgebdmFe1SGBBY8v3Ndklo5ZK89RBopXPMORQQFB26zmZbZMYo4OndgGUuF6VkDUX2+SxtQKE0dl0IBslD4NHzgN6v0D0EqTqElATAGNDaYXQVfTScYRvO88QygWR0e8i6ts78qVhJOIc+cUp9fA/v8F9WPEopLJsyK/h/C2D1aoKnkq4pfvaXLDqzqAu0K5dHziz4SRN/OHwD8snyLsRNOfUvsVA09LHtVg8eSUO98w7nb7RcyDdM0VW7q9p8mWFiXEbvfwLKnYcylC0z+HPuQBQRoSKKiPXjZdNCvEfA5ALw928d+yhHUVlxbPdsET/Fs/ySVZWlVSX5vbZeu6C5TSAgrLDl//D9+bYgvCM+NUyLP2GWx7Eg21I6osp8cfXwRFwYdPuKVt6QczT+R6olwzRH1lewmaISLelNDKRk9q9ATbbupTkzPm2y59NmxHh/3wXEFuroSD8lpd9WKb8TGq+AN3HyIhSyqzbxaqAgJo5goWaV1JD2h0QsqJ+/WOGJGb/015IVpYNemhVVh2I59A1UbUE+eUzmYa6U0MJlxm3DDe6R9kAtIInD4D7XDs09jLb0jzDgQ3966lF4mMxI/KYcQBoFsWIYuf4ndgz04RGpwKIOqzLPbQuAmXxpd7mBd1lwB4IT8twzSi6bk1MTTgz14RYxaZ6wCjRSY6KRC33bvO+d2zz9jvWiRyOkTz7lEo/mmsGop3hoDioEmtSvBtnsp97TX3S8pKgj/WSNl25DQ6OB+nlhrjGApkW1gYhGN/BAoUzfULeKJQSn8Z0VD36bb+jG6dMpfkVU9ZO1pSxhMIT3Ly/WwAijN7vRG9d40w5es8QDdCn48Gxj76xTlYpaY/5lT3U05vv2NYss6coOcTn9UesUszZB8W+Ds0Bx6ttkyrv+9pGWOuEx+3jgLDkaGyIFIZQSTjJN5rj4zbAcjtcGpAqzL3ZuwHcq9tMcQmnhpVN5LqXMwgjX6Z/6/IodoaH7irvVJ/geyZg2UMnrnaOwsAnFBKQbMvXnYdMMIyx6HXZPpd5N47hTLDDz0sBwurzAALxOLkvauYZV86lVVHseDbgvJkr+Zs0gh6ayBU5CPSzzz5NEuEWYYeUxQvmV10wcULUg90Avhbv8Kf6UW1UV5DCoFRcHHSlHcbghQEqGiT0hCL6bux/CVtCsH0FloZF9f0oB7DgEr45l30Rf80GEg1vIM0mJYTSf3FbUY+MuZxaJK+LaxcUg4WzqFFl2BzfFevgRiK5Me63OXCNOMlqtBfrD7wSdECxrDuPnqUI3wVkDt+zNuTmEqhjZbjdnzRpczWmQd8StcCK7GPkbG9i7kh8+SOwHWxgDSA9iK+JOxHoMybKlj1ojz21Ia7xW2Drkz4ny+GnO2BUYtxG0e8hIGusnnz7Vak6Wc9+zPlwDM2Uflv8D4nnkt3eXv7w9EHOqfRk1WPPtGcvzzWzU3q28vPBdc7Rba4VHD10BqQHCSMY4vMvNL2Yxf/SOTAyAhrteBKkG8GKH8sD0STlQvMUKtTrXY2H3edvXW240ZMo/3rdBrf8pn3CUoJwIkBjKc1Q84107KqDKhhnEPiuTmGFa0fuM5dA7O9UNCTdm9dxeVvCu/6a72DqhTgdK1WLh1B/GnQlAivrbaCk19/5MhSw5zehcpPo9YlU6BzFeM8bppt+lIoOPorhPef56juvIXi/4PId7SFW+kWB4G4WAmT9ezH6gI0bIY4bbI32IrZMEP3vkX8i0eFO4RHawBj9kDl7rPzqYCAXoBayW7NDboWSudMAppKDTDgPsF0QkQhRkEYMKrob5I0Uo2DruhDjlc6aL6ZwvJbZ5FhI/TRnE99DX5I/mTNlSSQbngZ5q+EecrR7QPcmYTiJz0bZDBgNfooTZEvmYlgkr7CCDtc8yO/aRrabYsr2p3+QkTrJNA1/78yaFrEnyPHoCuRchRMtAMruJEG+zVd+2XlkJ0LjzEQ1/CCvLTkwPYU9ImhWepC7rg1r+ua911ac4oxRFgxTLX/AkgZ2/Ampng4/apqv+7mPTXhKFAzGVu2BUI+Hf5NP84aG08yIAoqE+Z+Pt/SZVecYwtoHMS3vP6yInuG5qS0NVeE+hhSXk01KhmxbZiR9UctfJelR+UXtRTlRV8WpEK9gQRl+K+pH9ahCd6RQj9LWvh2Hy02V7b0lF6Y2YhKMUfTs9YHiQoHbJqPd0H+JM4ybcNUOxI0wO8CVL3bkJevVIsm2a28vfj5yE7B6r4VkVa9Cx86tjJ9W6dhjyYAN62IlHpQlNAQaBzbr7myCdjSevBROHcQxcm697ThFAs3v32Czv8X0pzRQ9CqK56zRh1itJ6aDvcH93SFUbNubZS9vXClfFtu7WXNLVO/quCt0L43JmXSI/NcXuAM5fGHmn60qaW3//Ap0RAMyDeG+7cTUz8AGTKZnJnTjGOcsr028i3vuguwMzyFNRAjrJf1Y5AmpZqub+JXnaaMCv6hFTfbsnYTkjJOKSFi49Tsld3ijgH933MFlwZOA0Y1n0/LP1t/59BUcU2C0qzyVvsBqy3jTX5c7ztU2RfTYbPgkXAdJyGJ3U4m5qYstsHmTMYnTWA2oRHlVqy/JlI/SLbz0kd1Eqvw8r4/z+0u+Z53iw1VO+++89p4cjfs9XANUwdKF7ZJHZ0+11hwfJdMN2j5tGd7s3+os1pANQXeiTSPJYWKqYVm+KklA9GJ4VtABfjgefBd4HwxAe3MQB1wkds9waPQsZO2A/cIc1GW5ikQmm99SsmMfM1slmyK4cyF6fU82okQL1fhv/k2+PF42HBeq78s+UmurrA8A+gDrJcKGockglmVNL/vxYDNU98qSUZiibtdPJLHK8jLQuBWJOFS8GsQXnyr6FAbm2VmU4E2C3UfaElKKOP9czkbYLkzdI8hCwNBqbmkOL3IgqvQLTbxgyAVMTC0onISs0xLus8wNz6+AVkhGa9THptbGyhHcXopyDdY8TioSP19QqxVFbLrDpBn0JUKv92ueEg1zr98i/muVQUWdmebZRx8oXVzG438H1ytaucX/4kLjOqa+4iSWDtzkWlfFj9+3j0CpbAXFtfpTY76P7aTYXRlZewd5rcRPE+HrptHaojw80CtCF5VtMa6yIBp1Gkkwf3Mz9azWPvB1h6FW84vOPVh/wq/gwD3WCFHRA4fgyCf1KjXkmhS/lZcP8jyoq3Od405movqSDymm4/JBh9XoOrqN928RWzwHwGug2EcXWYAeg8jh2LVQO2K+4DRxyZF1XFKztEi4pDAGDLA1hKwvGptcTJmPhFidaCrinz+ETmL5+vQ7dJAXnGAk0BVX8BL7unXTwg4wcaqKN27+fFs8J2QbI3eEsIRVer9fcBJ+fyQLj81InVmm4L0lNNi4kGyA3yBuHm4VVwhmRt996wZ2ahOqg6Rk32dOEDdxMkGG5L3fXJ3H+dMxSYX467tHxtpAb9f1TGO8dstNoZ0xz+wwxTb8mOt9Kg3UmaoKNEbndUcBeJswH/yXN9Vu/LG7wghInRmt+NwTc95DBl9KWW4P+DG1xUSCAeMHp8EBFtJyS5rlejTGzmVBzRvse37yykj8C6BD4JHx+EWROJ/3g0pzT4Bh2O+aEvjxcA0ZSt4Eacir4ikS71qyV0suTD1/OZCI4kPsJzeqbx3YDY4EtMrrvOLQ+ze3VKCL38N54+r8r5EYtORn0qTHGC+NWqSAQDNMhPyi9Z5qHh0kYkp1H31bGg3/F/qHN4tXKxKe4I1B+VwXdnRmOUsGnNkgEO7R3xVbfb0kwjwCkMaTjq5dmNQDhwSkmFZhHlxxAgSWxnlGhqSlhW1ZrWyzcl6n2TeV1V8bAzl2PZQr9xe17AKigDeRbBGdPBpV/HuUOrlhyikvV0KkzDIFLSzOsxzRXbrGrph8/iHgce7OCTcrY5euQtrdi6T9YojNVHLxBRISZSxwM/ltDwn2nz3cQMAFA94eH8ZPItdxGi879iFIQcs1opX+ttNExGHLX0M9ztJBD8mJsXYZjVj3uOVWdoLOYRI3XF89+cNYCCp2AnqRcMzGTAn8cIOmzaa6VTZbMnmHD47eKhXQf9X/rYe/RUpaooR101CghiZeuvzSxZkVc9dlPdEl3+KyWu2fCC6y5GCUmoZPyMxKH8t4YIHHJyK1nCjlVQhlO/vW3yxipIfcU1MPDgYbpj3a9GMsm/I4y9Tq5XBqrZNlWh/bOkGoFIEmQwnCh1FNAxyngAjRSm3v4rR0KSNbSIHj2PDnVZbhvp6f68CXVkoqljZElAdMpTOB8T1ajQSv98LnmcyQIn7MCkAsyTfD2s8eiuu9EUhBTGXyCMDdsyiLbEFR84OZTLt/r1h3vnJwbXzMSpuVZGkhSBg+J+vpjZa8RbcZGjaWKHUkrqpYcEN/Dc0q73ine2FHYvt2uZZC6YA9D9mLtuu3O2Mfzh9Qg0k4x30FR69G4QWHycr1CprDjM65Zkvk1k8NFtGqoZs2LAHJWxKuIa7FWdngdt80rPW/OCvMUiQGe5T+6vtEnqG8BupLyvTyZXQHesakR3dVzz2nnUk4f0eWSNncZbL8t24h9pCIePUCI9lOsH7zM0caUOGnitDKIMII6RdrG32+/rwiJwAx9yD7FD7ewVvDsg+9i5LCNY2sktvlrP85YdAI4asQFzRkos8uGOB3ZD6V34wLHTjIrrwJvvzeLTxKTWHAcMRbcHqsSIXoAu0Tm/itT2SvvLq3eE30uI1aPX1AkgdhiBB+AeFX4vbDfIE/Z2rDoOkdmw8wEOGWkEUw04YVCmUN/q/vUkuW5m/0MYjseNZzgf65v7yPnM/aoLGN2T2PVpwuw5F5FnxVcBvZstT0BNKdZdSfZzFyPXFNnqVRs87TDE7AhgB
mythos-5 — 149 chars · 0/16 facts

There’s an issue with the selected model (claude-mythos-5). It may not exist or you may not have access to it. Run –model to pick a different model.

mythos-5.1 — 151 chars · 0/16 facts

There’s an issue with the selected model (claude-mythos-5-1). It may not exist or you may not have access to it. Run –model to pick a different model.

Cursor

Grok 4.7 High — 13,143 chars · 16/16 facts

This is a Chinese explanation organized solely based on the README you pasted, without adding any commands or parameters not mentioned in the README.

I. Project Summary

Gadgets is a collection of practical tools accumulated during daily development, covering five areas: AI conversation daily report generation, paper discovery, performance benchmarking, blog automation, and document translation.

Each directory under tools/ is an independent tool that can be used separately. The common/ in the repository root is the shared infrastructure, installed via pip install -e ., providing LLM calls, JSON parsing, disk caching, atomic writes, translation, and Hugo deployment. The development workflow (planning / execution / change tracking) and all Claude Code skills are not in this repository, but in the independent repository ai-companion (git@github.com:TzJ2006/ai-companion.git), checked out to the sibling directory ../ai-companion/, and connected to this repository via hooks.

This README is an overview. Step-by-step operations, configurations, data formats, and FAQs for each tool are in TUTORIAL.md as well as in the source code documentation of each tool. The Chinese version of the README is at docs/README.zh.md.

Repository Structure

gadget/
├── tools/              # 五个独立工具(改某个工具就进这里)
│   ├── summarize/      # AI 对话日 / 周 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译
├── common/             # 共享包(LLM / 缓存 / IO / 翻译 / Hugo),所有工具都依赖它
├── scripts/            # 运维与维护脚本
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 全部生成物(已 gitignore,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议(动手前先读)
├── CLAUDE.md           # Claude Code 的仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置(pip install -e .)

build/ and gadget.egg-info/ are generated by pip install -e ., are gitignored, and are always in the repository root. Synchronized data uses python scripts/sync.py.

What do you want to change Where to go
Logic of a specific tool tools/<tool>/
Shared capabilities (LLM / cache / translation / Hugo deployment) common/
Data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Development workflow / skill ai-companion (sibling directory ../ai-companion/)
Plan / Design documents docs/ecl/, docs/

What Each Tool Does

Directory Function Key Technologies
tools/summarize/ AI conversation daily / weekly / monthly summaries (multi-device two-stage architecture) Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Paper discovery + researcher analysis + citation graphs arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
tools/benchmark/ Cross-platform CPU/GPU performance benchmarks PyTorch, NumPy, Plotly
tools/website/ Hugo blog (incremental media compression + automatic build and publish) Hugo, pngquant, HandBrakeCLI
tools/translator/ Gradio document translation based on common translation engine Gradio, GGUF/transformers
common/ Shared infrastructure pip install -e .
scripts/ Operations scripts (rclone sync, machine configuration, etc.) rclone, Python
../ai-companion/ AI code change tracking + planning/execution skill pipeline + all skills Node.js, TypeScript

Summarize: Reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLMs to generate structured daily, weekly, and monthly summaries. The multi-device process is: each device exports conversation logs, which are aggregated via cloud drive synchronization or manual copying, and then the final daily report is generated; once enough daily reports are collected, weekly and monthly trends can be generated. Through ccusage 20.x source-based commands (ccusage claude, ccusage codex, ccusage gemini…), it automatically discovers and statistics the token usage and costs of various agent CLIs. The four AI summary backends are switched uniformly via --api: ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, openai.

Research: A single entry point tools/research/research_scout.py with four capabilities:

  • Paper Discovery: Searches arXiv / bioRxiv / PubMed using a three-stage LLM pipeline (fast screening → deep evaluation → citation impact), generating research weekly reports and deploying them to Hugo. Supports conference paper search and author search.
  • Deep Paper Insights (--insight): Downloads full texts, analyzes writing structure, publication strategies, and reusable core knowledge; automatically matches OpenReview to obtain reviewer comments and analyze consensus and divergence; synthesizes these into research writing guides across papers.
  • Researcher Profiling: Retrieves paper and citation data from ArXiv + Semantic Scholar to generate research trajectory analysis and calculate hierarchical scores; automatically discovers mentor–student relationships through homepage extraction + co-authorship patterns. Supports name disambiguation and reverse lookup.
  • Citation Graphs: Performs forward citation / backward reference analysis based on the Semantic Scholar API, supplemented by LLM impact interpretation.

LLMs are also switched via --api: ollama (default), claude_cli, anthropic, openai.

Benchmark: Cross-platform CPU/GPU FLOPS benchmarks, measuring floating-point performance uniformly across different hardware vendors and precision levels. Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU); OpenCL may only appear in --info detection. Precision includes FP64 / FP32 / FP16 / BF16 / FP8 (experimental). The measurement process consists of warmup + formal measurement + statistical analysis (median, IQR outlier removal), and explicitly performs GPU synchronization to ensure timing accuracy. Results are appended to a CSV (not overwritten, allowing for natural accumulation of multi-hardware leaderboards), can generate interactive HTML reports and leaderboards with Plotly charts, and supports deployment to Hugo websites or submission to public leaderboards. All commands must first run cd tools/benchmark.

Website: A Hugo static blog (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/). Built-in incremental image/video compression: only compresses media that has changed since .last_build (images via pngquant, videos via HandBrakeCLI). Bilingual translation uses local models (default Ollama; falls back to vLLM on Linux, and transformers on Windows; model tencent/Hy-MT2-1.8B is automatically downloaded upon first run, without using cloud LLM APIs). Automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly by the deployment pipeline into tools/website/content|static (the unique Hugo content root; files marked with gadget_generated will be written, while handwritten files without this mark will not be overwritten), then translated, compressed, built, and pushed. tools/website/public/ is another deployment repository (tzj2006/tzj2006.github.io), which is automatically committed + pushed by the build script; do not commit directly to it.

Translator: A Gradio page based on the common translation engine, with a style similar to Google Translate. Translates text and files (.md / .txt / .pdf / .docx / images) while preserving Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected). Local inference, not a cloud API. Automatically selects the backend via common.engine.create_engine(): if the model tag is already pulled, prioritize ollama; falls back to transformers on Windows, prioritizes vllm on Linux, and offers llamacpp (GGUF) for low VRAM. Models stay in memory (warm), with lazy loading on demand when switching models. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), which is automatically downloaded upon first use; can be overridden by GADGET_TRANSLATION_MODEL or the model management in the interface. Source language can be set to auto (detected by CJK ratio in text); when the target is auto, it performs bidirectional translation between Chinese and English.

common/: The shared layer that all tools depend on.

  • LLM calls (unified two-layer API, four backends: ollama default / claude_cli / anthropic / openai)
  • JSON parsing and repair
  • SHA-256 disk caching (namespace + TTL)
  • Atomic writes and content hashing
  • Local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation
  • Cross-platform Hugo deployment

scripts/:- sync.py: Centralized rclone data synchronization (push / pull / status / bootstrap / config), covering summarize / website / research / benchmark / backups; there is also a special category dag used for generating and deploying DAG sites. Configuration is in the sync section of the repository root config.json (paths can be overridden via GADGET_CONFIG).

  • onboard.py: Repository-level one-time machine onboarding. Fill out a YAML file (tokens/onboard.yaml), run the script once, and it automatically completes SSH, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.
  • smoke.sh: Read-only smoke test (--help / --info / imports; does not call LLM, does not connect to the internet, does not write files).
  • serve_local_llm.sh: Creates an Ollama variant tuned for summarize and prints environment variables. Persistent switches are written in the summarize section of the repository root config.json (paths can be overridden via GADGET_CONFIG).
  • Others: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU analysis).

ai-companion: An independent Node.js repository, checked out in ../ai-companion/. It records function-level code changes, generates tests and HTML reports, provides a /idea → /ccplan → /ccedit plan–execute pipeline, and hosts all Claude Code skills. This repository integrates via hooks under .claude/ and .codex/. It serves as both a standard Claude Code plugin and an equivalent Codex integration, ready to use upon installation without building (the change tracking hook is a pre-built single-file artifact submitted with the repository). Methodology skills: ccplan planning, optimize optimization, cchypothesis debugging, repo-audit auditing, repo-tidy tidying. Domain skills: summarize code overview, slurm-gpu cluster detection, nature-benchmark / NIPS-2025-paper paper writing advisor. This repository no longer contains the skills/ directory. For installation, see ../ai-companion/scripts/install.ts.

New Server Onboarding has two complementary paths: this repository uses scripts/onboard.py; system-level one-click installation for Ubuntu 22.04/24.04 (SSH public key, Claude Code, Codex, Superpowers, Ponytail, AI Companion) has moved to ai-companion: ../ai-companion/scripts/onboard-server.sh. After the repository split, --companion-repo is passed directly to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), and --companion-ref is no longer required. For usage, see bash ../ai-companion/scripts/onboard-server.sh --help.

Output Directory outputs/ (gitignored, can be automatically rebuilt):

outputs/
├── logs/         # 中间产物(导出日志、运行日志)
├── reports/      # 最终报告(Markdown、JSON、HTML)
├── cache/        # LLM 缓存、搜索缓存
├── data/         # 结构化数据(CSV、JSON 画像)
├── images/       # 图表和生成图片
└── backups/      # 强制覆盖备份(website-force 等)

Hugo site content is written directly to tools/website/content|static, without a separate outputs/site staging tree.


II. First-time Use Tutorial

Detailed step-by-step operations, configurations, data formats, and FAQs can be found in TUTORIAL.md and the documentation of each tool. Below are only the steps and commands mentioned in the README.

1. Environment Preparation

  • Python 3.10+. Recommended conda environment AI: conda activate AI
  • Node.js 18+. Only the independent repository ../ai-companion/ requires it.
  • Specific dependencies for each tool can be found in the corresponding requirements.txt within their directories.
  • Website / translation functions default to local inference: Ollama, reusing the same chat model gemma4:26b during translation; falls back to vLLM on Linux and transformers on Windows; these two paths use tencent/Hy-MT2-1.8B, which is automatically downloaded upon first run.

2. Installation

Install the common package, along with extras for summarize / research / benchmark / website. all does not include the translator; the translator must be installed separately:

pip install -e ".[all]"
pip install -e ".[translator]"

If only installing the website (including torch + transformers for translation):

pip install -e ".[website]"

If only installing the translator (gradio + GGUF translation stack):

pip install -e ".[translator]"

pip install -e . will generate build/ and gadget.egg-info/ in the repository root, both of which are gitignored.

3. Configuration

Tool settings are located in config.json at the repository root (gitignored). Copy one from the example:

# README 写的是:copy from config.example.json

That is, copy config.example.json to config.json in the repository root. Use environment variable GADGET_CONFIG to change the configuration file path.

Environment variables related to configuration (mentioned in the README):

Variable Purpose
GADGET_CONFIG Overrides the path of config.json
GADGET_LLM_BACKEND Globally switches the LLM backend
GADGET_TRANSLATION_BACKEND Selects the translation backend
GADGET_TRANSLATION_MODEL Overrides the translation model

LLM backends are switched uniformly using --api: ollama (default), claude_cli, anthropic, openai. You can also use GADGET_LLM_BACKEND for global settings.

The translation path is selected by GADGET_TRANSLATION_BACKEND: ollama (default, local Ollama, reuses the existing serviced chat tag gemma4:26b) → llamacpp / vllm / transformers (in-process, model tencent/Hy-MT2-1.8B).

tokens/ stores API keys and access tables; it is gitignored, so do not commit its contents.

One-time machine onboarding: first fill out tokens/onboard.yaml, then run scripts/onboard.py (the README provides the script name and this workflow, but not the full command-line arguments). It will configure SSH, Claude/Codex authentication, pip extras, tool configurations, and rclone bootstrap.

System-level installation for Ubuntu 22.04/24.04 servers is in the sibling repository. Check the help first:

bash ../ai-companion/scripts/onboard-server.sh --help

After the repository split, --companion-repo is passed directly to git@github.com:TzJ2006/ai-companion.git, and --companion-ref is no longer needed. Installation instructions for ai-companion itself are in ../ai-companion/scripts/install.ts.

Cross-device data synchronization requires a configured rclone:

python scripts/sync.py
python scripts/sync.py push
python scripts/sync.py pull

The README also lists sub-capabilities of the same script: status, bootstrap, config. Configuration is in the sync section of config.json. Overridden categories are summarize / website / research / benchmark / backups, with a special category dag (generating and deploying DAG sites).

Read-only smoke test (does not call LLM, does not connect to the internet, does not write files):

bash scripts/smoke.sh

Prepare a local Ollama variant for summarize, and eval its printed environment variables into the current shell:

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent switches are written in the summarize section of config.json.

4. Summarize: Daily / Weekly / Monthly Reports

The recommended entry point is python -m summarize. Old entry points python tools/summarize/daily_summary.py ..., weekly_summary.py, and monthly_summary.py are still available (backward-compatible re-exports), but the new format is recommended.

python -m summarize daily export                                   # 阶段 1:导出所有尚未导出的日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步所有日期并按天合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报并部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报并部署
python -m summarize auto --deploy                                  # 一键全流程:export → merge → weekly → monthly + deploy

Multi-device usage (workflow described in README): Export chat logs on each device, aggregate them using cloud drives or manual copying, and then generate the final daily report; once enough daily reports are accumulated, generate weekly and monthly trends. Token usage can be statistically analyzed via ccusage 20.x by source command, e.g., ccusage claude, ccusage codex, ccusage gemini.

Backend switching examples (the four values for --api are in the README; below, the default and the other three are appended to existing subcommands according to the documentation):

python -m summarize daily export --api ollama
python -m summarize daily export --api claude_cli
python -m summarize daily export --api anthropic
python -m summarize daily export --api openai

For step-by-step instructions, see the Summarize section in TUTORIAL.md and tools/summarize/tutorial.md.

5. Research: Papers and Researchers

The entry point is tools/research/research_scout.py:

python tools/research/research_scout.py report --project my-project        # 全流程:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由来源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图(arXiv ID 或 DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

For deep insights, use --insight (the README explains the purpose of this switch: download full text, analyze writing and publication strategies, match OpenReview, and synthesize writing guides). The LLM backend is also --api: ollama, claude_cli, anthropic, openai.

For step-by-step instructions, see the Research section in TUTORIAL.md and tools/research/TUTORIAL.md.

6. Benchmark: Performance Benchmarking

README note: All commands below must first enter tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                # 跑全部基准(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 只测 CPU
python -m benchmark.cli --gpu-only     # 只测 GPU
python -m benchmark.cli --report       # 跑基准并生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告并发布到 Hugo /benchmark/

GPU will automatically detect CUDA / Apple MPS / Intel XPU. OpenCL may only appear in the --info detection output (this is mentioned in the README, but no separate --info command-line example is provided). Precision levels: FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Results are appended to the CSV without overwriting history.

For step-by-step instructions, see the Benchmark section in TUTORIAL.md and tools/benchmark/tutorial.md.

7. Website: Hugo Blog```bash

pip install -e “.[website]” # 安装依赖(含翻译用的 torch + transformers) cd tools/website && bash update.sh # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages powershell -ExecutionPolicy Bypass -File tools/website/update.ps1 # Windows(脚本会 cd 到自己的目录) cd tools/website && hugo server -D # 本地预览(开发服务器,包含草稿)


The site address is `https://tzj2006.github.io/`. Automatic content writing goes to `tools/website/content` and `tools/website/static`]. Files marked with `gadget_generated` are generated files; handwritten files without this mark will not be overwritten. `tools/website/public/` is the independently deployed repository `tzj2006/tzj2006.github.io`}, which is committed and pushed by build scripts; do not `git commit` directly inside it.

For step-by-step instructions, see the Website section in `TUTORIAL.md`}, as well as `tools/website/CLAUDE.md`}.

### 8. Translator: Document Translation Webpage

```bash
pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio 界面(在浏览器中打开)

Translatable text and files: .md, .txt, .pdf, .docx, and images. When the source language is set to auto}, it detects based on CJK ratio; when the target is set to auto}, it performs bidirectional translation between Chinese and English. Default model is tencent/Hy-MT2-1.8B}, GGUF variant is tencent/Hy-MT2-1.8B-GGUF}, which is automatically downloaded upon first use. To change models, use the environment variable GADGET_TRANSLATION_MODEL or perform model management within the interface.

The backend is automatically selected by common.engine.create_engine(): if the model tag has been pulled, ollama is prioritized; Windows falls back to transformers; Linux prioritizes vllm; low VRAM uses llamacpp. You can also specify using GADGET_TRANSLATION_BACKEND: ollama, llamacpp, vllm, or transformers.

Interface wiring is in tools/translator/app.py}, translation and file logic are in tools/translator/core.py}, and the shared engine is in common/engine.py and common/translation.py}. For step-by-step instructions, see the Translator section in TUTORIAL.md}.

9. Where outputs are located and what NOT to commit

All generated items are in outputs/: logs/, reports/, cache/, data/, images/, and backups/}. This directory is already gitignored.

Do NOT git add these things:

  • Automatically generated content
  • Data synced via rclone
  • Build artifacts build/, gadget.egg-info/
  • Deployment repositories and theme repositories under tools/website/
  • Keys and access tables in tokens/

The license is GPL-3, see LICENSE}.

Grok 4.6 High — 11,015 chars · 16/16 facts

Everything below is based solely on the README you pasted; no commands or parameters not appearing therein will be added.


1. Project Summary

What it is

Gadgets is a collection of useful tools accumulated during daily development, covering five categories of capabilities:

  • AI conversation daily / weekly / monthly report generation
  • Paper discovery and researcher analysis
  • Performance benchmarking
  • Blog automation
  • Document translation

Every directory under tools/ is an independently usable tool. Common capabilities are concentrated in the common/ package in the repository root (installed via pip install -e .), including LLM calls, JSON parsing, disk caching, atomic writing, translation, and Hugo deployment.

The development workflow (planning / execution / change tracking) and all Claude Code skills are not in this repository, but in the independent repository ai-companion (git@github.com:TzJ2006/ai-companion.git), which should be placed in the sibling directory ../ai-companion/ and accessed via the hooks of this repository.

This README is an overview; step-by-step operations, configuration, data formats, and FAQ can be found in TUTORIAL.md and the source documentation of each tool. The Chinese version of the README is at docs/README.zh.md.

Repository Structure

gadget/
├── tools/              # 五个独立工具(改某个工具就进这里)
│   ├── summarize/      # AI 对话日/周/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施(LLM / cache / IO / translation / Hugo)
├── scripts/            # 运维脚本(sync.py、onboard.py、language.py、profile_translation.py …)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 全部生成物(已 gitignore,可自动重建)
├── AGENTS.md           # 所有 AI agent 的工作流协议(动手前先读)
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ + 各工具的打包配置(pip install -e .)

Supplementary notes (original README):

  • Workflow engine and skills are in ../ai-companion/}, accessed via hooks under .claude/ and .codex/}.
  • build/ and gadget.egg-info/ are generated by pip install -e .}, are gitignored, and always reside in the repository root.
  • Synced data: python scripts/sync.py}.
What do you want to change Where to go
Logic of a specific tool tools/<tool>/
Shared capabilities (LLM / cache / translation / Hugo deployment) common/
Data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Development workflow / skill ai-companion (../ai-companion/)
Read plans / design documents docs/ecl/, docs/

What each tool does

tools/summarize/
Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls an LLM to generate structured daily/weekly/monthly reports. Multi-device two-stage process: each device first exports, then aggregates via cloud drive sync or manual copy to produce daily reports; once enough daily reports are accumulated, weekly and monthly trends are produced. Automatically discovers and statistics token usage and costs for various agent CLIs via ccusage 20.x source commands (ccusage claude, ccusage codex, ccusage gemini…). Four summary backends can be switched uniformly using --api: ollama (default, local, keyless, Qwen3.8-27B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, and openai.

tools/research/
A unified academic research toolbox with a single entry point tools/research/research_scout.py}, offering four capabilities:

  1. Paper Discovery: Retrieves from arXiv / bioRxiv / PubMed using a three-stage LLM pipeline (fast screening → deep evaluation → citation impact analysis), generates research weekly reports, and deploys them to Hugo; supports conference paper and author searches.
  2. Deep Paper Insights (--insight): Downloads full texts, analyzes writing structure, publication strategies, and reusable core knowledge; automatically matches OpenReview peer review comments; synthesizes research writing guides across papers.
  3. Researcher Profiling: Pulls papers and citations from ArXiv + Semantic Scholar; LLM generates research trajectory analysis and calculates graded scores; automatically discovers mentor-student relationships via homepage extraction + co-authorship patterns; supports name disambiguation and reverse lookup.
  4. Citation Graph Analysis: Performs forward citation / backward reference analysis based on the Semantic Scholar API, combined with LLM for impact interpretation.

LLM switching also uses --api}, with the same four backends as summarize.

tools/benchmark/
Cross-platform CPU/GPU FLOPS benchmark, unifying floating-point performance measurements across different hardware vendors and precision levels. Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL may only appear in --info detection). Precision coverage includes FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Measurement process: warm-up + formal measurement + statistical analysis (median, IQR for outlier removal), with explicit GPU synchronization to ensure timing accuracy. Results are written to CSV in append mode (does not overwrite, naturally supporting multi-hardware cumulative leaderboards); can generate interactive HTML reports and leaderboards with Plotly charts, and can be deployed to Hugo or submitted to public leaderboards.

tools/website/
Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/). Includes built-in incremental image/video compression (only compresses media changed since .last_build: images via pngquant, videos via HandBrakeCLI), as well as local model bilingual translation (default Ollama; falls back to vLLM on Linux, transformers on Windows; model tencent/Hy-MT2-1.8B is automatically downloaded upon first run, without using cloud LLM APIs). Each tool’s deploy pipeline writes automatically generated content directly to tools/website/content|static (the unique Hugo content root; marked with gadget_generated]; handwritten files without this mark are never overwritten), then translates, compresses, builds, and pushes. tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed and pushed by build scripts—do not commit directly to it.

tools/translator/
A Gradio-based document translator using the common translation engine: a Google Translate-like local webpage that translates text and files (.md / .txt / .pdf / .docx / images) while preserving Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected). Local inference, no cloud APIs used. Automatically selects the backend via common.engine.create_engine() (prioritizes ollama if the model tag is pulled; falls back to transformers on Windows; prioritizes vllm on Linux; uses GGUF via llamacpp for low VRAM), with models kept in memory (warm) and lazy-loaded on demand when switching. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF); automatically downloaded upon first use; can be overridden via GADGET_TRANSLATION_MODEL or in-GUI model management. Source language can be set to auto (detects based on text CJK ratio); when the target is auto}, it flips between zh↔en.

common/
The shared layer relied upon by all tools: unified two-layer LLM API (four backends), JSON parsing and repair, SHA-256 disk caching (namespace + TTL), atomic writing and content hashing, local inference translation engine and bilingual content generation, and cross-platform Hugo deployment.scripts/
Ops scripts: rclone data synchronization, new machine onboarding, read-only smoke tests, local LLM environment, Hugo bilingual audit, translation engine GPU profiler, etc.

../ai-companion/ (standalone repository)
Records function-level code changes, generates tests and HTML reports, provides the /idea→/ccplan→/ccedit planning-execution pipeline, and hosts all Claude Code skills. It is also packaged as a standard Claude Code plugin and an equivalent Codex integration, ready to use upon installation. This repository no longer contains the skills/ directory.

outputs/
All artifacts are centralized here (gitignored, can be automatically rebuilt): logs/, reports/, cache/, data/, images/, backups/. Hugo site content is written directly to tools/website/content|static, with no separate outputs/site staging tree.


2. Usage Tutorial for First-Timers

2.1 Environment Preparation

Requirements provided in README:

  • Python 3.10+ (recommended conda environment AI)
  • Node.js 18+ (only required by the standalone repository ../ai-companion/)
  • Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • Website/translation functions use a local inference engine (default Ollama; fallback to vLLM on Linux, fallback to transformers on Windows); model tencent/Hy-MT2-1.8B is automatically downloaded upon first run.

Activate the recommended environment:

conda activate AI

Additionally, please read AGENTS.md (workflow protocols for all AI agents before they take action) and CLAUDE.md (Claude Code repository guide) in the repository root. For more detailed step-by-step instructions, see TUTORIAL.md.

2.2 Installation

Install the shared package common/ and tool extras in the repository root.

Install common + summarize / research / benchmark / website extras (excluding translator):

pip install -e ".[all]"

Install translator separately (all does not include translator):

pip install -e ".[translator]"

Install only website-related dependencies (includes torch + transformers for translation):

pip install -e ".[website]"

pip install -e . will generate build/ and gadget.egg-info/ in the repository root (already gitignored).

For ai-companion installation, see ../ai-companion/scripts/install.ts. It serves as both a Claude Code plugin and a Codex integration; it is ready to use upon installation without needing to build.

2.3 Configuration

Repository-level Configuration

  • Tool settings are located in config.json at the repository root (already gitignored).
  • Copy from config.example.json before making changes.
  • Paths can be overridden using the environment variable GADGET_CONFIG.

Keys and Onboarding Tables

  • tokens/ stores API keys and onboarding tables and is gitignored—never commit its contents.

One-time Configuration for New Machines (this repository)

  1. Fill out a YAML file: tokens/onboard.yaml
  2. Run scripts/onboard.py once.

It will automatically complete: SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configurations, and rclone bootstrap.

System-level Installation for New Servers (Ubuntu 22.04/24.04)

Scripts have been migrated to ai-companion: ../ai-companion/scripts/onboard-server.sh. After the repository split, --companion-repo is passed directly to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), and --companion-ref is no longer required. Usage:

bash ../ai-companion/scripts/onboard-server.sh --help

LLM Backend (Global)

Use --api to switch uniformly: ollama (default), claude_cli, anthropic, openai. You can also specify it globally via the environment variable GADGET_LLM_BACKEND.

Translation Backend / Models

  • The backend is selected by GADGET_TRANSLATION_BACKEND: ollama (default if the model has been pulled, using local Ollama service) → llamacpp / vllm / transformers (in-process).
  • Models: tencent/Hy-MT2-1.8B; the translator can also be overridden by GADGET_TRANSLATION_MODEL or model management within the GUI.

Cross-device Data Synchronization

rclone must be configured first. Configuration is in the sync section of the repository root’s config.json (paths can also be overridden via GADGET_CONFIG).

python scripts/sync.py
python scripts/sync.py push
python scripts/sync.py pull

The README specifies that sync.py overrides categories such as summarize / website / research / benchmark / backups, as well as a special dag category (for generating and deploying DAG sites); subcommands also include status / bootstrap / config.

What Not to Commit

Do not git add: auto-generated content, rclone sync data, build artifacts (build/, gadget.egg-info/), or deployment/theme repositories under tools/website/. All generated files are in outputs/ (already gitignored). Licensed under GPL-3 (see LICENSE).

Post-installation Read-only Smoke Check (does not call LLM, does not connect to the internet, does not write files):

bash scripts/smoke.sh

Local Ollama variant for summarize (prints environment variables for eval):

eval "$(bash scripts/serve_local_llm.sh env)"

Persistence knobs are written in the summarize section of the repository root’s config.json (paths can be overridden via GADGET_CONFIG).

Other ops scripts: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU profiler).


2.4 Typical Usage for Each Tool

Summarize: AI Daily/Weekly/Monthly Reports

Multi-device workflow: each device first exports unexported dates → sync and merge by day → generate weekly/monthly reports once enough daily reports are accumulated. The recommended new entry point is python -m summarize (old entry points python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available but act as compatibility shims for re-exporting).

python -m summarize daily export                                   # 阶段 1:导出所有未导出日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步全部日期并按天合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键全流水线:export → merge → weekly → monthly + deploy

Switch the LLM backend using --api (ollama / claude_cli / anthropic / openai). For more detailed steps, see the Summarize section in TUTORIAL.md and tools/summarize/tutorial.md.

Research: Paper Discovery and Researcher Analysis

The unified entry point is tools/research/research_scout.py.

python tools/research/research_scout.py report --project my-project        # 全流水线:检索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

Deep paper insight capabilities are marked in the README as --insight, but no full copy-pasteable command line is provided. The LLM also uses --api to switch between four backends. For more detailed steps, see the Research section in TUTORIAL.md and tools/research/TUTORIAL.md.

Benchmark: Performance Benchmark Suite

Note: All commands must first cd into tools/benchmark/. GPU will automatically detect CUDA / Apple MPS / Intel XPU. Results are written to CSV in append mode and will not be overwritten.

cd tools/benchmark
python -m benchmark.cli                # 跑全部基准(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 只测 CPU
python -m benchmark.cli --gpu-only     # 只测 GPU
python -m benchmark.cli --report       # 跑基准 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告并发布到 Hugo /benchmark/

--info will perform detection (OpenCL may only appear in detection results). For more detailed steps, see the Benchmark section in TUTORIAL.md and tools/benchmark/tutorial.md.

Website: Hugo Blog

Automatically generated content is written to tools/website/content|static by each tool’s deploy pipeline, then translated, compressed, built, and pushed. tools/website/public/ is an independent deployment repository, which is automatically committed and pushed by build scripts; do not commit directly to it.

pip install -e ".[website]"                          # 安装依赖(含翻译用的 torch + transformers)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自己 cd 到所在目录)
cd tools/website && hugo server -D                   # 本地预览(开发服务器,含草稿)

For more detailed steps, see the Website section in TUTORIAL.md and tools/website/CLAUDE.md.

Translator: Gradio Document Translator

Local inference; the default model is automatically downloaded upon first use. The source language can be set to auto]; when the target is auto, it flips between Chinese and English.

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(在浏览器打开)

For more detailed steps, see the Translator section in TUTORIAL.md. UI wiring is in tools/translator/app.py, translation and file logic is in tools/translator/core.py, and the shared engine is in common/engine.py and common/translation.py.


2.5 Suggested Order for First-time Onboarding

Follow the path that can be connected strictly according to the README:

  1. conda activate AI, confirm Python 3.10+. If using ai-companion, prepare Node.js 18+ as well.
  2. Copy config.json from config.example.json; when keys are needed, place them only in tokens/ and do not commit.
  3. New machine: fill tokens/onboard.yaml, run scripts/onboard.py. For new Ubuntu servers, you can also refer to bash ../ai-companion/scripts/onboard-server.sh --help.
  4. pip install -e ".[all]"; if using the translation GUI, then pip install -e ".[translator]".
  5. Use bash scripts/smoke.sh for a read-only smoke test.
  6. Use individual tools according to the commands in each section above; use python scripts/sync.py push / pull (requires rclone) for cross-device data.
  7. To change tool logic, go to tools/<tool>/; to change shared capabilities, go to common/; to change workflows/skills, go to ../ai-companion/.For more step-by-step operations, configurations, data formats, and FAQ, the README explicitly points to TUTORIAL.md and the source documentation of each tool; this tutorial does not use extra commands found in those files.
Composer 2.5 — 10,088 chars · 16/16 facts

Gadget Project Summary and Usage Tutorial

The following content is based solely on the README you provided, without adding any commands or parameters not present in the README.


I. Project Summary

1. What is this?

Gadgets is a collection of practical tools accumulated during daily development, covering:

  • AI conversation daily/weekly/monthly report generation
  • Paper discovery and research analysis
  • Performance benchmarking
  • Blog automation
  • Document translation

Features:

  • Every directory under tools/ is a standalone usable tool
  • Shared capabilities are centralized in the common/ package in the repository root (installed via pip install -e . ), including LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc.
  • Development workflows (planning/execution/change tracking) and all Claude Code skills are provided by the independent repository ai-companion (located in the sibling directory ../ai-companion/ ), integrated into this repository via hooks

For more detailed step-by-step operations, configurations, data formats, and FAQ, see TUTORIAL.md and the documentation of each tool.


2. Repository Structure

gadget/
├── tools/              # 五个独立工具(改工具逻辑来这里)
│   ├── summarize/      # AI 对话日报/周报/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(所有工具依赖)
├── scripts/            # 运维与维护脚本
├── docs/               # 设计文档、ECL 计划、审计报告、历史归档
├── outputs/            # 所有生成物(gitignored,可自动重建)
├── AGENTS.md           # AI agent 工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置

What to change, where to go:

Goal Location
Change logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / Cache / Translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Change development workflow / skill ../ai-companion/
Read plans / design documents docs/ecl/, docs/

Other notes:

  • build/, gadget.egg-info/ are generated by pip install -e . and are gitignored
  • Data synchronization: python scripts/sync.py
  • Chinese documentation: docs/README.zh.md

3. Tool Overview

Directory Function Key Technologies
tools/summarize/ AI conversation daily/weekly/monthly reports (multi-device two-stage architecture) Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Paper discovery + researcher analysis + citation graphs arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
tools/benchmark/ Cross-platform CPU/GPU performance benchmarking PyTorch, NumPy, Plotly
tools/website/ Hugo blog (incremental media compression + automatic build & publish) Hugo, pngquant, HandBrakeCLI
tools/translator/ Gradio document translator Gradio, GGUF/transformers
common/ Shared infrastructure package pip install -e .
scripts/ Operations scripts (sync, onboard, etc.) rclone, Python
../ai-companion/ AI change tracking + planning/execution skill pipeline Node.js, TypeScript

4. What does each tool do?

Summarize — AI conversation daily/weekly/monthly reports

  • Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON)
  • Calls LLM to generate structured daily, weekly, and monthly reports
  • Multi-device workflow: Export conversations from each device → sync via cloud drive or manual copy → merge to generate daily reports → accumulate to generate weekly/monthly reports
  • Automatically discovers and statistics token usage and costs for various agent CLIs via ccusage 20.x
  • LLM backends (--api ): ollama (default), claude_cli, anthropic, openai

Research — Paper discovery and research analysis

Unified entry point tools/research/research_scout.py with four major capabilities:

  1. Paper Discovery: arXiv / bioRxiv / PubMed search, three-stage LLM pipeline (fast screening → deep review → citation impact), generates research weekly reports and deploys to Hugo; supports conference paper search and author search
  2. Deep Paper Insights (--insight ): Downloads full text, analyzes writing structure/publication strategy/reusable knowledge; matches OpenReview to obtain reviewer comments; synthesizes cross-paper writing guides
  3. Researcher Profiling: Uses ArXiv + Semantic Scholar data, LLM generates research trajectory analysis and hierarchical scoring; extracts mentor-student relationships via homepage and co-authorship patterns; supports name disambiguation and reverse lookup
  4. Citation Graph Analysis: Based on Semantic Scholar for forward citation/backward reference analysis + LLM impact interpretation

Benchmark — Performance benchmarking suite

  • Cross-platform CPU/GPU FLOPS benchmarking
  • Supports NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU)
  • Precision: FP64 / FP32 / FP16 / BF16 / FP8 (experimental)
  • Warm-up + formal measurement + statistical analysis (median, IQR outlier removal)
  • Results appended to CSV; can generate interactive HTML reports and leaderboards; can be deployed to Hugo or submitted to public leaderboards

Website — Hugo blog

  • Static blog “TzJ’s Net” (PaperMod theme), deployed to GitHub Pages: https://tzj2006.github.io/
  • Incremental image/video compression (pngquant, HandBrakeCLI)
  • Local model bilingual translation (default Ollama; Linux fallback vLLM, Windows fallback transformers; model tencent/Hy-MT2-1.8B is automatically downloaded on first run)
  • Automatically generates content written to tools/website/content|static (with gadget_generated markers, so handwritten files will not be overwritten)
  • tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io ), automatically committed and pushed by build scripts; do not commit directly to it

Translator — Gradio document translator

  • Local inference Web interface based on the common translation engine
  • Supports text and files (.md / .txt / .pdf / .docx / images), preserving Markdown format
  • Automatic backend selection: prioritizes ollama , falls back to transformers on Windows, prioritizes vllm on Linux, and offers llamacpp for low VRAM
  • Default model tencent/Hy-MT2-1.8B ; can be overridden by GADGET_TRANSLATION_MODEL or GUI
  • Source language auto is detected by CJK ratio; target auto toggles between zh↔en

5. common / scripts / ai-companion

common/: LLM calls, JSON parsing repair, SHA-256 disk caching, atomic writes, local translation engine, cross-platform Hugo deployment.

Main scripts/:

Script Function
sync.py rclone data synchronization (push/pull/status/bootstrap/config)
onboard.py One-time configuration for a new machine
smoke.sh Read-only smoke test (--help / --info / imports)
serve_local_llm.sh Creates an Ollama variant optimized for summarize and prints environment variables
language.py Hugo bilingual audit + summarize report renaming
profile_translation.py Translation engine GPU performance analysis

ai-companion: An independent Node.js repository providing code change tracking, planning/execution pipelines, and all Claude Code skills; see ../ai-companion/scripts/install.ts for installation.


II. Detailed Chinese Usage Tutorial (Getting Started)

Step 0: Understand output and configuration locations

Generated content directory (gitignored, can be rebuilt):

outputs/
├── logs/         # 中间产物(导出日志、运行日志)
├── reports/      # 最终报告(Markdown、JSON、HTML)
├── cache/        # LLM 缓存、搜索缓存
├── data/         # 结构化数据(CSV、JSON profiles)
├── images/       # 图表与生成图片
└── backups/      # 强制覆盖备份

Hugo site content is written directly to tools/website/content|static (there is no separate outputs/site ).

Configuration:

  • Tool settings: Repository root config.json (gitignored; copy from config.example.json )
  • Available environment variable GADGET_CONFIG overrides configuration paths
  • API keys and onboarding tables: tokens/ (gitignored, do not commit)

Step 1: Environment Preparation

Basic Requirements:

  • Python 3.10+ (recommended conda environment AI : conda activate AI )
  • Node.js 18+ (only required for ../ai-companion/ )

Install Dependencies:

# common + summarize / research / benchmark / website(all 不含 translator)
pip install -e ".[all]"

# translator 需单独安装
pip install -e ".[translator]"

# website 单独安装(含 torch + transformers,用于翻译)
pip install -e ".[website]"

LLM Backend (Global):

  • All tools use --api to switch: ollama (default), claude_cli, anthropic, openai
  • Can also use environment variable GADGET_LLM_BACKEND

Translation Backend:

  • Environment variable GADGET_TRANSLATION_BACKEND
  • Default ollama (if model is already pulled); also supports llamacpp / vllm / transformers
  • Default model tencent/Hy-MT2-1.8B is automatically downloaded on first run

Local LLM (summarize related):```bash eval “$(bash scripts/serve_local_llm.sh env)”


Persistent parameters are written in the `summarize` section of `config.json` (the `GADGET_CONFIG` path can be used for overriding).

---

### Step 2: One-time Configuration for New Machines (Recommended)

**Method A — Repository Machine Configuration:**

1. Fill in `tokens/onboard.yaml`
2. Run:

```bash
python scripts/onboard.py

It will automatically complete: SSH, Claude/Codex CLI installation and authentication, pip extras, ai-companion installation, configuration of various tools, and rclone bootstrap.

Method B — Ubuntu 22.04/24.04 Server System-level Installation:

Migrated to the ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help

Requires passing --companion-repo git@github.com:TzJ2006/ai-companion.git (no longer requires --companion-ref).

Smoke Test (Read-only, no disk writing, no LLM calls, no internet connection):

bash scripts/smoke.sh

Step 3: Data Synchronization (Multi-device / Multi-machine)

python scripts/sync.py
  • Configured in the sync section of the repository root config.json
  • The GADGET_CONFIG can be used to override the configuration path
  • Cross-device synchronization example:
python scripts/sync.py push
python scripts/sync.py pull

(Requires rclone configuration.)


Step 4: Summarize — AI Daily/Weekly/Monthly Conversation Reports

Typical Workflow (Recommended new entry python -m summarize):

# 阶段 1:导出所有未导出日期
python -m summarize daily export

# 阶段 2:同步所有日期并按天合并
python -m summarize daily merge --sync-all

# 周报 + 部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 月报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流程:export → merge → weekly → monthly + deploy
python -m summarize auto --deploy

Old Entry (Still available, compatible via shim):

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

For more detailed steps, see TUTORIAL.md#summarize and tools/summarize/tutorial.md.


Step 5: Research — Paper Discovery and Research Analysis

Unified CLI: tools/research/research_scout.py

# 完整流水线:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 研究者画像
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图(arXiv ID / DOI)
python tools/research/research_scout.py citations 2301.12597

# 部署报告到 Hugo
python tools/research/research_scout.py deploy

The LLM backend also uses --api: ollama (default), claude_cli, anthropic, openai.

For more detailed steps, see TUTORIAL.md#research and tools/research/TUTORIAL.md.


Step 6: Benchmark — CPU/GPU Performance Testing

Note: All commands must first enter tools/benchmark/:

cd tools/benchmark

# 运行全部基准(结果追加到 CSV)
python -m benchmark.cli

# 仅 CPU
python -m benchmark.cli --cpu-only

# 仅 GPU
python -m benchmark.cli --gpu-only

# 运行基准 + 生成 HTML 报告
python -m benchmark.cli --report

# 生成报告 + 发布到 Hugo /benchmark/
python -m benchmark.cli --report --deploy

For more detailed steps, see TUTORIAL.md#benchmark and tools/benchmark/tutorial.md.


Step 7: Website — Hugo Blog

Build and Publish:

# macOS / Linux:增量压缩 + Hugo 构建 + 推送 Pages
cd tools/website && bash update.sh

# Windows
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(含草稿)
cd tools/website && hugo server -D

Note:

  • Do not commit tools/website/public/ directly (it is an independent deployment repository, handled automatically by scripts)
  • Do not git add to automatically generate content, rclone sync data, build/, gadget.egg-info/, or the deployment/theme repositories under tools/website/

For more detailed steps, see TUTORIAL.md#website and tools/website/CLAUDE.md.


Step 8: Translator — Gradio Document Translation

pip install -e ".[translator]"
python -m translator

After starting, open the Gradio GUI in your browser. For more detailed instructions, see TUTORIAL.md#translator; for implementation, see tools/translator/app.py, tools/translator/core.py, common/engine.py, and common/translation.py.


Step 9: Other Common Operations Commands

# 数据同步(完整子命令见 sync.py)
python scripts/sync.py

# 新机器配置
python scripts/onboard.py

# 只读冒烟测试
bash scripts/smoke.sh

# 本地 LLM 环境(summarize)
eval "$(bash scripts/serve_local_llm.sh env)"

ai-companion installation:

# 见 ai-companion 仓库
../ai-companion/scripts/install.ts

Important Notes (README Notes Summary)

Item Description
GPU Benchmarking Automatically detects CUDA / Apple MPS / Intel XPU
tokens/ Stores API keys and onboarding forms, do NOT commit
outputs/ All generated files are gitignored
LLM Backend --api or GADGET_LLM_BACKEND
Translation Backend GADGET_TRANSLATION_BACKEND; Model tencent/Hy-MT2-1.8B
Cross-device Sync python scripts/sync.py push/pull (requires rclone)
License GPL-3 (see LICENSE)

Further Reading (Documents linked in README)

  • Full Tutorial: TUTORIAL.md
  • Chinese Version: docs/README.zh.md
  • Summarize: tools/summarize/tutorial.md
  • Research: tools/research/TUTORIAL.md
  • Benchmark: tools/benchmark/tutorial.md
  • Website: tools/website/CLAUDE.md
  • Translator: TUTORIAL.md#translator

The above is a summary and quick-start path based solely on the README. If you need to expand into step-by-step operations for a specific tool (for example, the Summarize multi-device workflow or Research’s --insight), you can switch to Agent mode, and I can write a more detailed tutorial combined with the TUTORIAL.md in the repository.

Gemini 3.7 Flash — 7,229 chars · 15/16 facts

The following is a project summary and detailed usage tutorial organized based on the provided README.md content. All content and commands are strictly written according to the original README text.


Part 1: Open Source Project Gadgets Summary

1. Project Introduction

Gadgets is a collection of practical tools accumulated during daily development, covering five core areas: AI Conversation Daily/Weekly/Monthly Report Generation, Academic Paper Discovery and Scholar Analysis, Hardware/Software Performance Benchmarking, Hugo Personal Blog Automated Building and Publishing, and Local Document Translation.

  • Architectural Features: Each tool under the tools/ directory is independent and can be used separately; common infrastructure (such as LLM calls, JSON parsing, disk caching, atomic writes, translation engines, Hugo deployment, etc.) is unified in the common/ package in the root directory.
  • Extension and Workflow: The development workflow engine and all Skills are hosted in the peer independent repository ai-companion (../ai-companion/), integrated into this project via a Hook mechanism.

2. Repository Structure Description

gadget/
├── tools/              # 5 个独立的工具产品
│   ├── summarize/      # AI 对话日/周/月报生成
│   ├── research/       # 论文发现 + 学者分析 + 引用关系图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动化构建与发布)
│   └── translator/     # Gradio 本地文档翻译 Web 应用
├── common/             # 共享基础设施包(LLM/缓存/IO/翻译/Hugo部署,所有工具的底层依赖)
├── scripts/            # 运维与维护脚本(数据同步 sync.py、新机配置 onboard.py、冒烟测试 smoke.sh 等)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 所有生成产物的输出目录(已加入 .gitignore,可自动重建)
├── AGENTS.md           # AI Agent 工作流协议文件
├── CLAUDE.md           # Claude Code 指南
└── pyproject.toml      # common/ 与各工具的打包配置(供 pip install -e . 安装)

3. Introduction to Tools and Modules

Tool/Directory Core Functionality Key Technologies / Backend Support
tools/summarize/ AI Multi-period Conversation Report Generation: Automatically reads conversation logs from Claude Code / Codex / Cursor Agent / ChatGPT, etc., combines with ccusage 20.x to statistics Tokens and costs for each Agent, and generates structured daily/weekly/monthly reports and trend summaries in two stages. Supports 4 LLM backends (ollama default, claude_cli, anthropic, openai); ccusage, matplotlib
tools/research/ Comprehensive Academic Research Suite: Unified entry research_scout.py, providing four major capabilities: ① Paper discovery (three-stage LLM screening, evaluation, and weekly report generation); ② Deep insight (--insight analyzes paper writing structure, review comments, and strategies); ③ Scholar profiling (research trajectory, graded scoring, mentor-student relationship mining); ④ Citation graph analysis. arXiv / bioRxiv / PubMed / Semantic Scholar, OpenReview, LLM (4 backends)
tools/benchmark/ Cross-platform CPU/GPU Performance Benchmarking: Uniformly measures FLOPS floating-point performance across different hardware and precisions (FP64/FP32/FP16/BF16/FP8), using a warm-up + formal measurement + statistical analysis approach, appending results to CSV, supporting Plotly interactive HTML reports and publishing to Hugo. PyTorch, NumPy, Plotly; supports NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU)
tools/website/ Hugo Static Blog Automation: Automates the processing of personal blogs (“TzJ’s Net”), featuring media incremental compression (pngquant for images, HandBrakeCLI for video) and local model bilingual automatic translation capabilities, building and pushing directly to GitHub Pages. Hugo (PaperMod theme), pngquant, HandBrakeCLI, local translation model tencent/Hy-MT2-1.8B
tools/translator/ Gradio Local Document Translation Tool: A local Web application mimicking the Google Translate interface, supporting translation of text and files (.md, .txt, .pdf, .docx, images), fully preserving Markdown format (protecting code blocks, URLs, Hugo shortcodes) without calling cloud APIs. Gradio, local translation engine (prioritizing Ollama, supporting vLLM / transformers / llamacpp GGUF)
common/ Shared Infrastructure Package: Provides a unified two-layer LLM calling interface, JSON parsing and repair, SHA-256 disk caching, atomic writing and hash verification, local translation engine, and cross-platform Hugo deployment. Python package (pip install -e .)
scripts/ Operations Script Set: Provides cross-device data synchronization (sync.py), new machine configuration (onboard.py), read-only smoke testing (smoke.sh), local LLM environment optimization configuration (serve_local_llm.sh), bilingual auditing (language.py), etc. rclone, Python, Shell
../ai-companion/ Independent Workflow Repository: Records function-level code changes, providing the /idea→/ccplan→/ccedit planning and execution flow as well as all Claude Code / Codex skills. Node.js, TypeScript

Part 2: Detailed Gadgets Usage Tutorial

conda activate AI
  • Node.js Environment: Node.js 18+ (only required if using the peer independent repository ../ai-companion/).
  • Local Translation/Model Environment: Translation and blog functions default to relying on the tencent/Hy-MT2-1.8B model running via local Ollama (automatically downloaded upon first use; Linux alternative is vLLM, Windows alternative is transformers).

2. Installation and Initialization

The project uses editable mode to install the base package and various tool dependencies:

2.1 Install Common Base Package and Most Tool Dependencies

Install common/ and all tool dependencies except for translator (summarize, research, benchmark, website):

pip install -e ".[all]"

2.2 Install Specific Tool Dependencies

  • Install Translator independent dependencies (Note: translator is not included in .[all], must be installed separately):
    pip install -e ".[translator]"
    
  • Install Website dependencies separately (includes torch + transformers etc. required for local translation):
    pip install -e ".[website]"
    

2.3 Run Read-only Smoke Test

Verify if the environment and imports for all tools are normal (does not initiate network requests, LLM calls, or write operations):

bash scripts/smoke.sh

3. Configuration Instructions

  1. Global Configuration File:
    • Copy the template file from the root directory to generate config.json (this file is gitignored):
      cp config.example.json config.json
      
    • It contains running settings for various tools such as sync (rclone sync configuration) and summarize.
    • The configuration file path can be overridden via the environment variable GADGET_CONFIG.
  2. API Keys and Credentials Directory:
    • The tokens/ directory is used to store API Keys and the new machine initialization manifest tokens/onboard.yaml (this directory is gitignored, do not commit).
  3. Global Environment Variable Adjustments:
    • GADGET_LLM_BACKEND: Globally specify the LLM backend (ollama, claude_cli, anthropic, openai).
    • GADGET_TRANSLATION_BACKEND: Specify the translation backend (ollama, llamacpp, vllm, transformers).
    • GADGET_TRANSLATION_MODEL: Override the default translation model name.

4. Typical Usage Methods for Each Tool (Directly Runnable Commands)

4.1 Summarize —— AI Conversation Report Generation

Unified entry point via python -m summarize. The LLM backend can be specified via --api (optional ollama (default), claude_cli, anthropic, openai).

  • Phase 1: Export unexported conversation records
    python -m summarize daily export
    
  • Phase 2: Sync and merge daily to generate daily reports
    python -m summarize daily merge --sync-all
    
  • Generate a specific weekly report and deploy to the blog
    python -m summarize weekly generate --week 2026-W12 --deploy
    
  • Generate a specific monthly report and deploy to the blog
    python -m summarize monthly generate --month 2026-02 --deploy
    
  • One-click full workflow execution (Export → Merge → Weekly Report → Monthly Report + Deploy)
    python -m summarize auto --deploy
    

4.2 Research —— Academic Paper and Scholar Research

Unified entry point is tools/research/research_scout.py.

  • Run full paper research workflow (Search → Three-stage evaluation → Report generation)
    python tools/research/research_scout.py report --project my-project
    
  • Natural language retrieval of papers (Automatic data source routing)
    python tools/research/research_scout.py ask "Find recent robot manipulation papers by Pieter Abbeel"
    
  • Scholar academic profile analysis (Input scholar name)
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Citation graph analysis (Based on arXiv ID or DOI)
    python tools/research/research_scout.py citations 2301.12597
    
  • Deploy research reports to Hugo blog
    python tools/research/research_scout.py deploy
    

4.3 Benchmark —— Performance Benchmarking

Note: Before executing benchmark commands, you must cd enter the tools/benchmark directory.

cd tools/benchmark
  • Run full benchmark (CPU + GPU, results appended to CSV)
    python -m benchmark.cli
    
  • Run CPU benchmark only
    python -m benchmark.cli --cpu-only
    
  • Run GPU benchmark only
    python -m benchmark.cli --gpu-only
    
  • Run tests and generate interactive HTML reports
    python -m benchmark.cli --report
    
  • Generate test reports and publish to the /benchmark/ path of the Hugo blog
    python -m benchmark.cli --report --deploy
    

4.4 Website —— Hugo Blog Construction and Publishing

  • Start local preview server (including drafts)
    cd tools/website && hugo server -D
    
  • macOS / Linux environment: Incremental media compression + Hugo build + Auto-push to GitHub Pages
    cd tools/website && bash update.sh
    
  • Windows environment: Update and build for release
    powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
    

4.5 Translator —— Local Document Translation Web Interface

  • Start Gradio Web GUI (automatically opens in browser after starting)
    python -m translator
    

4.6 Operations and Scripting Tools

  • Cross-device data synchronization (based on rclone)
    python scripts/sync.py
    
    (or use python scripts/sync.py push / python scripts/sync.py pull)
  • One-click configuration and initialization for new machines (execute after filling in tokens/onboard.yaml):
    python scripts/onboard.py
    
  • Create local Ollama models optimized for Summarize and export environment variables:
    eval "$(bash scripts/serve_local_llm.sh env)"
    
  • View help for server-level system initialization scripts (from peer ai-companion repository):
    bash ../ai-companion/scripts/onboard-server.sh --help
    

5. Output Artifacts and Data Flow

All generated files are centrally stored in the outputs/ directory (added to .gitignore):

  • outputs/logs/: Intermediate export logs and runtime logs
  • outputs/reports/: Final generated Markdown, JSON, and HTML reports
  • outputs/cache/: LLM call and search result caches
  • outputs/data/: Structured data (CSV benchmark data, scholar profile JSON)
  • outputs/images/: Charts and generated images
  • outputs/backups/: Backup files
gpt-5.3-codex-high — 4,293 chars · 16/16 facts

1) Project Summary (Based on README)

gadget is a “collection of daily development tools,” aiming to turn several types of high-frequency tasks into independently usable tools:

  • AI conversation daily/weekly/monthly reports
  • Paper discovery and researcher analysis
  • CPU/GPU performance benchmarking
  • Hugo blog automation
  • Document translation

Its core organizational method is: Every directory under tools/ is an independent product, with shared capabilities concentrated in the common/ package in the repository root.

Repository Structure (Main trunk provided by README)- tools/: 5 independent tool directories (summarize / research / benchmark / website / translator)

  • common/: Shared infrastructure (LLM calls, JSON parsing/fixing, disk cache, atomic writes, translation engine, Hugo deployment)
  • scripts/: Ops and maintenance scripts (sync, onboard, smoke, language audit, etc.)
  • docs/: Design docs, ECL, audit & historical archives
  • outputs/: All generated artifacts (gitignored, reproducible)
  • pyproject.toml: Packaging and pip install -e ./extras configuration
  • ../ai-companion/ (sibling repo, not in this repo): Optional DAG publishing and skill pipeline capabilities

What each tool does

  • tools/summarize/: Reads conversation logs from Claude/Codex/Cursor/ChatGPT, etc., to generate structured daily/weekly/monthly reports; supports switching between ollama / claude_cli / anthropic / openai via --api.
  • tools/research/: Paper retrieval & evaluation, deep insights, researcher profiling, citation graph analysis; the unified entry point is tools/research/research_scout.py.
  • tools/benchmark/: Cross-platform CPU/GPU FLOPS benchmarking, supporting multi-precision, statistical analysis, CSV appending/accumulation, Plotly HTML reports, and leaderboards.
  • tools/website/: Hugo blog automation (incremental media compression + build & publish), deployed to GitHub Pages; tools/website/public/ is an independent deployment repo.
  • tools/translator/ : Gradio local document translation web app, supports text/files and attempts to preserve Markdown structure; backend automatically selects ollama/vllm/transformers/llamacpp.

2) Detailed First-time Getting Started Tutorial (Based only on README)

A. Environment Preparation

  • Python 3.10+
  • Recommended conda environment: AI
  • Node.js 18+ (only for optional Companion graph/DAG tools)
  • Requires local inference related environment (README indicates websites/translation will use local engines, default is Ollama)

Can be executed directly:

conda activate AI

B. Installation

Full installation (except translator)

pip install -e ".[all]"

Install translator separately

pip install -e ".[translator]"

If only doing website functions (website installation command provided in README)

pip install -e ".[website]"

C. Configuration (Must read for first-timers)

  • Tool configuration is located in the repo root config.json (README note: copy from config.example.json)
  • Available environment variables GADGET_CONFIG can override configuration file paths
  • Unified LLM backend switching:
    • Command parameter: --api
    • Global environment variable: GADGET_LLM_BACKEND
    • Optional values: ollama / claude_cli / anthropic / openai
  • Translation backend is controlled by GADGET_TRANSLATION_BACKEND (default is ollama, then it can proceed via llamacpp/vllm/transformers)
  • Translation models can be overridden via GADGET_TRANSLATION_MODEL
  • Keys and onboarding forms are in tokens/ (gitignored, should not be committed)

D. Typical Usage for Each Tool (Can be copied directly)

1) Summarize (Daily/Weekly/Monthly Reports)

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy

Explanation (original intent of README):

  • The first two correspond to a two-stage process: export first, then sync and merge
  • The last two generate weekly/monthly reports and deploy
  • auto is the one-click full workflow
  • The old entry point (tools/summarize/*.py) is still compatible, but python -m summarize is recommended

2) Research (Paper Discovery & Researcher Analysis)

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy

Explanation:

  • report: Full pipeline (Search → Three-stage evaluation → Report)
  • ask: Natural language retrieval
  • profile: Researcher profiling
  • citations: Citation graph
  • deploy: Publish to Hugo

3) Benchmark (Performance Benchmarking)

README specifically notes: Enter tools/benchmark first

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy

Explanation:

  • Runs full suite by default and appends to CSV
  • Can test CPU or GPU only
  • --report generates HTML reports
  • --deploy publishes to Hugo’s /benchmark/

4) Website (Hugo Blog Automation)

pip install -e ".[website]"
cd tools/website && bash update.sh
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
cd tools/website && hugo server -D

Explanation:

  • update.sh: macOS/Linux incremental compression + build + push
  • update.ps1: Windows script (will switch to the script directory)
  • hugo server -D: Local preview (including drafts)

5) Translator (Gradio Document Translation)

pip install -e ".[translator]"
python -m translator

Explanation:

  • Starts local Gradio interface
  • On first use, it will automatically download the default model as per README instructions (if not already present)

E. Common Ops Scripts (Explicitly listed in README)

python scripts/sync.py
python scripts/onboard.py
bash scripts/smoke.sh
eval "$(bash scripts/serve_local_llm.sh env)"

Additionally, README provides in Notes:

  • Cross-device sync: python scripts/sync.py push/pull
  • Sync depends on rclone configuration

F. Artifact Locations & Precautions

  • Unified output in outputs/ (logs/reports/cache/data/images/backups)
  • Hugo content is written directly to tools/website/content|static (no outputs/site)
  • Do not commit automatically generated content, rclone sync data, build/, gadget.egg-info/, or deployment/theme repo contents under tools/website/
  • License: GPL-3

If you wish, I can organize another version for you in the next step based on the “Minimum Closed Loop for First Use”: for example, running smoke first to verify the environment, then running summarize auto or translator to produce the first visible result.

gpt-5.2-high — 7,699 chars · 15/16 facts

1) Project Chinese Summary (Based only on README)

What is Gadget

  • Positioning: A “toolset” repository containing practical tools accumulated during daily development, covering AI daily/weekly/monthly report generation, paper discovery and research analysis, performance benchmarking, Hugo blog automation, and document translation.
  • Organization: Each subdirectory under tools/ is an independently usable tool product; the common/ in the repo root is the shared infrastructure package for all tools (installed via pip install -e .).

Repository Structure (Main structure provided by README)

  • tools/: Five independent tools
    • tools/summarize/: AI conversation daily/weekly/monthly reports
    • tools/research/: Paper discovery + researcher profiling + citation graph
    • tools/benchmark/: CPU/GPU performance benchmarking
    • tools/website/: Hugo blog (incremental media compression + auto build & publish)
    • tools/translator/: Gradio document translator
  • common/: Shared capabilities (LLM calls, cache, IO, translation engine, Hugo deployment, etc.)
  • scripts/: Ops/maintenance scripts (e.g., sync.py, onboard.py, etc.)
  • docs/: Design docs, ECL plans, audit & historical archives
  • outputs/: All generated artifacts (gitignored, reproducible)
  • AGENTS.md / CLAUDE.md : AI/Claude workflows and repo guides
  • pyproject.toml: Packaging and installation configuration (pip install -e . / extras)What each tool does (README Overview level)
  • Summarize(tools/summarize/): Reads AI conversation logs from multiple sources (Claude Code/Codex/Cursor Agent/ChatGPT/General JSON), calls LLMs to generate structured Daily/Weekly/Monthly Reports; supports a two-stage process for multiple devices (Export → Merge → Generate Weekly/Monthly Report), and summarizes token/cost for each CLI via ccusage 20.x; the LLM backend is unified and switchable via --api (ollama/claude_cli/anthropic/openai).
  • Research(tools/research/): Provides four types of capabilities through a single entry point tools/research/research_scout.py: paper retrieval and reporting, full-text deep insights (--insight), researcher profiling and relationship mining, and citation graph analysis (Semantic Scholar API + LLM interpretation); also supports backend switching via --api.
  • Benchmark(tools/benchmark/): Cross-platform CPU/GPU FLOPS benchmarking (NVIDIA CUDA / Apple MPS / Intel XPU), multi-precision (FP64/FP32/FP16/BF16/FP8 experimental), with warmup/statistical analysis; results are appended to CSV, and can generate Plotly HTML reports/leaderboards deployable to Hugo.
  • Website(tools/website/): A Hugo static blog site (PaperMod theme) featuring incremental image/video compression (based on .last_build, pngquant + HandBrakeCLI), as well as local model bilingual translation; automatically writes content generated by various tools into tools/website/content|static and completes translation/compression/build/push. tools/website/public/ is a separate deployment repository that is automatically committed and pushed by scripts; do not commit manually.
  • Translator(tools/translator/): A Gradio Web translator based on the common translation engine, supporting text and files (.md/.txt/.pdf/.docx/images), attempting to preserve Markdown structure (code blocks/URLs/Hugo shortcodes, etc., are protected); local inference (prioritizes ollama, falls back to transformers on Windows, prefers vllm on Linux, and can use llamacpp for low VRAM), with tencent/Hy-MT2-1.8B as the default model (GGUF variants also mentioned), and can be overridden via GADGET_TRANSLATION_MODEL.

2) Detailed Chinese Usage Tutorial (For first-timers; only using commands/parameters appearing in README)

Environment Preparation

  • Python: Requires Python 3.10+
    • README recommends the conda environment AI and provides:
conda activate AI
  • Node.js (Optional): Requires Node.js 18+, used only for optional Companion graphs and DAG publishing tools (related to ../ai-companion/).

  • Tool Dependency Note: Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt (README says “go look,” but does not provide installation commands; no new commands are added here).


Installation (As specified in README)

Install shared package common/ (and extras for each tool)

  • Execute in the repository root (README explicitly mentions installing common/ via pip install -e . and recommends installing extras):
pip install -e ".[all]"
  • Note: README states that tools/summarize/ does not include translator; the translator must be installed separately:
pip install -e ".[translator]"

Install only dependencies required for Website (including translation-related dependencies)

  • If you are primarily running the site/translation pipeline, README provides:
pip install -e ".[website]"

Configuration (Configuration locations and environment variables mentioned in README)

  • Configuration File: Tool settings are located in config.json at the repository root (gitignored). README indicates it is copied from config.example.json (no copy command is provided here to avoid adding commands not in the README).
  • Configuration Path Override: Use environment variable GADGET_CONFIG to point to a custom configuration path.

LLM Backend Selection (Two methods: Global/Parameter)

  • CLI Parameters: Multiple tools support switching backends using --api (ollama default, claude_cli, anthropic, openai).
  • Global Environment Variable: GADGET_LLM_BACKEND.

Translation Engine Selection (Translator/Website translation pipeline)

  • Environment variable GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers
  • Environment variable GADGET_TRANSLATION_MODEL: Overrides the default model (README default is tencent/Hy-MT2-1.8B, and mentions GGUF variants)

Output Directory and Artifact Locations (Understanding “Where it generates”)

  • All generated items are concentrated in outputs/ by default (gitignored, can be rebuilt), with the following structure (as per README):
    • outputs/logs/, outputs/reports/, outputs/cache/, outputs/data/, outputs/images/, outputs/backups/
  • Hugo Site Content: Is not written to outputs/site, but directly into tools/website/content|static.

Tool 1: Summarize (AI Conversation Daily/Weekly/Monthly Reports)

Purpose: Export and merge conversation logs from multiple devices, calling LLMs to generate daily reports; accumulate them to generate weekly/monthly reports which can be deployed.

The new entry point recommended by README is python -m summarize, with a typical command provided (can be copied directly):

python -m summarize daily export                                   # Phase 1: export all unexported dates
python -m summarize daily merge --sync-all                         # Phase 2: sync all dates and merge day by day
python -m summarize weekly generate --week 2026-W12 --deploy       # Weekly report + deploy
python -m summarize monthly generate --month 2026-02 --deploy      # Monthly report + deploy
python -m summarize auto --deploy                                  # One-click full pipeline: export → merge → weekly → monthly + deploy
  • README also notes that old entries are still compatible (but not recommended):
    • python tools/summarize/daily_summary.py ...
    • python tools/summarize/weekly_summary.py ...
    • python tools/summarize/monthly_summary.py ...

Tool 2: Research (Paper Discovery + Researcher Analysis + Citation Graphs)

Purpose: Covers report generation, natural language retrieval, researcher profiling, citation graph analysis, and deployment through a single CLI via tools/research/research_scout.py.

Typical command provided by README:

python tools/research/research_scout.py report --project my-project        # Full pipeline: search → three-stage evaluation → report
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # Natural-language search (auto-routes source)
python tools/research/research_scout.py profile "Sergey Levine"             # Researcher profile
python tools/research/research_scout.py citations 2301.12597               # Citation graph (by arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # Deploy reports to Hugo
  • README mentions: The LLM backend can also use --api to switch between ollama/claude_cli/anthropic/openai (no new example commands are added here to avoid introducing combinations not shown in the README).

Tool 3: Benchmark (CPU/GPU Performance Benchmarking)

Purpose: Cross-platform FLOPS benchmarking, with results appended to CSV; can generate HTML reports and deploy to Hugo.

README emphasizes: All commands require cd tools/benchmark/ first, and provides:

cd tools/benchmark
python -m benchmark.cli                # Run all benchmarks (results appended to CSV)
python -m benchmark.cli --cpu-only     # CPU only
python -m benchmark.cli --gpu-only     # GPU only
python -m benchmark.cli --report       # Run benchmarks + generate HTML report
python -m benchmark.cli --report --deploy  # Generate report + publish to Hugo /benchmark/

Tool 4: Website (Hugo Blog: Compression + Build + Publish)

Purpose: Incremental media compression, translation, Hugo building, and pushing to GitHub Pages. Note that tools/website/public/ is an independent deployment repository; README explicitly states “do not commit directly.”

Install Dependencies (Provided by README)

pip install -e ".[website]"

Build and Publish

  • macOS/Linux:
cd tools/website && bash update.sh
  • Windows (PowerShell command provided by README):
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local Preview (Including drafts)

cd tools/website && hugo server -D

Tool 5: Translator (Gradio Document Translator)

Purpose: Starts a local Gradio Web UI to translate text/files (.md/.txt/.pdf/.docx/images), attempting to maintain Markdown structure; uses local inference without calling cloud APIs.

Installation and Startup (Provided by README)

pip install -e ".[translator]"   # Install dependencies (gradio + GGUF translation stack)
python -m translator             # Launch Gradio GUI (opens in browser)

common/, scripts/, ../ai-companion/ (“General Capabilities and Operations Entry Points” mentioned in README)

common/ (Shared Infrastructure)

  • Installed as a Python package via pip install -e . / extras; provides unified LLM API, JSON repair, disk caching, atomic writes, translation engines, Hugo deployment, etc.

scripts/ (Operations and Maintenance Scripts, several entry points provided in README)

  • Data Synchronization (rclone sync; README only provides the execution method and configuration location):
python scripts/sync.py
  • Configured in the config.json root directory under the sync section; path can be overridden via GADGET_CONFIG.

  • One-time Initialization for New Machines (Run once after filling in tokens/onboard.yaml):

python scripts/onboard.py
  • Read-only smoke net (No LLM, no disk writes, no network access):
bash scripts/smoke.sh
  • Local LLM Assistant Scripts (Examples provided in README):
eval "$(bash scripts/serve_local_llm.sh env)"

../ai-companion/ (Optional sibling repository)

  • README explains: Provides DAG publishing tools for use with scripts/sync.py --category dag; additionally, there are “graph and planning/execution skill pipelines,” but this repository does not have Companion intercept hooks.

Where to look for “Step-by-step Operations/Configuration/Data Formats/FAQ” for each tool (Directions from README)- Total Tutorial: TUTORIAL.md

  • Documentation within each tool source:
    • Summarize: tools/summarize/tutorial.md
    • Research: tools/research/TUTORIAL.md
    • Benchmark: tools/benchmark/tutorial.md
    • Website: tools/website/CLAUDE.md
    • Translator: README points to TUTORIAL.md — Translator, and specifies source code: tools/translator/app.py, tools/translator/core.py, and shared implementations common/engine.py / common/translation.py
gpt-5.6-sol-high — 7,638 chars · 16/16 facts

I. Project Summary

1. What is Gadget

Gadget is a collection of daily development tools, mainly covering:

  • AI conversation daily, weekly, and monthly report generation
  • Academic paper discovery, paper analysis, and researcher profiling
  • CPU/GPU performance benchmarking
  • Hugo blog building, translation, and automatic deployment
  • Local document translation

The five tools under tools/ are independent and can be used separately; common capabilities are concentrated in the common/ package in the root directory, including:

  • LLM calls
  • JSON parsing and repair
  • Disk caching
  • Atomic writing and content hashing
  • Local translation
  • Hugo deployment

The project uses the GPL-3 license.

2. Repository Structure

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者画像、引用网络
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客构建与发布
│   └── translator/     # Gradio 本地文档翻译器
├── common/             # 所有工具共享的基础能力
├── scripts/            # 同步、机器初始化、检查等运维脚本
├── docs/               # 设计文档、计划、审计报告和历史归档
├── outputs/            # 自动生成的输出,已被 Git 忽略
├── AGENTS.md           # AI Agent 工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 包及可选依赖配置

Modification locations:

Requirement Directory or File
Modify a specific tool tools/<tool>/
Modify common capabilities like LLM, cache, translation, deployment, etc. common/
Modify data synchronization logic scripts/sync.py
New machine initialization scripts/onboard.py
Modify AI workflows or skills Adjacent ../ai-companion/ repository
View design and plans docs/, docs/ecl/

3. What the Five Tools Do Individually

Summarize

Reads conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON formats to generate:

  • Daily reports
  • Weekly reports
  • Monthly trend summaries
  • Token and cost statistics

It uses a multi-device two-stage process:

  1. Each device exports conversations.
  2. Data is aggregated and synchronized, then reports are generated.

Supports four LLM backends:

  • ollama: Default, runs locally, no API Key required
  • claude_cli: Reuses Claude Code login status
  • anthropic
  • openai

Research

A unified academic research command-line tool containing four types of capabilities:

  • Search for papers from arXiv, bioRxiv, and PubMed
  • Download full texts and analyze paper structures, submission strategies, and OpenReview reviews
  • Generate researcher profiles, research trajectories, and advisor-student relationships
  • Analyze papers’ forward citations and backward references

It also supports ollama, claude_cli, anthropic, and openai backends.

Benchmark

A cross-platform CPU/GPU FLOPS performance testing tool, supporting:

  • NVIDIA CUDA
  • Apple MPS
  • Intel XPU
  • FP64, FP32, FP16, BF16, and experimental FP8

Testing employs warmup, formal measurement, median statistics, and IQR outlier removal. Results are appended to a CSV without overwriting old records; it can also generate Plotly HTML reports and leaderboards.

OpenCL may appear in hardware detection info, but the README does not state it can be used for actual GPU testing.

Website

A Hugo blog using the PaperMod theme, including:

  • Incremental image compression
  • Incremental video compression
  • Bilingual translation via local models
  • Hugo build
  • Automatic GitHub Pages commit and push

Images use pngquant, and videos use HandBrakeCLI. The deployment repository is located at tools/website/public/; it is an independent repository and files should not be committed to it manually.

Automatically generated articles will carry the gadget_generated tag; handwritten files without this tag will not be overwritten.

Translator

A Gradio-based local document translation web interface, supporting:

  • Plain text
  • Markdown
  • TXT
  • PDF
  • DOCX
  • Images

During translation, Markdown snippets such as code blocks, URLs, and Hugo shortcodes are protected. Supports Ollama, transformers, vLLM, and low-VRAM GGUF/llama.cpp paths.

When the source language is set to auto, it detects based on CJK character ratios; when the target language is set to auto, it automatically switches between Chinese and English.


II. First-Time Use Tutorial

1. Environment Preparation

Minimum requirements:

  • Python 3.10+
  • Node.js 18+: Only required when using optional Companion graph and DAG publishing features
  • Website media processing requires Hugo, pngquant, and HandBrakeCLI
  • Cross-device synchronization requires rclone

The README recommends using a Conda environment named AI:

conda activate AI

All subsequent commands are executed in the Gadget repository root by default; except for the Benchmark section, which requires entering its own directory first.

2. Installing Common Packages and Main Tools

Install the common common package:

pip install -e .

Install Summarize, Research, Benchmark, Website, and their optional dependencies:

pip install -e ".[all]"

all does not include Translator. Translator must be installed separately:

pip install -e ".[translator]"

If only using Website, you can install Website dependencies:

pip install -e ".[website]"

Each tool also has its own requirements.txt, but the README does not provide corresponding installation commands, so no speculation is made here.

3. Basic Configuration

Root Configuration File

Tool settings are located at the repository root in:

config.json

It is Git-ignored. You should copy and modify it using the following file as a template:

config.example.json

Other configuration files can also be specified via environment variables:

GADGET_CONFIG

The README does not list the specific fields of config.json, so you should refer to the template and each tool’s documentation.

LLM Backends

Summarize, Research, and common LLM capabilities support:

  • ollama
  • claude_cli
  • anthropic
  • openai

The default is ollama. You can select the backend via the tool’s --api parameter or use a global environment variable:

GADGET_LLM_BACKEND

The README does not show the exact placement of --api in each subcommand, nor does it list the variable names for Anthropic/OpenAI API Keys, so you should not guess; consult TUTORIAL.md or the tool’s own tutorials.

Translation Configuration

Translation models can be overridden via the following environment variables:

GADGET_TRANSLATION_MODEL

Translation backends can be selected via the following variable:

GADGET_TRANSLATION_BACKEND

The translation backends described in the README include:

  • ollama
  • llamacpp
  • vllm
  • transformers

Local inference models will be automatically downloaded upon first use. Models mentioned in the README include:

  • The Ollama path uses local gemma4:26b
  • In-process translation uses tencent/Hy-MT2-1.8B
  • The GGUF version is tencent/Hy-MT2-1.8B-GGUF

Key Security

API Keys and machine initialization tables are placed in:

tokens/

This directory is Git-ignored; never commit its contents.


4. Summarize Usage Tutorial

Step 1: Export all dates not yet exported

Execute on each device where AI conversation logs are saved:

python -m summarize daily export

Step 2: Synchronize and merge daily

python -m summarize daily merge --sync-all

Generate and deploy a weekly report for a specific week

python -m summarize weekly generate --week 2026-W12 --deploy

Where 2026-W12 is the ISO week format example provided in the README.

Generate and deploy a monthly report for a specific month

python -m summarize monthly generate --month 2026-02 --deploy

The month format is YYYY-MM.

Run the full process with one click

python -m summarize auto --deploy

This command executes the following in order:

  1. Export
  2. Merge
  3. Generate weekly report
  4. Generate monthly report
  5. Deploy

Old daily_summary.py, weekly_summary.py, and monthly_summary.py entry points are still compatible, but the README recommends using python -m summarize.


5. Research Usage Tutorial

The unified entry point for Research is:

tools/research/research_scout.py

Full paper discovery and reporting process

python tools/research/research_scout.py report --project my-project

This process includes searching, three-stage evaluation, and report generation.

Search for papers using natural language

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

The tool will automatically select the search source.

Generate researcher profiles

python tools/research/research_scout.py profile "Sergey Levine"

Profiles may include papers, citation data, research trajectories, hierarchical scores, and automatically discovered advisor-student relationships.

Analyze citation networks

python tools/research/research_scout.py citations 2301.12597

This uses arXiv IDs. The README states that DOI is also supported, but no DOI examples are provided.

Deploy research reports to Hugo

python tools/research/research_scout.py deploy

6. Benchmark Usage Tutorial

All Benchmark commands require entering its directory first:

cd tools/benchmark

Run all tests

python -m benchmark.cli

Results will be appended to the CSV without overwriting existing data.

Test CPU only

python -m benchmark.cli --cpu-only

Test GPU only

python -m benchmark.cli --gpu-only

The tool will automatically detect CUDA, Apple MPS, or Intel XPU.

Run tests and generate an HTML report

python -m benchmark.cli --report

Generate report and deploy to Hugo

python -m benchmark.cli --report --deploy

The deployment page is located at /benchmark/ of the Hugo website.


7. Website Usage Tutorial

pip install -e ".[website]"

macOS/Linux: Build and publish

cd tools/website && bash update.sh

This script performs incremental media compression, Hugo build, and Pages push.

Windows: Build and publishExecute in the repository root:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The script will automatically switch to the website directory.

Start Local Preview

cd tools/website && hugo server -D

-D will include drafts in the preview.

Note:

  • Do not commit tools/website/public/ directly
  • Do not manually commit the deployment repository or the theme repository
  • Automatically generated content will be written directly to tools/website/content or tools/website/static
  • Files written by hand without the gadget_generated tag will not be automatically overwritten

8. Translator Usage Tutorial

Install Dependencies

pip install -e ".[translator]"

Start Translation Webpage

python -m translator

After starting, the Gradio GUI will open in your browser. Models will be loaded on demand and kept in memory; models may be automatically downloaded upon first use.

Supported file types for translation include:

.md
.txt
.pdf
.docx
图片

Models can be managed via the GUI or by using GADGET_TRANSLATION_MODEL to override default settings.


9. Data Synchronization and Maintenance

Open Sync Tool

python scripts/sync.py

Sync configuration is located in the sync section of the root config.json.

Push Data Across Devices

python scripts/sync.py push

Pull Data Across Devices

python scripts/sync.py pull

These operations require rclone to be configured in advance.

Run Read-only Smoke Test

bash scripts/smoke.sh

It checks the --help, --info, and import status of various tools without calling LLM, accessing the network, or writing files.

Start or Configure Local Summarize Model Environment

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent settings are placed in the summarize section of the root config.json.

View Server-level Initialization Script Help

This script has been migrated to the adjacent ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help

Repository-level machine initialization uses tokens/onboard.yaml and scripts/onboard.py, but the README does not provide the exact execution command; therefore, you should check TUTORIAL.md or the script help before running.


10. Output File Locations

Automatically generated results are unified in:

outputs/
├── logs/       # 导出日志、运行日志等中间产物
├── reports/    # Markdown、JSON、HTML 最终报告
├── cache/      # LLM 和搜索缓存
├── data/       # CSV、JSON 画像等结构化数据
├── images/     # 图表和生成图片
└── backups/    # 强制覆盖前的备份

outputs/ is ignored by Git, and its content should be regeneratable. Hugo content is an exception: it is written directly to tools/website/content and tools/website/static.

Finally, the following should NOT be executed: git add includes:

  • Automatically generated files in outputs/
  • rclone data synchronization
  • build/
  • gadget.egg-info/
  • Deployment and theme repositories under tools/website/
  • Keys and configuration tables in tokens/
grok-4.5-high — 7,678 chars · 16/16 facts

1. Project Summary

Gadgets is a set of practical tools accumulated from daily development, covering: AI conversation daily/weekly/monthly reports, paper discovery and researcher analysis, performance benchmarking, Hugo blog automation, and document translation.

Each directory under tools/ is an independently usable tool; shared capabilities are concentrated in the common/ package in the repository root (installed via pip install -e . ), providing LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc. Optional Companion graphs and planning capabilities are available locally; the sibling repository ../ai-companion/ provides DAG publishing. Coding agents follow AGENTS.md and are not intercepted by Companion.

Repository Structure

Path Role
tools/ Five independent tool products
tools/summarize/ AI conversation daily/weekly/monthly reports
tools/research/ Paper discovery + researcher analysis + citation graphs
tools/benchmark/ CPU/GPU performance benchmarks
tools/website/ Hugo blog (incremental media compression + automatic build & publish)
tools/translator/ Gradio document translator
common/ Shared infrastructure (LLM / Cache / IO / Translation / Hugo)
scripts/ Operations scripts (sync.py, onboard.py, etc.)
docs/ Design docs, ECL plans, audit reports, historical archives
outputs/ All generated artifacts (gitignore, regeneratable)
AGENTS.md / CLAUDE.md Agent workflows / Claude Code guide
pyproject.toml Packaging configuration (pip install -e .)

To change logic, see tools/<tool>/; to change shared capabilities, see common/]; to change sync, see scripts/sync.py]; for one-time new machine configuration, see scripts/onboard.py]; to change development workflow/skill, see the sibling repository ../ai-companion/.

What Each Tool Does

  • Summarize: Reads conversation logs from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, etc., and uses LLMs to generate structured daily/weekly/monthly reports; multi-device two-stage process (export from each device → sync and merge); statistics for multi-source tokens and costs via ccusage 20.x; --api can switch between ollama (default) / claude_cli / anthropic / openai.
  • Research: Unified CLI research_scout.py, including paper discovery (three-stage LLM for arXiv/bioRxiv/PubMed), deep paper insights (--insight), researcher profiling, and citation graph analysis; also supports four LLM backends.
  • Benchmark: Cross-platform CPU/GPU FLOPS testing (CUDA / MPS / XPU, etc.), multi-precision, results appended to CSV, can generate Plotly HTML reports and deploy to Hugo.
  • Website: Hugo static blog (PaperMod, GitHub Pages); incremental compression of images/videos; local model bilingual translation; deploy artifacts from each tool are written to content|static then translated, compressed, built, and pushed.
  • Translator: A Gradio-based local translation webpage based on the common translation engine, supporting text and various file types, with tencent/Hy-MT2-1.8B as the default model.

common: LLM, JSON, SHA-256 cache, atomic writes, local translation engine, cross-platform Hugo deployment.
scripts: sync.py (rclone sync), onboard.py (new machine config), smoke.sh, serve_local_llm.sh, etc.
ai-companion: Independent repository providing optional capabilities like DAG publishing.


2. Beginner Tutorial (Based only on README)

2.1 Environment Preparation

  • Python 3.10+ (Recommended conda environment AI: conda activate AI )
  • Node.js 18+ (Only required for optional Companion graphs and DAG publishing)
  • Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • Translation/Website: Local inference (default Ollama, chat model gemma4:26b; Linux can fallback to vLLM, Windows can fallback to transformers, using tencent/Hy-MT2-1.8B, automatically downloaded on first use)
  • tokens/ contains API keys and onboarding forms; it is gitignored, do not commit
  • Tool configurations are in the repository root config.json (gitignore; copy from config.example.json ); paths can be overridden using environment variables GADGET_CONFIG

2.2 Installation

In the repository root:

# 安装 common + summarize / research / benchmark / website 等 extras
# 注意:all 不包含 translator
pip install -e ".[all]"

# 若要用文档翻译器,需单独安装
pip install -e ".[translator]"

# 仅网站相关依赖(含 torch + transformers 用于翻译)
pip install -e ".[website]"

pip install -e . will generate build/ and gadget.egg-info/ (already gitignored) in the repository root.

2.3 Configuration and Getting Started on a New Machine

Configuration Files

  1. Copy example configuration: Get the root directory config.json from config.example.json
  2. Optional: Use GADGET_CONFIG to specify a different configuration path
  3. LLM backends are globally available via GADGET_LLM_BACKEND or via command line --api: ollama (default) / claude_cli / anthropic / openai
  4. Translation backend uses GADGET_TRANSLATION_BACKEND: ollama (default, reuses gemma4:26b ) → llamacpp / vllm / transformers (in-process, model tencent/Hy-MT2-1.8B )
  5. Translation models can be overridden: GADGET_TRANSLATION_MODEL (can also be managed within the Translator GUI)

One-click New Machine Configuration (This Repository)

  1. Fill out tokens/onboard.yaml
  2. Run:
python scripts/onboard.py

It will automatically complete: SSH, Claude/Codex CLI installation and login, pip extras, configuration for each tool, and rclone bootstrap.
Note: onboarding will not install Companion; old fields install.ai_companion will be ignored.

Server-level System Installation (Optional, in ai-companion repository)

The script for Ubuntu 22.04/24.04 one-click installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion has been moved to:

bash ../ai-companion/scripts/onboard-server.sh --help

After the repository split, --companion-repo is directly transferred to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git ), and --companion-ref is no longer required.

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent knobs are written in the summarize section of the root directory config.json (paths can be overridden using GADGET_CONFIG ).### Data Synchronization (Cross-device)Configuration: config.json section of sync (or GADGET_CONFIG).

python scripts/sync.py

The README specifies support for push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups, as well as the special category dag (generating and deploying DAG sites). A cross-device example expression is:

python scripts/sync.py push
python scripts/sync.py pull

(Requires rclone to be configured first.)

Read-only Smoke Test

bash scripts/smoke.sh

(Each tool --help / --info / import; no LLM calls, no internet connection, no disk writing.)

2.4 Typical Usage of Each Tool

Summarize — Daily/Weekly/Monthly Reports

Multi-device workflow: Export conversations from each device → Sync or manually copy and aggregate to cloud storage → Generate daily reports → Accumulate to generate weekly and monthly reports. The new entry point python -m summarize is recommended (the old python tools/summarize/daily_summary.py etc. are still available).

python -m summarize daily export                                   # 阶段1:导出所有未导出日期
python -m summarize daily merge --sync-all                         # 阶段2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键:导出→合并→周报→月报+部署

LLM backend uses --api : ollama / claude_cli / anthropic / openai.

For more detailed steps, see TUTORIAL.md#summarize and tools/summarize/tutorial.md within the repository (referenced in the README; details are not expanded in this README body).


Research — Paper Discovery and Researcher Analysis

Unified entry point: tools/research/research_scout.py.

python tools/research/research_scout.py report --project my-project        # 全流程:搜索→三阶段评估→报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图(arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 报告部署到 Hugo

LLM also uses --api : ollama (default) / claude_cli / anthropic / openai.
Deep insight capabilities are noted in the README as --insight (described alongside full-text analysis, OpenReview capabilities, etc.); see TUTORIAL.md#research for specific sub-command combinations.


Benchmark — Performance Benchmarking

Note: All commands must first enter tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli                # 跑全部基准(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 仅 CPU
python -m benchmark.cli --gpu-only     # 仅 GPU
python -m benchmark.cli --report       # 跑基准 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告并发布到 Hugo /benchmark/

GPU will automatically detect CUDA / Apple MPS / Intel XPU. Result CSVs are in append mode and will not be overwritten.


Website — Hugo Blog

Automatically generated content is written to tools/website/content|static by various tools (marked with gadget_generated tags; un-tagged handwritten files will not be overwritten). tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), where build scripts automatically commit + push; do not commit directly to it.

pip install -e ".[website]"                          # 安装依赖(含 torch + transformers)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自行 cd 到自身目录)
cd tools/website && hugo server -D                   # 本地预览(含草稿)

Incremental compression: Media changed since .last_build — images via pngquant, videos via HandBrakeCLI. Translation defaults to local Ollama; the first run may download tencent/Hy-MT2-1.8B.


Translator — Gradio Document Translation

pip install -e ".[translator]"   # Gradio + GGUF 翻译栈
python -m translator             # 启动 Gradio GUI(浏览器打开)

Supports text and .md / .txt / .pdf / .docx / images; protects code blocks, URLs, Hugo shortcodes, etc. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), which can be overridden by GADGET_TRANSLATION_MODEL or the GUI. Source language can be set to auto (detected by CJK ratio); when the target is auto, it flips between zh↔en.


2.5 Outputs and Notes

Generated items are unified in outputs/ (gitignore):

outputs/
├── logs/         # 中间产物
├── reports/      # 最终报告
├── cache/        # LLM / 搜索缓存
├── data/         # CSV、JSON 画像等
├── images/       # 图表
└── backups/      # 强制覆盖备份等

Hugo content is written directly to tools/website/content|static, with no separate outputs/site.

Notes (README Notes):

  • Do not git add: automatically generated content, rclone synced data, build/ / gadget.egg-info/, deployment/theme repositories under tools/website/
  • License: GPL-3 (see LICENSE)
  • For more detailed step-by-step operations, configuration, data formats, and FAQ: see TUTORIAL.md and the respective tool documentation; for the Chinese README, see docs/README.zh.md

All commands and parameters above are taken directly from the provided README; no options not mentioned in the README have been added.

gpt-5.6-luna-high — 9,263 chars · 15/16 facts

I. Project Summary

1. What is Gadget

Gadget is a development toolkit composed of multiple independent tools, primarily covering:

  • AI conversation daily, weekly, and monthly report generation
  • Academic paper discovery, researcher analysis, and citation mapping
  • CPU/GPU performance benchmarking
  • Hugo blog automatic construction, media compression, and publishing
  • Local document translation based on Gradio

Each tools/ subdirectory is an independently usable tool. The common/ in the repository root provides shared capabilities, including:

  • LLM invocation
  • JSON parsing and repair
  • Disk caching
  • Atomic writing
  • Local translation engine
  • Hugo deployment

2. Repository Structure

gadget/
├── tools/
│   ├── summarize/      # AI 对话日报、周报、月报
│   ├── research/       # 论文发现、研究者分析、引用图谱
│   ├── benchmark/      # CPU/GPU 性能测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # 所有工具共享的基础设施
├── scripts/            # 同步、初始化、维护脚本
├── docs/               # 设计文档、计划和历史资料
├── outputs/            # 自动生成的文件,已被 Git 忽略
├── AGENTS.md           # AI Agent 工作流规范
├── CLAUDE.md           # Claude Code 使用说明
└── pyproject.toml      # Python 打包配置

Key directories:

  • Tool logic: tools/<tool>/
  • Shared capabilities: common/
  • Data synchronization: scripts/sync.py
  • New machine initialization: scripts/onboard.py
  • Configuration files: config.json in the repository root
  • Configuration templates: config.example.json
  • Sensitive information: tokens/
  • Generated results: outputs/

There is also an optional sibling repository, ../ai-companion/, responsible for DAG publishing and other Companion tools. Gadget itself does not automatically intercept Agent operations.

3. Tool Functions

summarize

Reads AI conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON formats, and calls LLMs to generate:

  • Daily reports
  • Weekly reports
  • Monthly trend summaries

It uses a multi-device two-stage workflow:

  1. Each device exports conversation dates that have not yet been exported
  2. Syncs and merges data, then generates reports

It also tracks token usage and costs for different Agent CLIs via ccusage.

Supports four LLM backends:

  • ollama: default, local Ollama, no API Key required
  • claude_cli: reuses Claude Code CLI login status
  • anthropic
  • openai

research

Provides four types of capabilities through the unified entry point tools/research/research_scout.py:

  • Paper Discovery: Searches arXiv, bioRxiv, PubMed, followed by a three-stage LLM evaluation
  • Deep Paper Insights: Analyzes paper writing structure, publication strategies, and reusable knowledge, and analyzes OpenReview comments
  • Researcher Profiling: Analyzes papers, citation data, research trajectories, and advisor-student relationships
  • Citation Mapping: Analyzes forward citations and backward references of papers

Also supports ollama, claude_cli, anthropic, and openai.

benchmark

A cross-platform CPU/GPU floating-point performance testing tool, supporting:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

Supports multiple precisions, including FP64, FP32, FP16, BF16, and experimental FP8.

Tests include warmup, formal measurement, GPU synchronization, and statistical analysis. Results are appended to CSVs (not overwriting old results) and can generate Plotly HTML reports and leaderboards.

website

A Hugo-based static blog site deployed to GitHub Pages.

Main features:

  • Incremental compression of images and videos
  • Automatic construction and publishing of the Hugo website
  • Bilingual translation using local models
  • Receives daily reports, weekly reports, research reports, and Benchmark pages
  • Automatic generation of images and site content

Website-generated content is written directly to:

tools/website/content
tools/website/static

tools/website/public/ is a separate deployment repository and should not be submitted to directly.

translator

A Gradio-based local document translator, supporting:

  • Text translation
  • Markdown
  • TXT
  • PDF
  • DOCX
  • Images

During translation, it protects Markdown code blocks, URLs, Hugo shortcodes, etc.

The default model is:

tencent/Hy-MT2-1.8B

The corresponding GGUF model is:

tencent/Hy-MT2-1.8B-GGUF

Supported local inference backends include:

  • Ollama
  • vLLM
  • transformers
  • llamacpp

4. common/, scripts/ and Companion

common/

A shared infrastructure package, installed via the following command:

pip install -e .

Provides:

  • Unified LLM API
  • JSON parsing and repair
  • SHA-256 disk caching
  • Atomic writing
  • Local translation engine
  • Hugo deployment capabilities

scripts/

Main scripts include:

  • sync.py: syncs data using rclone
  • onboard.py: new machine initialization
  • smoke.sh: read-only smoke test
  • serve_local_llm.sh: creates Ollama variants for summarization
  • language.py: Hugo bilingual audit and report renaming
  • profile_translation.py: translation engine GPU profiling

ai-companion

An optional sibling repository, primarily providing DAG publishing tools as well as planning and execution capabilities.

5. Output Directories

Generated files are concentrated in outputs/:

outputs/
├── logs/         # 导出日志和运行日志
├── reports/      # Markdown、JSON、HTML 报告
├── cache/        # LLM 缓存和搜索缓存
├── data/         # CSV、JSON 等结构化数据
├── images/       # 图表和生成图片
└── backups/      # 强制覆盖时的备份

Hugo website content is not placed in outputs/site, but written directly to tools/website/content and tools/website/static.


II. Chinese User Tutorial

1. Environment Preparation

README requirements:- Python 3.10+

  • Node.js 18+, only required when using optional Companion graph and DAG publishing features
  • Recommended to use the conda environment named AI
  • Additional dependencies for each tool are recorded in the corresponding directory’s requirements.txt

Activate the recommended conda environment:

conda activate AI

Install public packages and dependencies related to Summary, Research, Benchmark, and Website:

pip install -e ".[all]"

Note: all does not include Translator. To install translator dependencies, you need to execute extra:

pip install -e ".[translator]"

If you only need to install the shared base packages, you can execute:

pip install -e .

2. Configuration Files

Tool configurations are located at the repository root:

config.json

You can refer to:

config.example.json

README notes that config.json is ignored by Git. If you need to change the configuration file location, you can set:

GADGET_CONFIG

Sensitive information is placed in:

tokens/

This directory is ignored by Git and its contents cannot be committed.

LLM Backend Configuration

Each tool supporting LLM can select a backend via --api:

  • ollama
  • claude_cli
  • anthropic
  • openai

Global environment variables can also be used:

GADGET_LLM_BACKEND

The default backend is ollama.

Translation Backend Configuration

Translation functionality can use:

GADGET_TRANSLATION_BACKEND

The selection order and backends listed in the README include:

  • ollama
  • llamacpp
  • vllm
  • transformers

The translation model can also be overridden via the following variable:

GADGET_TRANSLATION_MODEL

3. Using Summarize

3.1 Export Chat Records

Export all dates that have not yet been exported:

python -m summarize daily export

This is the first stage of the multi-device workflow.

3.2 Sync and Merge Daily Reports

Sync all dates and merge them day by day:

python -m summarize daily merge --sync-all

3.3 Generate Weekly Reports

Generate a weekly report for a specified week and deploy it:

python -m summarize weekly generate --week 2026-W12 --deploy

3.4 Generate Monthly Reports

Generate a monthly report for a specified month and deploy it:

python -m summarize monthly generate --month 2026-02 --deploy

3.5 Execute Full Workflow

Complete export, merging, weekly reports, monthly reports, and deployment in one go:

python -m summarize auto --deploy

3.6 Select LLM Backend

For example, using local Ollama:

python -m summarize auto --api ollama

README explicitly states that the old entry point is still compatible:

python tools/summarize/daily_summary.py
python tools/summarize/weekly_summary.py
python tools/summarize/monthly_summary.py

It is recommended to use the new one:

python -m summarize

4. Using Research

The unified entry point for Research is:

tools/research/research_scout.py

4.1 Generate Research Reports

Execute the full workflow, including searching, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

4.2 Natural Language Paper Retrieval

For example, searching for recent robotics manipulation papers by Pieter Abbeel:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

This command will automatically select the appropriate data source.

4.3 Generate Researcher Profiles

python tools/research/research_scout.py profile "Sergey Levine"

4.4 Analyze Citation Graphs

You can use arXiv ID or DOI:

python tools/research/research_scout.py citations 2301.12597

4.5 Deploy Reports to Hugo

python tools/research/research_scout.py deploy

4.6 Select LLM Backend

Research also supports:

python tools/research/research_scout.py report --project my-project --api ollama

README only explicitly states that the backends supported by --api are ollama, claude_cli, anthropic, and openai.

5. Using Benchmark

README specifically requires: all Benchmark commands must first enter tools/benchmark/.

cd tools/benchmark

5.1 Run All Benchmarks

python -m benchmark.cli

Results will be appended to the CSV.

5.2 Test CPU Only

python -m benchmark.cli --cpu-only

5.3 Test GPU Only

python -m benchmark.cli --gpu-only

5.4 Test and Generate HTML Reports

python -m benchmark.cli --report

5.5 Generate Reports and Deploy to Hugo

python -m benchmark.cli --report --deploy

The tool will automatically detect CUDA, Apple MPS, and Intel XPU. OpenCL might appear in the --info detection, but README states it is not used for actual GPU execution.

6. Using Website

6.1 Install Website Dependencies

If full dependencies are not yet installed, you can execute:

pip install -e ".[website]"

This installation includes Website-related dependencies, including torch and transformers required for translation.

6.2 Build and Publish on macOS/Linux

cd tools/website && bash update.sh

This workflow will perform:

  • Incremental media compression
  • Hugo build
  • Push to GitHub Pages

Images use pngquant, and videos use HandBrakeCLI.

6.3 Build and Publish on Windows

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

README states that this script will automatically switch to its own directory.

6.4 Local Preview

cd tools/website && hugo server -D

Where -D indicates that the development server includes draft content.

6.5 Website Translation Behavior

Website uses local inference for bilingual translation:

  • Defaults to using Ollama
  • vLLM can be used on Linux
  • transformers can be used on Windows
  • Model tencent/Hy-MT2-1.8B will be automatically downloaded upon first run

Automatically generated content carries the gadget_generated tag. Hand-written content without this tag will not be automatically overwritten.

7. Using Translator

7.1 Install Translator Dependencies

pip install -e ".[translator]"

README describes it as the Gradio and GGUF translation stack dependency.

7.2 Start Gradio Interface

python -m translator

A browser will open after starting.

7.3 Translate Text and Files

The interface supports:

  • Direct text input
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

During translation, it will attempt to maintain Markdown format and protect:

  • Code blocks
  • URL
  • Hugo shortcode

7.4 Model and Language Settings

Default model:

tencent/Hy-MT2-1.8B

GGUF version:

tencent/Hy-MT2-1.8B-GGUF

The model will be automatically downloaded when used for the first time, or it can be overridden via:

GADGET_TRANSLATION_MODEL

or set in the model management function of the GUI.

The source language can be set to auto. README states it will detect through the CJK ratio of the text; when the target language is set to auto, it will automatically switch between Chinese and English.

8. Using Sync and Maintenance Scripts

8.1 Data Synchronization

sync.py uses rclone to handle cross-device data synchronization, supporting the push, pull, status, bootstrap, and config operations listed in the README.

Sync script:

python scripts/sync.py

Cross-device push and pull usage:

python scripts/sync.py push
python scripts/sync.py pull

Sync configuration is located in the sync section of the root directory config.json, and the configuration path can also be overridden via GADGET_CONFIG.

The sync categories covered by this script include:

  • summarize
  • website
  • research
  • benchmark
  • backups
  • dag

DAG categories can be processed via:

python scripts/sync.py --category dag

Generate and deploy the DAG website.

8.2 New Machine Initialization

First, fill in:

tokens/onboard.yaml

Then run:

python scripts/onboard.py

This script will automatically complete the initialization tasks listed in the README:

  • SSH configuration
  • Claude/Codex CLI installation and authentication
  • pip extras installation
  • Tool configurations
  • rclone initialization

8.3 Run Read-only Smoke Test

bash scripts/smoke.sh

This check only performs:

  • --help
  • --info
  • Import checks

It will not call LLMs, access the network, or perform write operations.

8.4 Start Local Summary Model

Generate and use an Ollama variant dedicated to summarization:

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent configuration is placed in the summarize section of the root directory config.json.

9. Optional Server-level Initialization

The server-level installation script has been migrated to the sibling repository ../ai-companion/.

View help:

bash ../ai-companion/scripts/onboard-server.sh --help

This script is intended for Ubuntu 22.04/24.04, and README states it can one-click install or configure:

  • SSH public keys
  • Claude Code
  • Codex
  • Superpowers
  • Ponytail
  • AI Companion

10. Important Notes When Using

  • tokens/ contains API Keys and initialization information and must not be committed.
  • Content in outputs/ is automatically generated and is ignored by Git.
  • Do not commit build/ and gadget.egg-info/.
  • Do not directly commit the deployment repositories or theme repositories under tools/website/.
  • Hugo content is written directly to tools/website/content and tools/website/static.
  • LLM backends can be switched via --api or GADGET_LLM_BACKEND.
  • Translation backends can be switched via GADGET_TRANSLATION_BACKEND.
  • Website and Translator use local inference and do not depend on cloud LLM APIs.
  • Generated results can usually be rebuilt from outputs/.
gemini-4-argon-high — 10,220 chars · 16/16 facts

The following is a project summary and beginner’s tutorial organized entirely based on the provided README.md content.


Part One: Project Summary

1. What is it?Gadgets (repository directory name gadget) is a collection of practical tools accumulated during daily development, covering five major directions: AI Daily Report Generation, Paper Discovery, Performance Benchmarking, Blog Automation, and Document Translation, open-sourced under the GPL-3 license.

The core architectural feature of the project is “Independent Tools + Shared Foundation”:

  • Each subdirectory under tools/ is a tool that can be used independently.
  • The common/ package under the repository root aggregates the infrastructure shared by all tools (installed via pip install -e .), providing unified capabilities such as LLM invocation, JSON parsing and repair, disk caching, atomic writing, local model translation, and Hugo deployment.
  • Locally provides optional Companion graph and planning tools; the peer directory ../ai-companion/ repository provides functions such as DAG publishing. Coding Agents follow AGENTS.md, with no Companion interception hooks.

2. Repository Structure

gadget/
├── tools/              # 5 个独立的工具产品(修改某个工具的逻辑去这里)
│   ├── summarize/      # AI 对话日 / 周 / 月报生成
│   ├── research/       # 论文发现 + 学者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建与发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 所有工具依赖的共享基础设施包(LLM / 缓存 / IO / 翻译 / Hugo)
├── scripts/            # 运维与维护脚本(sync.py, onboard.py, language.py, profile_translation.py 等)
├── docs/               # 设计文档、ECL 计划 (docs/ecl/)、审计报告、历史归档 (docs/archive/)
├── outputs/            # 所有生成的产物(已 gitignore,可自动重建:含 logs/reports/cache/data/images/backups)
├── AGENTS.md           # 所有 AI Agent 的工作流协议(行动前必读)
├── CLAUDE.md           # 面向 Claude Code 的仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置(pip install -e .)

Additionally, the README mentions the following important directories and files:

  • config.json: Tool configuration file in the repository root (gitignored, copied from config.example.json).
  • tokens/: Stores API keys and machine initialization configuration table tokens/onboard.yaml (gitignored).
  • build/ and gadget.egg-info/: Executable packaged products generated by pip install -e . (gitignored, always located in the repository root).
  • ../ai-companion/ (independent peer repository): Responsible for AI code change tracking, planning/execution skill pipelines, and all skills (based on Node.js, TypeScript).

3. What does each tool and core module do?

① Summarize (tools/summarize/) —— AI Daily/Weekly/Monthly Reports

  • Functionality: Automatically reads daily AI conversation logs (supporting Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM APIs to generate structured daily reports, weekly reports, and monthly trend summaries.
  • Multi-device Two-stage Workflow: Stage one exports conversation logs from various devices; stage two synchronizes logs via cloud drives or manual copying to aggregate them and generate the final daily report. Once enough daily reports are accumulated, weekly and monthly reports can be generated.
  • Usage and Cost Statistics: Through the source-namespace commands of ccusage 20.x (ccusage claude, ccusage codex, ccusage gemini, etc.), it automatically discovers and statistics the token usage and costs of all agent CLIs.
  • LLM Backend: Supports ollama (default, local no-key, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic, and openai.

② Research (tools/research/) —— Paper Discovery and Scholar Analysis

Provides four major functions through the unified CLI entry tools/research/research_scout.py:

  1. Paper Discovery: Searches for papers from arXiv / bioRxiv / PubMed, generates research weekly reports via a three-stage LLM pipeline (Fast Screening → Deep Evaluation → Citation Impact) and deploys them to Hugo; supports conference paper search and author search.
  2. Deep Paper Insights (--insight): Downloads full paper texts, uses LLMs to analyze writing structure, publication strategies, and reusable core knowledge; automatically matches OpenReview to obtain reviewer comments for analyzing consensus and controversy; comprehensively generates cross-paper research writing guides.
  3. Researcher Profiling: Retrieves paper and citation data from ArXiv + Semantic Scholar, uses LLMs to generate research trajectory analysis, calculates tier scores, and automatically discovers mentor-student relationships via homepage extraction + co-authorship patterns; supports name disambiguation and reverse lookup.
  4. Citation Graph Analysis: Performs forward citation/backward reference analysis based on the Semantic Scholar API, combined with LLM for impact interpretation.

③ Benchmark (tools/benchmark/) —— Performance Benchmarking Suite

  • Functionality: A cross-platform CPU/GPU floating-point performance (FLOPS) benchmarking tool, based on PyTorch, NumPy, and Plotly.
  • Hardware and Precision: Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL may only appear in --info detection); covers precisions such as FP64 / FP32 / FP16 / BF16 / FP8 (experimental).
  • Measurement and Reporting: Employs a “Warm-up + Formal Measurement + Statistical Analysis (median, IQR outlier removal)” approach and explicit GPU synchronization to ensure timing accuracy. Results are written to CSV in append mode (does not overwrite, naturally supporting multi-hardware cumulative leaderboards), can generate interactive HTML reports and leaderboards with Plotly charts, and supports deployment to Hugo websites and submission to public leaderboards.

④ Website (tools/website/) —— Hugo Blog

  • Functionality: A static blog site based on Hugo (“TzJ’s Net”, PaperMod theme), deployed on GitHub Pages (https://tzj2006.github.io/).
  • Incremental Media Compression: Only compresses media files that have changed since .last_build (images use pngquant, videos use HandBrakeCLI).
  • Local Model Bilingual Translation: Does not rely on cloud LLM APIs; defaults to Ollama (Linux falls back to vLLM, Windows falls back to transformers; fallback model tencent/Hy-MT2-1.8B is automatically downloaded upon first run).
  • Automatic Content Injection and Publishing: Reports, pages, and images automatically generated by other tools are written directly to tools/website/content|static (marked with gadget_generated, never overwriting unmarked handwritten articles), then automatically undergo translation, compression, building, and pushing to the independent deployment repository tools/website/public/ (corresponding to tzj2006/tzj2006.github.io).

⑤ Translator (tools/translator/) —— Gradio Document Translator

  • Functionality: A local Google Translate-style web translation tool (Gradio GUI) built on the common translation engine. Supports translating text and files (.md / .txt / .pdf / .docx / images) while protecting Markdown formatting (such as code blocks, URLs, Hugo shortcodes, etc.).
  • Local Inference Engine: Reuses common.engine.create_engine() to automatically select the backend (prioritizes ollama when model tags are pulled; Windows falls back to transformers, Linux prioritizes vllm, and the low-VRAM GGUF option is llamacpp). Models remain in memory (warm), with lazy loading on demand when switching models. The default model is tencent/Hy-MT2-1.8B (GGUF variant is tencent/Hy-MT2-1.8B-GGUF), which is automatically downloaded upon first use.
  • Language Identification: Source language can be set to auto (detected based on CJK ratio in text); when the target language is auto, it automatically translates between Chinese and English (zh↔en).

⑥ Shared Modules and Ops Scripts (common/ and scripts/)

  • common/: Provides a unified two-layer LLM invocation API, JSON parsing and repair, SHA-256 disk caching (supporting namespace + TTL), atomic writing and content hashing, local inference translation engine and bilingual content generation, and cross-platform Hugo deployment.
  • scripts/:
    • sync.py: A centralized data synchronization script based on rclone (supports push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories, as well as the dag category used for generating and deploying DAG sites).
    • onboard.py: A one-time initialization script for new machines at the repository level.
    • smoke.sh : Read-only smoke tests across all tools (checks --help / --info / imports, without triggering LLM, network, or writes).
    • serve_local_llm.sh: Creates an Ollama variant optimized for summarize and outputs environment variables.
    • language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (Translation engine GPU performance analysis).


Part 2: Detailed Beginner Tutorial

1. Environment Preparation

Before starting, please ensure the following basic environment requirements are met:

  • Python 3.10+ (Recommended to use the conda environment named AI):
    conda activate AI
    
  • Node.js 18+ (Only required when using optional Companion graph and DAG publishing features).
  • For specific dependencies of each tool, please refer to requirements.txt in the corresponding tool directory.

2. Installation Guide

In the repository root, select the corresponding pip command to install based on your needs:

Install the common package and all extended dependencies for summarize / research / benchmark / website (Note: [all] does not include translator):

pip install -e ".[all]"

Method B: Install Specific Modules on Demand1. Install only the common shared base package:

pip install -e .
  1. Install website dependencies (includes torch + transformers for translation):
    pip install -e ".[website]"
    
  2. Install translator dependencies separately (includes gradio + GGUF translation stack):
    pip install -e ".[translator]"
    

Verify Installation (Read-only Smoke Test)

After installation, you can run the read-only smoke test script to verify that all tool imports and basic commands are working correctly (it will not call LLM, connect to the internet, or write files):

bash scripts/smoke.sh

3. Configuration and Machine Initialization

3.1 Configuration Files (config.json)

  • Persistent configurations for each tool are stored in config.json in the repository root (already gitignored). For first-time use, please copy one from config.example.json in the root directory to generate config.json.
  • To customize the configuration file path, you can override it via the GADGET_CONFIG environment variable.

3.2 New Machine/New Server Initialization (Optional)

  • One-click Machine-level Initialization for this repository: After filling in the configuration information in tokens/onboard.yaml, run scripts/onboard.py once to automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap.
  • Ubuntu 22.04/24.04 Server System-level Installation (located in the sibling repository ../ai-companion, used for one-click installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion):
    bash ../ai-companion/scripts/onboard-server.sh --help
    

    Note: After the repository split, --companion-repo is passed directly to git@github.com:TzJ2006/ai-companion.git, and --companion-ref is no longer required.

3.3 LLM and Translation Engine Backend Configuration

  1. LLM Backend Switching:
    • Can be specified via the --api parameter when running commands, or set via the global environment variable GADGET_LLM_BACKEND.
    • Supports 4 optional values:
      • ollama (Default, local Ollama, no API key required, uses Gemma4-26B)
      • claude_cli (Reuses Claude Code CLI login state, no API key required)
      • anthropic
      • openai
    • To create a local Ollama variant optimized for summarize and load environment variables, run:
      eval "$(bash scripts/serve_local_llm.sh env)"
      
  2. Translation Engine Configuration:
    • Select the local inference backend via the GADGET_TRANSLATION_BACKEND environment variable: Default is ollama (reuses gemma4:26b from the local Ollama service), or can be set to llamacpp / vllm / transformers (runs in-process, using tencent/Hy-MT2-1.8B automatically downloaded during the first run).
    • The default translation model for the Translator tool can be overridden via the GADGET_TRANSLATION_MODEL environment variable or the model management function within the GUI.

4. Typical Usage for Each Tool

4.1 Summarize —— AI Chat Daily/Weekly/Monthly Reports

Recommended to use the python -m summarize entry point (old versions python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py remain compatible). LLM backends can be switched via --api.

# 阶段 1:导出所有尚未导出的日期对话记录
python -m summarize daily export

# 阶段 2:同步所有日期并逐日合并生成日报
python -m summarize daily merge --sync-all

# 生成指定周(如 2026-W12)的周报并部署到 Hugo
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成指定月(如 2026-02)的月报并部署到 Hugo
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流程:export → merge → weekly → monthly + 部署
python -m summarize auto --deploy

4.2 Research —— Paper Discovery and Scholar Analysis

All functions are called uniformly through tools/research/research_scout.py, supporting LLM backend switching via --api (ollama / claude_cli / anthropic / openai), and deep paper insights are supported via the --insight parameter.

# 完整论文发现流水线:搜索 → 三阶段 LLM 评估 → 生成报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索论文(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 生成指定学者的学术画像(论文、引用、研究轨迹、评级、师承关系)
python tools/research/research_scout.py profile "Sergey Levine"

# 引用图谱分析(支持传入 arXiv ID 或 DOI)
python tools/research/research_scout.py citations 2301.12597

# 将生成的研究报告部署到 Hugo 站点
python tools/research/research_scout.py deploy

4.3 Benchmark —— CPU/GPU Performance Benchmarking

Note: All benchmark commands must be executed after first cd entering the tools/benchmark/ directory.

# 1. 先进入 benchmark 工具目录
cd tools/benchmark

# 2. 运行全部基准测试(CPU + GPU,结果以追加模式写入 CSV)
python -m benchmark.cli

# 仅运行 CPU 基准测试
python -m benchmark.cli --cpu-only

# 仅运行 GPU 基准测试(自动检测 CUDA / Apple MPS / Intel XPU)
python -m benchmark.cli --gpu-only

# 运行基准测试并生成交互式 HTML 报告
python -m benchmark.cli --report

# 生成报告并发布到 Hugo 站点的 /benchmark/ 页面
python -m benchmark.cli --report --deploy

4.4 Website —— Hugo Blog Building, Compression, and Publishing

# 1. 确保已安装 website 依赖
pip install -e ".[website]"

# 2a. macOS / Linux:增量媒体压缩 + 本地双语翻译 + Hugo 构建 + 推送 GitHub Pages
cd tools/website && bash update.sh

# 2b. Windows(PowerShell):增量压缩 + 构建 + 推送(脚本会自动切换到自身所在目录)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 3. 本地启动开发服务器预览博客(包含草稿)
cd tools/website && hugo server -D

4.5 Translator —— Gradio Local Document Translator

# 1. 确保已安装 translator 依赖
pip install -e ".[translator]"

# 2. 启动 Gradio 网页翻译界面(会在浏览器中打开)
python -m translator

4.6 Cross-device Data Synchronization (scripts/sync.py)

Depends on rclone configuration, reading the sync section in the config.json of the repository root.

# 运行同步脚本(支持 push / pull / status / bootstrap / config,以及 --category dag)
python scripts/sync.py

# 推送或拉取跨设备数据
python scripts/sync.py push
python scripts/sync.py pull

5. Directory Artifacts and Important Notes

  1. Output Directory (outputs/): All intermediate logs (logs/ ), final reports (reports/ ), caches (cache/ ), structured data (data/ ), charts (images/ ), and forced overwrite backups (backups/ ) generated by all tools are uniformly saved under outputs/.
  2. Hugo Content Writing Mechanism: Content deployed to the blog by each tool is written directly to tools/website/content|static (files are marked with gadget_generated ; handwritten articles without this mark will never be overwritten).
  3. Git Commit Taboos (NEVER manually git add or commit the following content):
    • API keys and onboard.yaml under the tokens/ directory
    • config.json configuration files
    • All auto-generated artifacts and rclone sync data under outputs/
    • Packaging products of build/ and gadget.egg-info/
    • tools/website/public/ (this is an independent tzj2006/tzj2006.github.io deployment repository, automatically committed and pushed by build scripts, do not commit to it manually) and the theme repository under tools/website/.
muse-wonder-1.0-high — 13,751 chars · 16/16 facts

I. Project Summary

1. What it is

Gadget / Gadgets is a collection of practical tools accumulated by the author during daily development, covering five types of work:

  • AI Chat Daily/Weekly/Monthly Report generation
  • Paper discovery and researcher analysis
  • CPU / GPU performance benchmarking
  • Hugo blog automation
  • Document translation

Each directory under tools/ is a tool that can be used independently; the common/ in the repository root is the shared infrastructure package for all tools, installed via pip install -e ., providing general capabilities such as LLM calling, JSON parsing, disk caching, atomic writing, translation, Hugo deployment, etc.

Optional Companion graphs and planning tools are available locally; the sibling ../ai-companion/ repository provides DAG publishing functionality. README special note: This repository does not have Companion interception hooks; coding Agents follow AGENTS.md.

This README is only an overview. For step-by-step operations, configuration, data formats, and FAQs for each tool, refer to TUTORIAL.md and the source documentation of each tool.

2. Repository Structure

gadget/
├── tools/              # 五个独立工具产品(改某个工具就去这里)
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM / 缓存 / IO / 翻译 / Hugo)——所有工具都依赖它
├── scripts/            # 运维与维护脚本(sync.py、onboard.py、language.py、profile_translation.py 等)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档(docs/archive/)
├── outputs/            # 所有生成产物(已 gitignore,可自动重建)
├── AGENTS.md           # 所有 AI Agent 的工作流协议(行动前先读)
├── CLAUDE.md           # 给 Claude Code 的仓库指南
└── pyproject.toml      # common/ 与各工具的打包配置(pip install -e .)

Where to go when you want to change something:

Task Where to go
Change logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / Cache / Translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time initialization for a new machine scripts/onboard.py
Change development workflow / a specific skill ai-companion repository (sibling ../ai-companion/ )
Read plans / design documents docs/ecl/, docs/

Additional note: Companion tools are optional and require explicit execution; there are no Agent hooks. build/ and gadget.egg-info/ are generated by pip install -e . (already gitignored, always located in the repository root). Run python scripts/sync.py for sync data.

3. What each tool does

3.1 tools/summarize/ — AI Chat Daily/Weekly/Monthly Reports

  • Automatically reads daily AI chat records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLM APIs to generate structured daily, weekly, and monthly reports.

  • Multi-device two-stage workflow: Export chat logs from each device → aggregate via cloud drive sync or manual copy → generate final daily reports; once enough daily reports are accumulated, generate weekly and monthly trend summaries.

  • Automatically discovers and statistics token usage and costs for all Agent CLIs through the source-named commands of ccusage 20.x (ccusage claude , ccusage codex , ccusage gemini …).

  • Four AI summary backends, switched uniformly via --api: ollama (Default, local Ollama, no key required, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no API key required), anthropic , openai .

  • Key technologies: Claude/OpenAI API, ccusage 20.x (unified multi-source), matplotlib.### 3.2 tools/research/ — Paper Findings and Researcher AnalysisA unified academic research toolbox that provides four major capabilities through a single CLI entry point tools/research/research_scout.py:

  • Paper Discovery: Search for papers from arXiv / bioRxiv / PubMed using a three-stage LLM pipeline (Fast Screening → Deep Evaluation → Citation Impact), generate research weekly reports and deploy them to Hugo; supports conference paper search and author search.

  • Deep Paper Insights (--insight): Download full-text papers, let the LLM analyze their writing structure, publication strategies, and reusable core knowledge; automatically match OpenReview to obtain reviews and analyze consensus and controversies; synthesize cross-paper research writing guides.

  • Researcher Profiling: Obtain paper and citation data from ArXiv + Semantic Scholar, use LLM to generate research trajectory analysis, calculate tier scores, and automatically discover mentor–student relationships via homepage extraction + collaborator patterns; supports name disambiguation and reverse lookup.

  • Citation Graph Analysis: Forward citation / backward reference analysis based on Semantic Scholar API, combined with LLM-driven impact interpretation.

All LLM functions support switching backends using --api: ollama (default), claude_cli, anthropic, openai.

3.3 tools/benchmark/ — Performance Benchmark Suite

  • Cross-platform CPU/GPU FLOPS benchmarking, unifying floating-point performance measurements across different hardware vendors and precision levels.
  • Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU); OpenCL may only appear in --info detection results.
  • Covered precisions: FP64 / FP32 / FP16 / BF16 / FP8 (experimental).
  • Measurement method: Warm-up + Formal Measurement + Statistical Analysis (median, IQR outlier removal), with explicit GPU synchronization to ensure timing accuracy.
  • Results are accumulated in CSV in append mode (never overwrites, naturally supports multi-hardware cumulative leaderboards); can generate interactive HTML reports and leaderboards with Plotly charts, supporting deployment to Hugo websites and submission to public leaderboards.
  • Key technologies: PyTorch, NumPy, Plotly.

3.4 tools/website/ — Hugo Blog

  • Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages: https://tzj2006.github.io/.
  • Built-in incremental image/video compression pipeline: only compresses media changed since .last_build (images via pngquant, videos via HandBrakeCLI).
  • Local model bilingual translation: Ollama by default, with vLLM on Linux and transformers on Windows as fallbacks; model tencent/Hy-MT2-1.8B is automatically downloaded upon its first run, without using cloud LLM APIs.
  • Automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly to tools/website/content|static by various deployment pipelines (the unique Hugo content root directory, files are marked with gadget_generated; unmarked handwritten files will never be overwritten), then translated, compressed, built, and pushed.
  • tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), automatically committed + pushed by build scripts; do not commit directly into it.

3.5 tools/translator/ — Gradio Document Translator

  • A Gradio document translator built on the common translation engine: a Google Translate-style local translation webpage that can translate text and files (.md / .txt / .pdf / .docx / images), while preserving Markdown formatting (snippets like code blocks, URLs, Hugo shortcodes, etc., are protected).
  • Local inference, no cloud APIs: reuses common.engine.create_engine() to automatically select backends (prioritizes ollama if the model tag is already pulled; transformers is the Windows fallback, vllm is prioritized on Linux, and llamacpp is the low-VRAM GGUF option); models remain in memory for warmth, with on-demand lazy loading when switching models.
  • Default model tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded upon first use, can be overridden via GADGET_TRANSLATION_MODEL or the model management within the GUI.
  • Source language can be set to auto (detected by CJK ratio of the text); when the target language is auto, it flips between zh↔en.

3.6 common/ — Shared Infrastructure Package

The shared layer that all tools depend on, installed as a Python package via pip install -e .:

  • LLM invocation (unified two-layer API, supporting four backends: ollama (default) / claude_cli / anthropic / openai)
  • JSON parsing and repair
  • SHA-256 disk caching (namespace + TTL)
  • Atomic writing and content hashing
  • Local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation
  • Cross-platform Hugo deployment

3.7 scripts/ — Ops & Maintenance Scripts

  • sync.py — Centralized rclone data synchronization (push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories; there is also a special dag category for generating + deploying DAG sites). Run python scripts/sync.py; configuration is in the sync section of the repository root config.json (paths can be overridden via GADGET_CONFIG).
  • onboard.py — Repository-level one-time initialization for new machines: fill out a YAML table (tokens/onboard.yaml), run the script once, and it automatically completes SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap.
  • smoke.sh — A read-only smoke test covering all tools (--help / --info / import checks; does not call LLMs, does not connect to the internet, does not write files). Run bash scripts/smoke.sh.
  • serve_local_llm.sh — Creates an Ollama variant optimized for summarize and prints environment variables (eval "$(bash scripts/serve_local_llm.sh env)"). Persistence knobs are located in the summarize section of the repository root config.json (paths can be overridden via GADGET_CONFIG).
  • Others: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU performance analysis).

3.8 AI Companion (Optional Tool)

The peer ../ai-companion/ repository provides the DAG publishing tool used by scripts/sync.py --category dag. Existing local idea graphs, manual graph commands, and skills remain available. This repository has no Companion interception hooks; onboarding will not install Companion. Original install.ai_companion settings (including those in the old version of the onboarding table) will be ignored.

Tool Overview:

Directory Function Key Technologies
tools/summarize/ AI conversation daily/weekly/monthly report summary (multi-device two-stage architecture) Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Paper discovery + researcher analysis + citation graph arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
tools/benchmark/ Cross-platform CPU/GPU performance benchmark PyTorch, NumPy, Plotly
tools/website/ Hugo blog site (incremental media compression + auto build & publish) Hugo, pngquant, HandBrakeCLI
tools/translator/ Gradio document translator (based on common translation engine) Gradio, GGUF/transformers
common/ Shared infrastructure package (LLM, cache, IO, translation, Hugo deployment) pip install -e .
scripts/ Ops & maintenance scripts (sync.py rclone sync, onboard.py machine config, etc.) rclone, Python
../ai-companion/ (Independent Repo) AI code change tracking + planning/execution skill pipeline + all skills Node.js, TypeScript

4. Output Directory

All generated products are unified in outputs/ (already gitignored, can be automatically rebuilt):

outputs/
├── logs/         # 中间产物(导出日志、运行日志)
├── reports/      # 最终报告(Markdown、JSON、HTML)
├── cache/        # LLM 缓存、搜索缓存
├── data/         # 结构化数据(CSV、JSON 画像)
├── images/       # 图表与生成的图片
└── backups/      # 强制覆盖备份(website-force 等)

Hugo site content is written directly to tools/website/content|static (no separate outputs/site staging tree).


II. Chinese User Tutorial (For First-time Users)

Note: This tutorial only uses commands and parameters that appear in the README. The README itself is an overview; for step-by-step details of each tool, please follow the instructions to see TUTORIAL.md and each tool’s own documentation (noted at the end of each section below).

1. Environment Preparation

Environment requirements provided in the README:

  • Python 3.10+ (conda environment AI recommended, activate with conda activate AI)
  • Node.js 18+ (only required for optional Companion graphs and DAG publishing tools)
  • Dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • Website/translation functions use local inference engines: Ollama by default (the same gemma4:26b chat model is used for translation); vLLM on Linux and transformers on Windows as fallbacks (using tencent/Hy-MT2-1.8B, automatically downloaded upon first run)

Two additional global conventions regarding backends, to give you a concept:- LLM backends are unified and switched using the --api parameter: ollama (default), claude_cli, anthropic or openai; you can also use the GADGET_LLM_BACKEND environment variable for global settings.

  • The translation path uses a local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama (default, local Ollama service, reusing existing conversation tags gemma4:26b) → llamacpp / vllm / transformers (in-process, model tencent/Hy-MT2-1.8B).

2. Installation

Execute in the repository root. Common installation methods for ```bash pip install -e “.[all]”

 shared packages + tool extras:

```bash
pip install -e ".[all]"

Note: all does not include translator; the translator must be installed separately:

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)

If you only care about the website (including torch + transformers required for translation), you can install website extras:

pip install -e ".[website]"                          # 安装依赖(含翻译用的 torch + transformers)

To install only the shared infrastructure package itself:

pip install -e .

3. Configuration

The configuration locations mentioned in the README are as follows:

  • Tool settings are located in config.json at the repository root (gitignored, copied from config.example.json). The path can be overridden using the GADGET_CONFIG environment variable.
  • Data synchronization configuration is in the sync section of config.json (the path can also be overridden via GADGET_CONFIG); cross-device data synchronization uses python scripts/sync.py push/pull (requires rclone to be configured first).
  • The persistence knob for serve_local_llm.sh is placed in the summarize section of config.json (the path can be overridden via GADGET_CONFIG).
  • The tokens/ directory stores API keys and onboarding tables, which is gitignored—never commit its contents.
  • Translation models can be overridden via the GADGET_TRANSLATION_MODEL environment variable (default tencent/Hy-MT2-1.8B), or managed within the translator’s GUI.
  • One-click initialization for new machines (machine configuration for this repo): Use scripts/onboard.py—run it once after filling in tokens/onboard.yaml to automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap.
  • Server-level system installation (a script for one-click installation of SSH public keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion on Ubuntu 22.04/24.04 servers) has been migrated to the ai-companion repository: ../ai-companion/scripts/onboard-server.sh. After the repository split, --companion-repo is directly passed to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), and --companion-ref is no longer needed. For usage, see:
bash ../ai-companion/scripts/onboard-server.sh --help

A few auxiliary scripts worth knowing when starting for the first time:

python scripts/sync.py                                # 数据同步入口(rclone)
bash scripts/smoke.sh                                 # 只读冒烟检查:各工具 --help / --info / 导入,不调用 LLM、不联网、不写文件
eval "$(bash scripts/serve_local_llm.sh env)"         # 创建 summarize 调优的 Ollama 变体并加载其环境变量

4. Typical Usage of Each Tool

4.1 summarize — AI Daily/Weekly/Monthly Reports

The recommended new entry point is python -m summarize. The daily two-stage process (export from each device first, then aggregate and merge) allows you to accumulate daily reports before generating weekly/monthly ones; or you can run the entire pipeline with a single command:

python -m summarize daily export                                   # 阶段 1:导出所有未导出的日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键全流水线:导出 → 合并 → 周报 → 月报 + 部署

Supplements:

  • Old entry points python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available (backward-compatible shims), but the above python -m summarize format is recommended.
  • The four summary backends are switched via --api: ollama (default, local, keyless, Gemma4-26B), claude_cli (reuses Claude Code CLI login status, no API key required), anthropic, or openai.
  • For detailed steps, see the Summarize section in TUTORIAL.md and tools/summarize/tutorial.md.

4.2 research — Paper Discovery and Researcher Analysis

The unified entry point is tools/research/research_scout.py, with four typical operations:

python tools/research/research_scout.py report --project my-project        # 全流水线:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由数据源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图(按 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 把报告部署到 Hugo

Supplements:

  • All LLM features support switching backends via --api: ollama (default, local Ollama, keyless, Gemma4-26B), claude_cli (no API key required), anthropic, or openai.
  • For detailed steps, see the Research section in TUTORIAL.md and tools/research/TUTORIAL.md.

4.3 benchmark — Performance Benchmarking

Note: All commands must first cd into tools/benchmark/:

# 注意:所有命令都需要先 cd 到 tools/benchmark/
cd tools/benchmark
python -m benchmark.cli                # 运行全部基准测试(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 只测 CPU
python -m benchmark.cli --gpu-only     # 只测 GPU
python -m benchmark.cli --report       # 运行基准测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo 的 /benchmark/

Supplements:

  • GPU benchmarking automatically detects CUDA / Apple MPS / Intel XPU.
  • Results are appended to the CSV and will not overwrite old results, so the same CSV can naturally accumulate scores from multiple hardware setups.
  • For detailed steps, see the Benchmark section in TUTORIAL.md and tools/benchmark/tutorial.md.

4.4 website — Hugo Blog

First, install dependencies (if .[all] is already installed, you can skip this; all already includes website extras):

pip install -e ".[website]"                          # 安装依赖(含翻译用的 torch + transformers)

Build, publish, and local preview:

cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自己 cd 到所在目录)
cd tools/website && hugo server -D                   # 本地预览(开发服务器,包含草稿)

Note:

  • tools/website/public/ is an independent deployment repository, which is automatically committed and pushed by the build script; do not commit directly to it.
  • Automatically generated content is written to tools/website/content|static by various deployment pipelines, and will only overwrite files marked with gadget_generated; manually written files will not be affected.
  • For detailed steps, see the Website section in TUTORIAL.md and tools/website/CLAUDE.md.

4.5 translator — Gradio Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio GUI(在浏览器中打开)

Usage (as described in README): Translate text within the opened webpage, or upload .md / .txt / .pdf / .docx / image files for translation; Markdown formatting will be preserved, and snippets like code blocks, URLs, and Hugo shortcodes are protected from translation. The default model is automatically downloaded upon first use; the source language can be set to auto for auto-detection, and the target language auto will automatically flip between Chinese and English. For detailed steps, see the Translator section in TUTORIAL.md; to see the code wiring, refer to tools/translator/app.py (UI), tools/translator/core.py (translation and file logic), and common/engine.py & common/translation.py (shared engine).

5. Newcomer Notes (from README Notes)

  • GPU benchmarking automatically detects CUDA / Apple MPS / Intel XPU.
  • The tokens/ directory holds API keys and onboarding tables; it is gitignored, never commit it.
  • All generated files are output to the outputs/ directory (gitignored).
  • LLM backends are unified and switched via --api: ollama (default), claude_cli, anthropic, or openai (or use GADGET_LLM_BACKEND for global settings).
  • The translation path uses a local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers.
  • Cross-device data synchronization uses python scripts/sync.py push/pull (requires rclone configuration).
  • Never git add automatically generated content, rclone synchronized data, build artifacts (build/, gadget.egg-info/), or the deployment/theme repositories under tools/website/.
  • Tool settings are in config.json at the repository root (gitignored, copied from config.example.json); use GADGET_CONFIG to override the path.
  • The license is GPL-3 (see LICENSE).

6. Suggested Learning Order

  1. Prepare a Python 3.10+ environment according to Sections 1–2 and execute pip install -e ".[all]" (add pip install -e ".[translator]" if the translator is needed).
  2. When full configuration for a new machine is required, fill in tokens/onboard.yaml first, then use scripts/onboard.py to initialize everything at once; for old machines/server-level installations, follow ../ai-companion/scripts/onboard-server.sh.
  3. Run bash scripts/smoke.sh first to perform a read-only smoke test, ensuring that the --help / --info / imports for each tool are working correctly.
  4. Pick the tool you need most, run its command once according to Section 4, and then read the corresponding TUTORIAL.md chapter and the source documentation within that tool’s directory for deeper understanding.
gpt-5.5-high — 6,341 chars · 15/16 facts

I will organize this based solely on the README content you provided, without reading or assuming other files in the repository; I will first provide a project overview, followed by a beginner’s tutorial with copyable commands. The following content is organized strictly based on the README you provided.

1. Project Chinese Summary

gadget is a collection of daily development tools covering scenarios such as AI conversation summarization, paper discovery, performance benchmarking, blog automation, and document translation. Each directory under tools/ in the repository is an independently usable tool; general capabilities are placed in the common/ package at the root, which is reused by each tool after installation via pip install -e ..

Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现、研究者分析、引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施:LLM、缓存、IO、翻译、Hugo 部署等
├── scripts/            # 运维和维护脚本
├── docs/               # 设计文档、计划、审计报告、历史归档
├── outputs/            # 所有生成产物,已 gitignore
├── AGENTS.md           # AI agent 工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 包配置

What each tool doestools/summarize/:Automatically reads AI conversation logs from Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, etc., to generate daily, weekly, and monthly reports. Supports multi-device export, synchronization, merging, and statistics for token usage and costs. LLM backends available: ollama, claude_cli, anthropic, openai.

tools/research/:Academic research tool, with a unified entry point at tools/research/research_scout.py. Supports paper search, research weekly reports, deep paper analysis, OpenReview comment analysis, researcher profiling, citation graph analysis, and can deploy reports to Hugo.

tools/benchmark/:Cross-platform CPU/GPU FLOPS benchmarking tool. Supports NVIDIA CUDA, Apple MPS, Intel XPU, covering precisions such as FP64 / FP32 / FP16 / BF16 / FP8. Results are appended to CSV, and can generate Plotly HTML reports and leaderboards, or be deployed to Hugo.

tools/website/:Hugo static blog, deployed to GitHub Pages. Includes incremental image/video compression, bilingual translation, build, and publishing workflows. Automatically generated content will be written to tools/website/content|static, while hand-written content will not be overwritten.

tools/translator/:Local document translator based on Gradio, supporting text and .md / .txt / .pdf / .docx / image files. Uses the translation engine of common, with tencent/Hy-MT2-1.8B as the default model, which will be automatically downloaded upon first use.

common/:Shared infrastructure package, providing capabilities such as LLM calls, JSON repair, SHA-256 disk caching, atomic writes, local translation engine, Hugo deployment, etc.

scripts/:Collection of operations scripts, e.g., sync.py for rclone data synchronization, onboard.py for new machine initialization, smoke.sh for read-only smoke checks, and serve_local_llm.sh for configuring local Ollama variants.

../ai-companion/:An independent optional companion repository for DAG publishing, planning/execution skill pipelines, etc. This repository will not install Companion intercept hooks.

2. Chinese Usage Tutorial

Environment Preparation

README requirements:

  • Python 3.10+
  • Recommended conda environment AI
  • Node.js 18+, used only for optional Companion graph and DAG publishing tools
  • Extra dependencies for each tool can be found in the corresponding directory’s requirements.txt
  • Cross-device synchronization requires rclone configuration
  • Hugo blog related functions require Hugo, as well as image/video compression tools pngquant, HandBrakeCLI
  • Translation defaults to using a local inference engine via Ollama; Linux can use vLLM, Windows can use transformers fallback

It is recommended to enter the conda environment first:

conda activate AI

Installation

Install the shared package:

pip install -e .

Install extras such as common, summarize, research, benchmark, website, etc.:

pip install -e ".[all]"

Note: The README explicitly states that all does not include translator. The translator needs to be installed separately:

pip install -e ".[translator]"

If only installing website-related dependencies:

pip install -e ".[website]"

Configuration

Tool configurations are located in config.json at the repository root, which is gitignored; the README instructs to copy from config.example.json. The configuration file path can be overridden using GADGET_CONFIG.

Unified support for API / LLM backends:

  • ollama: Default, local Ollama, no key required
  • claude_cli: Reuses Claude Code CLI login status, no API key required
  • anthropic
  • openai

You can switch via the --api parameter of each tool, or set it via the global environment variable GADGET_LLM_BACKEND.

The translation backend is controlled by GADGET_TRANSLATION_BACKEND. The selection order/backends listed in the README include:

  • ollama
  • llamacpp
  • vllm
  • transformers

The translation model can be overridden via GADGET_TRANSLATION_MODEL.

The tokens/ directory is used to save API keys and onboarding sheets; it is gitignored, and the README specifically emphasizes not to commit its contents.

Summarize: AI Conversation Daily / Weekly / Monthly Reports

The typical workflow is: first export conversation logs from various devices, then synchronize and merge them, and finally generate daily, weekly, and monthly reports.

Export all unexported dates:

python -m summarize daily export

Synchronize all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate a weekly report for a specific week and deploy:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate a monthly report for a specific month and deploy:

python -m summarize monthly generate --month 2026-02 --deploy

One-click full pipeline: Export, merge, generate weekly report, generate monthly report, and deploy:

python -m summarize auto --deploy

The README also mentions that old entry points are still compatible, such as python tools/summarize/daily_summary.py ..., weekly_summary.py, monthly_summary.py, but the new python -m summarize format is recommended.

Research: Paper Discovery and Researcher Analysis

Unified entry point:

python tools/research/research_scout.py

Full paper discovery pipeline: Search, three-stage evaluation, and report generation:

python tools/research/research_scout.py report --project my-project

Natural language search with automatic data source routing:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate researcher profiles:

python tools/research/research_scout.py profile "Sergey Levine"

Perform citation graph analysis by arXiv ID / DOI:

python tools/research/research_scout.py citations 2301.12597

Deploy research reports to Hugo:

python tools/research/research_scout.py deploy

The README states that Research’s LLM functionality also supports switching via --api: ollama, claude_cli, anthropic, openai.

Benchmark: CPU/GPU Performance Testing

The README explicitly states: all benchmark commands require entering tools/benchmark/ first.

cd tools/benchmark

Run all benchmarks and append results to CSV:

python -m benchmark.cli

Test CPU only:

python -m benchmark.cli --cpu-only

Test GPU only:

python -m benchmark.cli --gpu-only

Run benchmarks and generate an HTML report:

python -m benchmark.cli --report

The /benchmark/ for generating reports and publishing to Hugo:

python -m benchmark.cli --report --deploy

The README states that the GPU will automatically detect CUDA / Apple MPS / Intel XPU; OpenCL may only appear in --info detection.

Website: Hugo Blog

Install website dependencies:

pip install -e ".[website]"

Incremental compression, Hugo build, and push to Pages under macOS / Linux:

cd tools/website && bash update.sh

Run update script under Windows:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview, including drafts:

cd tools/website && hugo server -D

Special reminder from the README: tools/website/public/ is a separate deployment repository that will be automatically committed and pushed by the build script; do not commit it directly.

Translator: Gradio Document Translator

Install translator dependencies:

pip install -e ".[translator]"

Start the Gradio GUI and open in a browser:

python -m translator

Supported content includes text and .md / .txt / .pdf / .docx / image files. The README states that it will protect Markdown format fragments, such as code blocks, URLs, and Hugo shortcodes. When the source language is set to auto and the target language to auto, it will automatically switch between Chinese and English.

scripts: Synchronization, Initialization, and Checks

Run the centralized rclone data synchronization script:

python scripts/sync.py

Cross-device synchronization available via:

python scripts/sync.py push
python scripts/sync.py pull

Read-only smoke check, without performing LLM, network, or write operations:

bash scripts/smoke.sh

Create an Ollama variant optimized for summarize and print the environment:

eval "$(bash scripts/serve_local_llm.sh env)"

The README description for new machine onboarding is: after filling in tokens/onboard.yaml, run scripts/onboard.py once; it will handle SSH, Claude/Codex CLI installation/authentication, pip extras, tool configurations, and rclone bootstrap.

Server-level system installation scripts have been migrated to the companion repository ../ai-companion/; see help:

bash ../ai-companion/scripts/onboard-server.sh --help

Output Directories and Precautions

All rebuildable generated artifacts are concentrated in outputs/ and are gitignored:

outputs/
├── logs/
├── reports/
├── cache/
├── data/
├── images/
└── backups/

The README also emphasizes not to git add automatically generated content, rclone synchronized data, build artifacts build/, gadget.egg-info/, or the deployment/theme repositories under tools/website/.

gemini-3.8-flash-high — 7,393 chars · 16/16 facts

Based on the README content of the open-source project gadget, the project summary and usage tutorial are organized as follows:


Part One: Project Chinese Summary

1. Project Introduction (What it is)gadget is a collection of practical tools accumulated from daily development practices, covering five major domains: AI Daily Report Generation, Academic Paper Discovery, Performance Benchmarking, Blog Automated Maintenance, and Local Document Translation.

  • Modular Independence: Each tool under the tools/ directory is an independent product and can be run separately.
  • Shared Underlying Layer: The common/ package in the repository root provides universal infrastructure for the entire repository (LLM calls, JSON parsing and repair, disk caching, atomic writes, local translation engine, and Hugo deployment capabilities).
  • External Collaboration: Features optional local Companion graph and planning tools; DAG publishing is supported by the sibling repository ../ai-companion/; Coding Agent follows the AGENTS.md specification.
  • Open Source License: GPL-3.

2. Repository Structure

gadget/
├── tools/              # 五个独立的工具产品
│   ├── summarize/      # AI 对话日 / 周 / 月报生成
│   ├── research/       # 论文发现 + 研究者画像分析 + 引用图谱
│   ├── benchmark/      # CPU / GPU 跨平台性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动化构建与发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM / cache / IO / translation / Hugo 部署)
├── scripts/            # 运维与维护脚本(sync.py, onboard.py, language.py, smoke.sh 等)
├── docs/               # 设计文档、ECL 计划(docs/ecl/)、审计报告、历史归档
├── outputs/            # 统一输出目录(已 gitignore,可自动重建:logs/, reports/, cache/, data/, images/, backups/)
├── AGENTS.md           # 所有 AI Agent 的工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ 及各个工具的 Python 打包配置

3. Tool Functionality Introduction

Tool Directory Tool Name Main Functions & Core Technologies
tools/summarize/ Summarize
(AI Conversation Summary)
AI Conversation Daily/Weekly/Monthly Report Generation: Supports a multi-device two-stage workflow (local log export -> sync and merge). Reads Claude Code, Codex, Cursor Agent, ChatGPT, and general JSON records; utilizes ccusage 20.x to statistics Token usage and costs of various Agent CLIs, and calls LLMs to generate structured reports. Supports 4 LLM backends (ollama, claude_cli, anthropic, openai).
tools/research/ Research
(Academic Research Suite)
Academic Discovery and Analysis Tools (CLI entry research_scout.py):
1. Paper Discovery: Retrieves arXiv / bioRxiv / PubMed, generates weekly reports and deploys them via a three-stage LLM pipeline (initial screening -> deep evaluation -> citation impact);
2. Deep Insights (--insight): Downloads full texts to analyze writing structures and publication strategies, combining OpenReview review analysis for consensus and controversy;
3. Researcher Profiling: Analyzes trajectories by combining ArXiv and Semantic Scholar and calculates Tier scores, automatically extracting teacher-student relationships from homepages;
4. Citation Graph: Based on Semantic Scholar’s forward/backward citation analysis and LLM impact interpretation.
tools/benchmark/ Benchmark
(Performance Benchmarking)
Cross-platform CPU/GPU FLOPS Computing Power Benchmarking: Uniformly measures floating-point performance across different hardware and precision gradients. GPU supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL is used only for --info detection), covering FP64/FP32/FP16/BF16/FP8 (experimental). Employs warmup + formal measurement + IQR outlier removal and explicit GPU synchronization. Results are stored in CSV in append mode, can generate Plotly interactive HTML reports and leaderboards, and supports deployment to Hugo sites.
tools/website/ Website
(Hugo Personal Blog)
Hugo Static Blog Automated Workflow (“TzJ’s Net”, PaperMod theme, deployed on GitHub Pages): Includes an incremental multimedia compression pipeline (images via pngquant, videos via HandBrakeCLI, processing only changed content) and local model bilingual translation (default Ollama, fallback supports Linux vLLM / Windows transformers, using model tencent/Hy-MT2-1.8B). Automatically generated content carries the gadget_generated identifier; build scripts automatically commit and push to the deployment repository tools/website/public/.
tools/translator/ Translator
(Gradio Document Translation)
Local Document and Text Translation Web App: Based on the common translation engine, providing a Google Translate-like Web GUI. Supports translation of text and .md / .txt / .pdf / .docx / image files, maintaining Markdown format (protecting code blocks, URLs, Hugo shortcodes, etc.). Purely local inference (prefers Ollama, Linux prefers vLLM, Windows falls back to transformers, low VRAM chooses llamacpp), default model is tencent/Hy-MT2-1.8B (GGUF version), supports CJK ratio detection for automatic language recognition and Chinese-English mutual translation.

Part 2: Detailed Usage Tutorial

1. Environment Preparation

  • Python Version: Python 3.10+ (recommended to create and activate conda environment AI):
    conda activate AI
    
  • Node.js: Node.js 18+ (only for optional Companion graph and DAG publishing tools).
  • External System Tools (for corresponding tools):
    • website media compression requires system-level tools pngquant and HandBrakeCLI, as well as the static site builder hugo.
    • Data synchronization functions require installing and configuring rclone.

2. Installation Guide

The project supports installing different extras on demand via pip’s editable mode (-e):

# 方式 A:一次性安装 common 基础包及 summarize / research / benchmark / website 工具依赖
pip install -e ".[all]"

# 方式 B:单独安装 Translator 工具依赖(注意:.[all] 不包含 translator,需单独安装)
pip install -e ".[translator]"

# 方式 C:仅安装 Website 工具所需依赖(包含用于本地翻译的 torch + transformers)
pip install -e ".[website]"

# 方式 D:仅安装根目录 common 基础依赖包
pip install -e .

Note: pip install -e . will generate build/ and gadget.egg-info/ directories in the root directory, which have been excluded in .gitignore.


3. Configuration Instructions

  1. Configuration File config.json:
    • Configurations for all tools in the repository are uniformly saved in config.json at the repository root (already gitignored).
    • For first-time use, you can copy and create it from config.example.json.
    • To customize the configuration file path, you can set the environment variable GADGET_CONFIG.
  2. Credentials and Keys Directory tokens/:
    • The tokens/ directory stores API keys and one-click setup configurations; it has been gitignored and is strictly forbidden from being committed to Git.
  3. New Server/New Machine One-click Configuration (Onboarding):
    • After filling out the tokens/onboard.yaml configuration, run the script to complete SSH, Claude/Codex CLI authentication, pip dependencies, and rclone initialization:
      python scripts/onboard.py
      
    • To perform a system-level one-click installation on Ubuntu 22.04/24.04, refer to the sibling repository script help:
      bash ../ai-companion/scripts/onboard-server.sh --help
      
  4. Switching LLM Backends:
    • Tools support switching backends uniformly via the --api parameter, options include:
      • ollama (default, uses local Ollama, no API Key required, model Gemma4-26B)
      • claude_cli (reuses Claude Code CLI login status, no API Key required)
      • anthropic
      • openai
    • Can also be set via the global environment variable GADGET_LLM_BACKEND.
    • Start a tuned local Ollama and export environment variables:
      eval "$(bash scripts/serve_local_llm.sh env)"
      
  5. Local Translation Engine Configuration:
    • Switch via the environment variable GADGET_TRANSLATION_BACKEND: ollama (default, reuses gemma4:26b) → llamacpp / vllm / transformers (runs tencent/Hy-MT2-1.8B model, automatically downloads on first run).
    • The default translation model can be overridden via the environment variable GADGET_TRANSLATION_MODEL.

4. Typical Usage and Commands for Each Tool

Tool 1: Summarize (AI Conversation Summary)

# 阶段 1:导出所有未导出的对话记录
python -m summarize daily export

# 阶段 2:同步所有日期的记录并逐日合并生成日报
python -m summarize daily merge --sync-all

# 生成指定周的周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成指定月份的月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全自动流程:export -> merge -> weekly -> monthly 并且发布部署
python -m summarize auto --deploy

Tool 2: Research (Academic Paper and Researcher Analysis)

# 完整流程:论文检索 -> 三阶段评估 -> 生成项目报告
python tools/research/research_scout.py report --project my-project

# 自然语言搜索论文(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 分析指定研究者画像(轨迹、Tier 分数、合作网络)
python tools/research/research_scout.py profile "Sergey Levine"

# 分析指定论文的引用图谱(通过 arXiv ID 或 DOI)
python tools/research/research_scout.py citations 2301.12597

# 将研究报告部署到 Hugo
python tools/research/research_scout.py deploy

Tool 3: Benchmark (Computing Power Benchmarking)

Note: Before running Benchmark, you must cd into the tools/benchmark directory!

# 进入目录
cd tools/benchmark

# 运行全部基准测试(结果自动以追加模式写入 CSV)
python -m benchmark.cli

# 仅测试 CPU
python -m benchmark.cli --cpu-only

# 仅测试 GPU
python -m benchmark.cli --gpu-only

# 运行测试并生成 Plotly 交互式 HTML 报告
python -m benchmark.cli --report

# 运行测试、生成报告并发布到 Hugo 博客的 /benchmark/ 路径
python -m benchmark.cli --report --deploy

Tool 4: Website (Hugo Blog)

# 安装博客构建及本地翻译依赖
pip install -e ".[website]"

# macOS / Linux:执行增量媒体压缩 + Hugo 构建 + 推送到 GitHub Pages
cd tools/website && bash update.sh

# Windows:执行更新与发布脚本(PowerShell,脚本会自动进入自身目录)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地启动 Hugo 预览服务器(包含草稿)
cd tools/website && hugo server -D

Tool 5: Translator (Document Translation Web Interface)

# 安装翻译器依赖(包含 Gradio 与 GGUF 依赖栈)
pip install -e ".[translator]"

# 启动 Gradio Web 界面(执行后在浏览器中打开)
python -m translator

Operations, Testing, and Data Synchronization Scripts

# 运行全仓库各工具的只读冒烟测试(检查 --help / --info / 导入,无网络和写入)
bash scripts/smoke.sh

# 跨设备 rclone 数据推送与拉取(配置位于 config.json 的 sync 部分)
python scripts/sync.py push
python scripts/sync.py pull

5. Output Artifacts and Precautions

  • Unified Output Directory: All task outputs are concentrated under outputs/, which has been added to .gitignore and supports rebuilding at any time:
    • outputs/logs/: Intermediate process logs
    • [[[HYMTPH_4697 الطيب]]: Final output reports (Markdown, JSON, HTML)
    • [[[HYMTPH_4698 الطيب]]: LLM cache and search cache
    • [[[HYMTPH_4699 الطيب]]: Structured data (CSV performance data, researcher profile JSON, etc.)
    • [[[HYMTPH_4700 الطيب]]: Generated charts and images
    • [[[HYMTPH_4701 الطيب]]: Backup files
  • Git Commit Workflow Standards:
    • Strictly forbidden to commit git add automatically generated content (contents of the outputs/ directory).
    • Strictly forbidden to commit rclone synchronized data or the build-generated build/ and gadget.egg-info/ directories.
    • Strictly forbidden to perform manual Git commits directly to the deployment repository (tools/website/public/) under tools/website/ or its theme sub-repository.
muse-spark-1.3-high — 10,692 chars · 15/16 facts

Gadget Project Interpretation and Usage Tutorial> The following content is based solely on the README.md you provided; no commands/parameters outside of the README have been fabricated. For detailed steps, the README explicitly states to refer to TUTORIAL.md, the Chinese version docs/README.zh.md, and the respective source docs of each tool.

1. Project Summary

1.1 What it is

gadget is a collection of practical tools accumulated during daily development, covering:

  • AI conversation daily report generation
  • Paper discovery
  • Performance benchmarking
  • Blog automation
  • Document translation

Design Principle: Under tools/, each directory is an independently usable tool; general capabilities are sunk into the common/ package at the repository root (installed via pip install -e .), providing LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment, etc.

Additionally: Optional Companion graph/planning tools run explicitly locally without agent hooks; ../ai-companion/ is a sibling independent repository providing DAG publishing; the Coding agent follows AGENTS.md and is not intercepted by Companion.

1.2 Repository Structure

gadget/
├── tools/              # 5个独立工具产品,改工具逻辑去这里
│   ├── summarize/      # AI对话 日报/周报/月报
│   ├── research/       # 论文发现 + 学者画像 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo博客(增量媒体压缩+自动构建发布)
│   └── translator/     # Gradio文档翻译器
├── common/             # 共享基础设施包(LLM/cache/IO/翻译/Hugo)
├── scripts/            # 运维脚本(sync.py、onboard.py、language.py等)
├── docs/               # 设计文档、ECL计划(docs/ecl/)、审计报告、历史归档
├── outputs/            # 所有生成物(gitignored,可重建)
├── AGENTS.md           # 所有AI agent工作流协议,先读
├── CLAUDE.md           # 给Claude Code的仓库指南
└── pyproject.toml      # common+各工具的打包配置(pip install -e .)

The “Where to go to change things” lookup table provided in the README:

What you want to do Where to go
Change tool logic tools/<tool>/
Change shared capabilities (LLM/cache/translation/Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time setup for a new machine scripts/onboard.py
Change dev workflow/skill ai-companion repository (sibling ../ai-companion/)
View plan/design documents docs/ecl/、docs/

Other notes:

  • build/ and gadget.egg-info/ are generated by pip install -e ., are gitignored, and are all at the repository root.
  • Data synchronization: python scripts/sync.py
  • outputs/ uniformly holds artifacts and is gitignored: intermediate products in logs/, final reports in reports/, LLM/search cache in cache/, structured data in data/, charts in images/, and forced overwrite backups in backups/.
  • Hugo site content is written directly to tools/website/content|static without passing through outputs/site.
  • tokens/ holds API keys and onboarding tables; it is gitignored and must never be committed.
  • Tool configurations are at the repository root config.json (gitignored, copied from config.example.json), and paths can be overridden using GADGET_CONFIG.

1.3 What each tool does

Directory Function Key Technologies
tools/summarize/ AI conversation Daily/Weekly/Monthly reports, multi-device two-stage architecture Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Paper discovery + Scholar profiling + Citation graphs arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
tools/benchmark/ Cross-platform CPU/GPU performance benchmarks PyTorch, NumPy, Plotly
tools/website/ Hugo blog (incremental media compression + auto build & publish) Hugo, pngquant, HandBrakeCLI
tools/translator/ Gradio document translator (based on common translation engine) Gradio, GGUF/transformers
common/ Shared package (LLM, cache, IO, translation, Hugo deployment) pip install -e .
scripts/ Operations (rclone sync for sync.py, machine configuration for onboard.py, etc.) rclone, Python
../ai-companion/ (Independent Repo) AI change tracking + planning execution skill pipeline + all skills Node.js, TypeScript

Breakdown:

1. Summarize: AI conversation Daily/Weekly/Monthly reports

Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLMs to generate structured daily, weekly, and monthly summaries. Multi-device workflow: export conversation logs from each device, aggregate them via cloud drive sync or manual copy, and then generate the final daily report; once enough daily reports are accumulated, weekly and monthly trend summaries are generated. Automatically discovers and statistics token usage and costs for various agent CLIs via ccusage 20.x source-based namespace commands (ccusage claude, ccusage codex, ccusage gemini…). There are 4 AI summary backends, switched uniformly via --api: ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (reuses Claude Code CLI login state, no key required), anthropic, and openai.

2. Research: Paper discovery and scholar analysis

A unified academic tool where a single entry point tools/research/research_scout.py provides 4 major capabilities:

  • Paper discovery: Search for papers from arXiv / bioRxiv / PubMed through a three-stage LLM pipeline (fast screening → deep evaluation → citation impact) to generate research weekly reports and deploy them to Hugo. Supports conference paper search and author search.
  • Deep paper insights (--insight): Download full texts, let the LLM analyze writing structure, publication strategies, and reusable core knowledge; automatically match OpenReview to retrieve peer reviews and analyze consensus and controversy; synthesize cross-paper writing guides.
  • Scholar profiling: Extract paper citation data from ArXiv + Semantic Scholar, let the LLM generate academic trajectory analyses, calculate tier scores, and automatically discover mentor-student relationships via homepage extraction + co-authorship patterns. Supports name disambiguation and reverse lookup.
  • Citation graph analysis: Forward citation/backward reference analysis based on Semantic Scholar API, with LLM-powered impact interpretation.

LLM functions all support switching via --api: ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (no key required), anthropic, and openai.

3. Benchmark: Performance benchmark suite

Cross-platform CPU/GPU FLOPS benchmarks, unifying measurements across different vendors and precisions. Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL may only appear in --info detection); precision coverage includes FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Measurements use warm-up + formal measurement + statistical analysis (median, IQR for outlier removal), with explicit GPU synchronization to ensure timing accuracy. Results are accumulated in CSV in append mode (never overwritten, naturally supporting multi-hardware cumulative leaderboards), and can generate Plotly interactive HTML reports and leaderboards, supporting deployment to Hugo websites and submission to public leaderboards.

4. Website: Hugo blog

Hugo static blog (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/). Includes a built-in incremental image/video compression pipeline (only compresses media changed since .last_build: images via pngquant, videos via HandBrakeCLI) and local model bilingual translation (default Ollama; vLLM under Linux / transformers under Windows as fallback; model tencent/Hy-MT2-1.8B is automatically downloaded on first run without using cloud LLM APIs). Automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly by each deployment pipeline to tools/website/content|static (the unique Hugo content root, files are marked with gadget_generated; unmarked handwritten files are never overwritten), then translated, compressed, built, and pushed. tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), where build scripts automatically commit and push; do not commit directly.

5. Translator: Gradio document translator

A Google Translate-style local translation web page based on the common translation engine, translating text and files (.md / .txt / .pdf / .docx / images) while preserving Markdown formatting (code blocks, URLs, Hugo shortcodes, etc., are protected). Runs local inference without calling cloud APIs: reuses common.engine.create_engine() to automatically select the backend (prioritizes ollama if the model tag has been pulled; transformers is the Windows fallback, vllm is prioritized on Linux, and llamacpp is the low-VRAM GGUF option); models stay in memory (warm), with on-demand lazy loading when switching models. Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded on first use, and can be overridden via GADGET_TRANSLATION_MODEL or the GUI’s model management. Source language can be set to auto (detected by text CJK ratio); when the target is auto, it flips between zh↔en.

6. common/ scripts/ ai-companion* common/:Shared layer that all tools depend on, installed as a Python package via pip install -e .: unified two-layer LLM API (4 backends: ollama default / claude_cli / anthropic / openai), JSON parsing fixes, SHA-256 disk cache (namespace + TTL), atomic writes and content hashing, local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation, cross-platform Hugo deployment.

  • scripts/:sync.py centralized rclone data synchronization (push / pull / status / bootstrap / config, covering categories like summarize / website / research / benchmark / backups; plus special dag category generation + DAG site deployment); onboard.py repository-level one-time configuration for new machines (fill one YAML table tokens/onboard.yaml, run once to automate SSH, Claude/Codex CLI installation/authentication, pip extras installation, tool configurations, and rclone bootstrap); smoke.sh all-tool read-only smoke tests (--help / --info / import, no LLM, no network, no write); serve_local_llm.sh create summarize-tuned Ollama variants and print env; other language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU profiler).
  • AI Companion: Brother ../ai-companion/ repository provides the DAG publishing tool used by scripts/sync.py --category dag; existing local idea maps, manual map commands, and skills are still available. This repository has no Companion interception hooks; onboarding does not install Companion, and install.ai_companion settings in old onboarding tables are ignored.

2. Beginner Tutorial (Use README content only)

2.1 Environment Preparation

Environment required by README:

conda activate AI

Description:

  • Python 3.10+, recommended conda environment AI.
  • Node.js 18+, only for optional Companion maps and DAG publishing tools; no need to install if not used.
  • Special dependencies for each tool can be found in the corresponding requirements.txt].
  • Website/translation functions use a local inference engine (default Ollama, using the same gemma4:26b chat model for translation; vLLM on Linux / transformers on Windows as fallback, using tencent/Hy-MT2-1.8B, automatically downloaded on first run).
  • GPU benchmark automatically detects CUDA / Apple MPS / Intel XPU.

2.2 Installation

README only provides these installation forms; copy as needed:

pip install -e .
pip install -e ".[all]"
pip install -e ".[website]"
pip install -e ".[translator]"

Note:

  • pip install -e . will generate build/ and gadget.egg-info/ in the repository root, which are gitignored; ignore them.
  • pip install -e ".[all]" includes common + summarize / research / benchmark / website extras, but does not include translator; the translator must be installed separately via pip install -e ".[translator]".
  • website translation requires torch + transformers; install it using ".[website]" above.
  • translator requires gradio + GGUF translation stack; install it using ".[translator]" above.

2.3 Configuration

  1. Copy example configuration:

README states tool configurations are in the repository root config.json (gitignored, copy from config.example.json). Paths can be overridden using GADGET_CONFIG.

  1. Data synchronization configuration is in the sync section of the repository root config.json; paths can also be overridden using GADGET_CONFIG. Cross-device sync commands (requires rclone to be configured first):
python scripts/sync.py
  1. LLM backends are unified via --api switching: ollama (default), claude_cli, anthropic, openai, or use GADGET_LLM_BACKEND globally.

  2. Translation paths use the local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama (default, local Ollama server, reusing the already served chat tag gemma4:26b) → llamacpp / vllm / transformers (in-process, model tencent/Hy-MT2-1.8B). Use GADGET_TRANSLATION_MODEL to override the translation model.

  3. Persistent tuning parameters for summarize are placed in the summarize section of the repository root config.json (paths can be overridden using GADGET_CONFIG), used in conjunction with local Ollama variants:

eval "$(bash scripts/serve_local_llm.sh env)"
  1. Onboarding for new machines has two complementary paths (README does not provide the specific call line for onboard.py, only stating to run once after filling the table; the second path provides --help):
  • This repository machine configuration: fill tokens/onboard.yaml, then run scripts/onboard.py once to automatically complete SSH, Claude/Codex authentication, pip extras, tool configurations, and rclone bootstrap.
  • Server system-level installation (One-click install for Ubuntu 22.04/24.04 including SSH public keys, Claude Code, Codex, Superpowers, Ponytail, AI Companion, which has migrated to the ai-companion repository):
bash ../ai-companion/scripts/onboard-server.sh --help

README supplement: After splitting, --companion-repo is directly passed to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), and --companion-ref is no longer required.

  1. Read-only smoke tests (no LLM, no network, no write):
bash scripts/smoke.sh
  1. Never git add the following: auto-generated content, data synced via rclone, build artifacts (build/, gadget.egg-info/), and deployment/theme repositories under tools/website/.

2.4 Typical Usage of Summarize

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy
  • First line Phase 1: Export all unexported dates.
  • Second line Phase 2: Sync all dates and merge day by day.
  • Weekly/Monthly reports with --deploy will generate + deploy; auto --deploy is a one-click full pipeline: export→merge→weekly→monthly+deploy.
  • Old entry points python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available (backward compatibility shim), but python -m summarize is recommended.
  • To switch backends, add --api to the command, choose 1 of 4: ollama, claude_cli, anthropic, or openai.

2.5 Typical Usage of Research

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy
  • report: Full pipeline search → three-stage evaluation → report.
  • ask: Natural language search (automatic source routing).
  • profile: Scholar profiling.
  • citations: Citation graph (by arXiv ID / DOI).
  • deploy: Deploy reports to Hugo.
  • To switch LLM backends, add --api: ollama, claude_cli, anthropic, or openai.

2.6 Typical Usage of Benchmark

Note the README emphasis: all commands must first cd into tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy
  • Without parameters: Run all benchmarks, append results to CSV.
  • --cpu-only runs only CPU, --gpu-only runs only GPU.
  • --report runs benchmarks + generates HTML reports; add --deploy to generate reports + deploy to Hugo /benchmark/.

2.7 Typical Usage of Website

pip install -e ".[website]"
cd tools/website && bash update.sh
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
cd tools/website && hugo server -D
  • First line: Install dependencies (including torch + transformers for translation).
  • Second line macOS/Linux: Incremental compression + Hugo build + push to Pages.
  • Third line Windows (the script will cd to its own directory automatically).
  • Fourth line local preview (dev server, including drafts).
  • Before local preview/build, auto-generated content has been written to tools/website/content|static by various deployment pipelines; do not manually commit to tools/website/public/.

2.8 Typical Usage of Translator

pip install -e ".[translator]"
python -m translator
  • First line: Install dependencies (gradio + GGUF translation stack).
  • Second line: Start Gradio GUI (open in browser). For UI wiring, see tools/translator/app.py; for translation and file logic, see tools/translator/core.py; for the shared engine, see common/engine.py and common/translation.py.

If you want to dive deeper into step-by-step operations, configuration items, data formats, or FAQs for a specific tool, the README points to: TUTORIAL.md + each tool’s own source doc (summarize see tools/summarize/tutorial.md, research see tools/research/TUTORIAL.md, benchmark see tools/benchmark/tutorial.md, website see tools/website/CLAUDE.md).

gpt-5.6-terra-high — 6,552 chars · 15/16 facts

1. Project Overview

Gadgets is a set of independently usable development tools covering:- Generation of daily, weekly, and monthly reports for AI conversation logs

  • Academic paper discovery, researcher profiling, and citation graph analysis
  • CPU/GPU performance benchmarking
  • Building, translating, media compression, and publishing of Hugo blogs
  • Local Gradio documentation translation

The repository concentrates general capabilities in the common/ package in the root directory, including LLM calls, caching, JSON parsing, atomic writes, local translation, and Hugo deployment. Each tool is located under tools/ and can be run independently.

Repository Structure

gadget/
├── tools/
│   ├── summarize/   # AI 对话日报 / 周报 / 月报
│   ├── research/    # 论文检索、研究者分析、引用图
│   ├── benchmark/   # CPU/GPU 性能测试
│   ├── website/     # Hugo 博客
│   └── translator/  # Gradio 文档翻译器
├── common/          # 所有工具共享的基础设施
├── scripts/         # 同步、初始化、检查等运维脚本
├── docs/            # 设计文档、计划、审计报告和归档
├── outputs/         # 生成产物,已被 Git 忽略,可重建
├── AGENTS.md        # AI Agent 工作流程协议
├── CLAUDE.md        # Claude Code 仓库说明
└── pyproject.toml   # Python 打包及依赖配置

What the five tools do respectively

Tool Purpose
summarize Reads conversation logs from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON; uses LLMs to generate daily, weekly, and monthly reports, and summarizes token usage and costs across various Agent CLIs.
research Searches for papers from arXiv, bioRxiv, and PubMed; generates research weekly reports; analyzes full paper texts, OpenReview reviews, researcher career trajectories, mentor-student relationships, and citation networks.
benchmark Tests cross-platform CPU/GPU floating-point performance, supporting NVIDIA CUDA, Apple MPS, and Intel XPU; records results and generates Plotly HTML reports and leaderboards.
website Hugo static blog, supporting incremental compression of images/videos, automatic translation, building, and pushing to GitHub Pages.
translator Locally running Gradio translation web page, capable of translating text, .md, .txt, .pdf, .docx, and images, while preserving formats like Markdown, code blocks, URLs, and Hugo shortcodes as much as possible.

Additionally:

  • scripts/sync.py: Cross-device data synchronization based on rclone.
  • scripts/onboard.py: One-time initialization for new machines.
  • common/: Shared LLM, cache, IO, translation, and Hugo deployment capabilities.
  • ../ai-companion/: An independent sibling repository providing optional DAG publishing and planning tools; this repository does not intercept Agent workflows.

2. First-time Use Tutorial

The following content is strictly based on the README; the README also points to TUTORIAL.md and the documentation of each tool for more detailed configuration, data formats, and FAQs.

2.1 Environment Preparation

Requirements:

  • Python 3.10+
  • Recommended Conda environment AI
  • Node.js 18+: Only required when using optional Companion graph tools or DAG publishing
  • For using websites and translation features, a local inference engine is required: Ollama by default; vLLM is available on Linux; Windows can fall back to transformers

The README recommends entering the Conda environment first:

conda activate AI

The base package shared by all tools can be installed in editable mode:

pip install -e .

To install all extra dependencies for summarize, research, benchmark, and website:

pip install -e ".[all]"

Note: all does not include the translator; the translator needs to be installed separately:

pip install -e ".[translator]"

The website tool itself also provides installation commands:

pip install -e ".[website]"

2.2 Basic Configuration

Project configuration is placed in config.json in the repository root, which is ignored by Git. The README specifies that it should be created from config.example.json; if the configuration file is located elsewhere, the default path can be overridden via the environment variable GADGET_CONFIG.

Notes:

  • tokens/ stores API Keys and new machine initialization forms; it is ignored by Git and should not be committed.
  • Generated files are located in outputs/, which also should not be committed.
  • Cross-device synchronization requires configuring rclone first.
  • LLM backends can be uniformly selected via --api:
    • ollama: Default, runs locally, no API Key required
    • claude_cli: Reuses Claude Code CLI login status, no API Key required
    • anthropic
    • openai
  • The LLM backend can also be globally specified via GADGET_LLM_BACKEND.
  • The translation engine is selected via GADGET_TRANSLATION_BACKEND, defaulting to ollama; the README also lists local backends such as llamacpp, vllm, and transformers.

3. Typical Usage for Each Tool

3.1 Summarize: AI Conversation Daily, Weekly, and Monthly Reports

Use Case: You use Claude Code, Codex, Cursor Agent, ChatGPT, etc., on multiple devices and want to centrally export conversations to generate structured work summaries.

The workflow consists of two stages:

  1. Export unexported dates from each device.
  2. Synchronize or manually copy the summarized records via cloud drives, then merge them by day and generate reports.

Export all dates that have not yet been exported:

python -m summarize daily export

Synchronize all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate a weekly report for a specific week and deploy:

python -m summarize weekly generate --week 2026-W12 --deploy

Generate a monthly report for a specific month and deploy:

python -m summarize monthly generate --month 2026-02 --deploy

Execute export, merge, weekly report, monthly report, and deployment in one click:

python -m summarize auto --deploy

The README recommends using the python -m summarize format mentioned above. Old entry points remain compatible:

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

Its LLM backend can be switched via --api, defaulting to local Ollama.


3.2 Research: Paper Discovery, Researcher Analysis, Citation Graphs

The unified entry point is:

python tools/research/research_scout.py

Full paper retrieval and reporting process: Search, three-stage evaluation, and report generation.

python tools/research/research_scout.py report --project my-project

Retrieve papers using natural language; the tool will automatically select data sources:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Generate researcher profiles:

python tools/research/research_scout.py profile "Sergey Levine"

Analyze citation graphs based on arXiv ID or DOI:

python tools/research/research_scout.py citations 2301.12597

Deploy generated reports to Hugo:

python tools/research/research_scout.py deploy

This tool involves:

  • Paper searching in arXiv, bioRxiv, and PubMed
  • Three-stage LLM filtering: rapid screening, deep evaluation, and citation impact
  • Full paper insights and OpenReview comment analysis
  • Researcher analysis based on ArXiv and Semantic Scholar
  • Forward citation and backward reference graph analysis

The README states that its LLM backend can also be switched via --api.


3.3 Benchmark: CPU/GPU Performance Testing

This tool requires entering its own directory first:

cd tools/benchmark

Run all benchmarks; results will be appended to the CSV and will not overwrite existing records:

python -m benchmark.cli

Test CPU only:

python -m benchmark.cli --cpu-only

Test GPU only:

python -m benchmark.cli --gpu-only

Run tests and generate an HTML report:

python -m benchmark.cli --report

Generate reports and publish to Hugo’s /benchmark/:

python -m benchmark.cli --report --deploy

The README states that this tool:

  • Automatically detects CUDA, Apple MPS, and Intel XPU.
  • Supports FP64, FP32, FP16, BF16, and experimental FP8.
  • Employs warmup, formal measurement, median, and IQR outlier removal, and explicitly synchronizes the GPU to ensure timing accuracy.
  • OpenCL may appear in --info detection but is not used for actual GPU testing.

3.4 Website: Hugo Blog Building and Publishing

This blog uses Hugo and the PaperMod theme. Automatically generated daily reports, research reports, benchmark pages, etc., will be written directly to:

tools/website/content
tools/website/static

Generated content carries the gadget_generated tag; handwritten files without this tag will not be automatically overwritten.

Install website dependencies:

pip install -e ".[website]"

On macOS/Linux, execute incremental media compression, Hugo build, and GitHub Pages push:

cd tools/website && bash update.sh

On Windows, execute the corresponding script:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Preview the website locally, including drafts:

cd tools/website && hugo server -D

The README states:

  • Incremental image compression uses pngquant.
  • Incremental video compression uses HandBrakeCLI.
  • Local translation defaults to Ollama; Linux can use vLLM; Windows can fall back to transformers.
  • tencent/Hy-MT2-1.8B will be automatically downloaded upon first use.
  • tools/website/public/ is an independently deployed repository, automatically committed and pushed by build scripts; content should not be committed directly to it.

3.5 Translator: Gradio Documentation Translator

Install translator dependencies:

pip install -e ".[translator]"

Start the local Gradio web page:

python -m translator

An interface will open in the browser after starting. It can translate text and the following files:

.md / .txt / .pdf / .docx / 图片

The README specifies the default model as:

tencent/Hy-MT2-1.8B

The GGUF variant is:

tencent/Hy-MT2-1.8B-GGUF

The model is automatically downloaded upon first use. You can rewrite the default model using GADGET_TRANSLATION_MODEL or manage models via the GUI.

Regarding translation direction:

  • The source language can be set to auto, identified through the CJK ratio in the text.
  • When the target language is set to auto, it will automatically switch between Chinese and English.
  • The translation process protects fragments such as Markdown code blocks, URLs, and Hugo shortcodes.

4. Operations and Auxiliary Scripts

Execute cross-device data synchronization:

python scripts/sync.py

The README states that this script supports push, pull, status, bootstrap, and config, and requires rclone to be configured. A common form of cross-device synchronization is:

python scripts/sync.py push
python scripts/sync.py pull

New machine initialization: Fill out tokens/onboard.yaml first, then run:

python scripts/onboard.py

It will handle SSH, Claude/Codex CLI installation and authentication, pip extras, tool configurations, and rclone bootstrap.

Run a read-only smoke test, which will not call LLMs, the network, or write files:

bash scripts/smoke.sh

Create an Ollama variant for summarize and output environment variables:

eval "$(bash scripts/serve_local_llm.sh env)"

Finally, do not add automatically generated content, rclone sync data, build/, gadget.egg-info/, or the deployment/theme repositories under tools/website/ to Git.

gpt-5.4-high — 14,597 chars · 16/16 facts

Project Summarygadget is a “toolbox-style” repository that collects a set of practical tools accumulated during daily development, covering 5 types of scenarios:

  • AI conversation daily/weekly/monthly report generation
  • Paper discovery and researcher analysis
  • CPU/GPU performance benchmarking
  • Hugo blog automation
  • Document translation

Its design follows “independent tools, shared core capabilities”:

  • Each subdirectory under tools/ is a standalone tool
  • The common/ in the repository root is the shared infrastructure package, installed via pip install -e ., providing unified capabilities to all tools, such as:
    • LLM calls
    • JSON parsing and repair
    • Disk caching
    • Atomic writes
    • Translation
    • Hugo deployment

Additionally, there are:

  • scripts/: Operations and maintenance scripts
  • docs/: Design documents, plans, audit reports, and historical archives
  • outputs/: All generated artifacts, which are gitignored but can be rebuilt
  • ../ai-companion/: A separate repository providing optional Companion/DAG related capabilities

Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报 / 周报 / 月报
│   ├── research/       # 论文发现 + 研究者分析 + 引文图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包
├── scripts/            # 运维和维护脚本
├── docs/               # 文档、计划、审计、归档
├── outputs/            # 生成产物
├── AGENTS.md
├── CLAUDE.md
└── pyproject.toml

What each tool does

1. tools/summarize/

Used to automatically organize your AI conversation records into daily, weekly, and monthly reports.

The README explicitly mentions that it supports reading conversation records from these sources:

  • Claude Code
  • Codex
  • Cursor Agent
  • ChatGPT
  • General JSON

The workflow is “two-stage, multi-device”:

  1. Export session logs from each device first
  2. Synchronize via cloud drives or manual copying for aggregation
  3. Generate daily reports
  4. Accumulate enough daily reports to generate weekly and monthly reports

It can also leverage ccusage 20.x to statistics token usage and costs for various agent CLIs.
The LLM backend supports unified switching:

  • ollama (default)
  • claude_cli
  • anthropic
  • openai

2. tools/research/

This is a unified academic research CLI tool, with the core entry point being tools/research/research_scout.py. It has four major capabilities:

  • Paper Discovery: Search for papers from arXiv / bioRxiv / PubMed, evaluate them through a three-stage LLM process, generate research weekly reports, and deploy them to Hugo.
  • Deep Paper Insights (--insight): Download full texts, analyze writing structures, submission strategies, and reusable knowledge, and automatically match OpenReview reviews.
  • Researcher Profiling: Perform research trajectory analysis, hierarchical scoring, and mentorship relationship discovery based on ArXiv + Semantic Scholar data.
  • Citation Graph Analysis: Perform forward citation / backward reference analysis based on the Semantic Scholar API, and use LLM to interpret impact.

The LLM backend also supports:

  • ollama (default)
  • claude_cli
  • anthropic
  • openai

3. tools/benchmark/

This is a cross-platform CPU/GPU FLOPS benchmarking tool used to unify testing of floating-point performance under different hardware and precisions.

The README states it supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

And covers these precision levels:

  • FP64
  • FP32
  • FP16
  • BF16
  • FP8 (experimental)

Features include:

  • Warm-up + formal measurement + statistical analysis
  • Explicit GPU synchronization to ensure timing accuracy
  • Results are appended to a CSV file without overwriting old results
  • Can generate interactive HTML reports and leaderboards
  • Supports deployment to Hugo sites and submission to public leaderboards

4. tools/website/

This is a Hugo static blog site, referred to in the README as “TzJ’s Net”, deployed to GitHub Pages.

It is not just a blog directory, but includes a complete automation workflow:

  • Incremental image/video compression
  • Bilingual translation
  • Build
  • Push deployment

Key features:

  • Images use pngquant
  • Videos use HandBrakeCLI
  • Translation defaults to local model inference instead of cloud LLM APIs
  • Automatically generated content is written directly to tools/website/content|static
  • tools/website/public/ is a separate deployment repository, which is automatically committed and pushed by scripts; it should not be manually committed directly.

5. tools/translator/

This is a local document translator based on Gradio, reusing the translation engine from common.

It supports translating:

  • Text
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

Features include:

  • Attempts to preserve Markdown formatting as much as possible
  • Protects code blocks, URLs, Hugo shortcodes, etc.
  • Local inference, no reliance on cloud APIs
  • Automatic backend selection:
    • ollama priority
    • transformers is the Windows fallback
    • vllm is Linux priority
    • llamacpp is suitable for low VRAM GGUF
  • The default model is tencent/Hy-MT2-1.8B
  • Source language can be set to auto
  • If the target language is set to auto, it will automatically switch between Chinese and English

What are common/, scripts/, and ../ai-companion/ respectively

common/

The shared base package for all tools, mainly providing:

  • Unified LLM calls
  • JSON parsing and repair
  • SHA-256 disk caching
  • Atomic writes and content hashing
  • Local translation engine
  • Cross-platform Hugo deployment

scripts/

A collection of repository-level scripts; the README highlights these:

  • sync.py: Centralized rclone data synchronization
  • onboard.py: One-time initialization for new machines
  • smoke.sh: Read-only smoke tests
  • serve_local_llm.sh: Create Ollama variants optimized for summarize and print environment
  • language.py: Hugo bilingual audit and report renaming
  • profile_translation.py: Translation engine GPU profiler

../ai-companion/

This is a sibling repository, not part of this repository. The README mentions it provides:

  • DAG publishing tools
  • Code change tracking
  • Planning/execution skill pipelines
  • Server-level installation scripts

Detailed Chinese Usage Tutorial

The following tutorial is based only on the README. The README repeatedly states: for more detailed step-by-step operations, data formats, and FAQs, please refer to TUTORIAL.md and the documentation of each individual tool. Therefore, you can treat the following as a “README-level quick start guide.”

I. First, understand how to use this repository

This repository is not a single application, but a collection of tools. The most common way to use it is:

  1. Prepare the Python environment first
  2. Install the shared package in the root directory and the dependencies for the tools you want to use
  3. Configure the repository root config.json
  4. Enter only the tool you need and use its corresponding commands
  5. Generated results are uniformly written to outputs/ or connected to tools/website/

The principles given in the README are very clear:

  • Each tools/<tool>/ is an independent tool
  • Shared capabilities are placed in common/
  • Tool configurations are in the repository root config.json
  • Sensitive information is placed in tokens/ and must not be committed
  • All generated results are placed in outputs/

II. Environment Preparation

1. Basic Requirements

The environment requirements mentioned in the README are:

  • Python 3.10+
  • Recommended to use conda environment AI
  • Node.js 18+, but only required for optional Companion graph/DAG tools
  • Specific dependencies for each tool can be found in the corresponding directory’s requirements.txt

The only environment activation example provided in the README is:

conda activate AI

If you want to install the common package and summarize / research / benchmark / website-related dependencies all at once, the command provided in the README is:

pip install -e ".[all]"

Note the special instruction in the README:

  • all does not include translator
  • translator needs to be installed separately

Therefore, if you also want to use the translator, you must additionally execute:

pip install -e ".[translator]"

If you only intend to use website-related functions, the separate installation command provided in the README is:

pip install -e ".[website]"

3. Notes on Local Inference

The README mentions that both the website translation feature and the translator rely on a local inference engine, defaulting to Ollama.
It also mentions:

  • Website/translation features use local inference by default
  • Priority to vLLM on Linux
  • Fallback to transformers on Windows
  • Relevant models may be automatically downloaded during the first run

This means that when running relevant tools for the first time, local model downloading or loading may occur.


III. Installation and Repository Initialization

1. Install the root directory shared package

The README explicitly states that common/ is installed as a Python package using the following method:

pip install -e .

However, the README also provides the more common “with extras” installation method, so you should typically choose based on your needs:

  • General installation:
pip install -e ".[all]"
  • Translator only:
pip install -e ".[translator]"
  • Website only:
pip install -e ".[website]"

2. New Machine Initialization

If you are configuring this repository for the first time on a new machine, the process provided in the README is:

  1. Fill in tokens/onboard.yaml
  2. Run:
python scripts/onboard.py

The README explains that it will automatically complete:

  • SSH configuration
  • Claude/Codex CLI installation and authentication
  • pip extras installation
  • Configuration for each tool
  • rclone bootstrap

If you need a server-level system installation, the README says relevant scripts have been migrated to the sibling repository ../ai-companion/. For help, use:

bash ../ai-companion/scripts/onboard-server.sh --help

IV. How to prepare configuration files

The README’s instructions regarding configuration mainly include:

1. Main Configuration File Location

Tool settings are located in the repository root:

  • config.json

And the README states:

  • This is gitignored
  • It should be copied from config.example.json
  • The path can be overridden via GADGET_CONFIGHere, the README only states “copy from config.example.json”, but does not provide the specific copy command, so no command is added here to avoid exceeding the scope of the README.

2. Sensitive Information Locations

The README explicitly states:

  • tokens/ is used to save API keys and onboarding tables
  • tokens/ is gitignored
  • Never commit its contents

3. LLM Backend Configuration

The README explains that all LLM features uniformly support selecting a backend via --api:

  • ollama (default)
  • claude_cli
  • anthropic
  • openai

Additionally, it can be controlled via global environment variables:

  • GADGET_LLM_BACKEND

4. Translation Backend Configuration

The README explains that the translation pipeline can select a backend through:

  • GADGET_TRANSLATION_BACKEND

The candidates are:

  • ollama (default)
  • llamacpp
  • vllm
  • transformers

The translation model can be overridden via:

  • GADGET_TRANSLATION_MODEL

to override the default model.

5. Data Synchronization Configuration

The README explains that cross-device synchronization uses:

python scripts/sync.py

and points out that its configuration comes from:

  • the sync section of the root directory config.json

V. Perform a Health Check First

The README provides a read-only smoke script to check:

  • --help
  • --info
  • imports

And explicitly states:

  • No LLM calls
  • No internet connection
  • No writing

You can run:

bash scripts/smoke.sh

If this is your first time encountering this repository, this is a great starting point.


VI. Typical Usage of Each Tool

The following introduces tools one by one, using only the commands that appear in the README.


VII. summarize Usage Tutorial

What this tool does

It is used to organize AI session records from multiple sources into structured daily, weekly, and monthly reports, and supports multi-device data aggregation.

Supported Backends

The README explains that you can switch via --api:

  • ollama
  • claude_cli
  • anthropic
  • openai

Typical Workflow

1. Export all unexported dates

python -m summarize daily export

The README notes this is:

  • Phase 1: export all unexported dates

2. Sync all dates and merge day by day

python -m summarize daily merge --sync-all

The README notes this is:

  • Phase 2: sync all dates and merge day by day

3. Generate weekly report and deploy

python -m summarize weekly generate --week 2026-W12 --deploy

4. Generate monthly report and deploy

python -m summarize monthly generate --month 2026-02 --deploy

5. Run the full process in one click

python -m summarize auto --deploy

The README describes it as:

  • export → merge → weekly → monthly + deploy

Old Entry Points

The README also mentions that old entry points are still available, but recommends using the new python -m summarize format. The old entry points are:

  • python tools/summarize/daily_summary.py ...
  • python tools/summarize/weekly_summary.py ...
  • python tools/summarize/monthly_summary.py ...

Since the README does not provide complete example commands for these old entry points, it is recommended to use the new module method for the first time.

For further details

The README points to:

  • The Summarize section in TUTORIAL.md
  • tools/summarize/tutorial.md

VIII. research Usage Tutorial

What this tool does

It is a unified academic research CLI, with the entry point:

  • tools/research/research_scout.py

It can perform paper discovery, researcher profiling, citation analysis, and deeper paper insights.

Typical Commands

1. Generate a complete research report for a specific project

python tools/research/research_scout.py report --project my-project

The README explains this will execute the full process:

  • search → three-stage evaluation → report

2. Natural language search for papers

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

The README explains this is:

  • Natural-language search (auto-routes source)

3. Generate researcher profiles

python tools/research/research_scout.py profile "Sergey Levine"

4. Perform citation graph analysis

python tools/research/research_scout.py citations 2301.12597

The README states the following parameters are available:

  • arXiv ID
  • DOI

5. Deploy reports to Hugo

python tools/research/research_scout.py deploy

LLM Backend

The LLM functionality of this tool also supports switching via --api:

  • ollama
  • claude_cli
  • anthropic
  • openai

For further details

The README points to:

  • The Research section in TUTORIAL.md
  • tools/research/TUTORIAL.md

IX. benchmark Usage Tutorial

What this tool does

It is used for cross-platform CPU/GPU FLOPS testing and can generate HTML reports and leaderboards.

Note Before Use

The README specifically notes:

  • All commands require first cd to tools/benchmark/

So execute this first:

cd tools/benchmark

Typical Commands

1. Run all benchmarks

python -m benchmark.cli

The README explains:

  • Results will be appended to the CSV
  • Old data will not be overwritten

2. Test CPU only

python -m benchmark.cli --cpu-only

3. Test GPU only

python -m benchmark.cli --gpu-only

4. Run benchmarks and generate HTML reports

python -m benchmark.cli --report

5. Generate reports and publish to Hugo’s /benchmark/

python -m benchmark.cli --report --deploy

For further details

The README points to:

  • The Benchmark section in TUTORIAL.md
  • tools/benchmark/tutorial.md

X. website Usage Tutorial

What this tool does

It is the Hugo blog site itself and is responsible for:

  • Incremental media compression
  • Translation
  • Building
  • Publishing

Install Website Dependencies

The command provided by the README is:

pip install -e ".[website]"

The README explains this will include website-related dependencies, including:

  • torch
  • transformers

Typical Commands

1. macOS/Linux: Update, compress, build, and push Pages

cd tools/website && bash update.sh

The README explains this will perform:

  • incremental compress
  • Hugo build
  • push Pages

2. Windows: Run PowerShell update script

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

The README explains that this script will automatically switch to its own directory.

3. Preview Hugo site locally

cd tools/website && hugo server -D

The README explains:

  • This is a local dev server
  • It includes drafts

Important Website Rules in the README

  • Automatically generated content is written to tools/website/content|static
  • These automatically generated files will carry the gadget_generated tag
  • Handwritten files without this tag will not be overwritten
  • tools/website/public/ is a separately deployed repository
  • It will be automatically committed and pushed by the build script
  • Do not commit directly to this directory

For further details

The README points to:

  • The Website section in TUTORIAL.md
  • tools/website/CLAUDE.md

XI. translator Usage Tutorial

What this tool does

It is a Gradio-based local document translator, suitable for translating text or files into another language while attempting to keep the Markdown structure intact.

Install Dependencies

The command provided by the README is:

pip install -e ".[translator]"

The README explains that the following will be installed:

  • Gradio
  • GGUF translation stack

How to Start

python -m translator

The README explains it will:

  • Start the Gradio GUI
  • Open in the browser

Supported Content

The scope of support listed in the README:

  • Text
  • .md
  • .txt
  • .pdf
  • .docx
  • Images

Models and Backends

The README explains:

  • Default model: tencent/Hy-MT2-1.8B
  • GGUF variants: tencent/Hy-MT2-1.8B-GGUF
  • Automatically downloaded upon first use
  • Can be overridden via GADGET_TRANSLATION_MODEL
  • Model management can also be done within the GUI

The automatic backend selection logic is written in the README as:

  • ollama auto priority
  • Windows fallback: transformers
  • Linux priority: vllm
  • Low VRAM GGUF: llamacpp

Automatic Language Detection

The README explains:

  • Source language can be set to auto
  • It will automatically judge based on the text’s CJK ratio
  • If the target language is set to auto, it will automatically flip between zh ↔ en

For further details

The README points to:

  • The Translator section in TUTORIAL.md

It also provides the code entry point locations for further investigation:

  • tools/translator/app.py
  • tools/translator/core.py
  • common/engine.py
  • common/translation.py

XII. How to use the Operations Scripts

These scripts are not among the five main tools, but the README explicitly lists them as important components of the repository.

1. Data Synchronization: scripts/sync.py

The README says it is used for centralized rclone data synchronization and can be used for:

  • push
  • pull
  • status
  • bootstrap
  • config

The entry point for running is:

python scripts/sync.py

The README also explains:- Covers categories such as summarize / website / research / benchmark / backups, etc.

  • Also includes the special dag category
  • The sync section configured in the root directory config.json
  • Configuration path can be overridden via GADGET_CONFIG

2. New Machine Initialization: scripts/onboard.py

After filling in tokens/onboard.yaml, execute:

python scripts/onboard.py

The README says it will automatically handle:

  • SSH
  • Claude/Codex login
  • pip extras
  • per-tool config
  • rclone bootstrap

3. Read-only smoke check: scripts/smoke.sh

bash scripts/smoke.sh

The README explains this is:

  • A read-only smoke net
  • Will test --help / --info / imports
  • Does not involve LLM, network, or writing

4. Local LLM Service Helper Script: scripts/serve_local_llm.sh

The command provided in the README is:

eval "$(bash scripts/serve_local_llm.sh env)"

The README describes it as:

  • Creates an Ollama variant optimized for summarize
  • Prints environment variables
  • Persistent configuration items are placed in the summarize section of the root directory config.json
  • Configuration path can be overridden via GADGET_CONFIG

5. Other Scripts

The README also mentions:

  • language.py: Hugo bilingual audit + summarize report renaming
  • profile_translation.py: Translation engine GPU profiler

The README does not provide specific command examples for these two scripts, so only their purposes are explained here without adding commands.


XIII. How to view the output directory

The README explains that all generated results are concentrated in outputs/:

outputs/
├── logs/         # 中间产物
├── reports/      # 最终报告
├── cache/        # LLM cache / search cache
├── data/         # 结构化数据
├── images/       # 图表和生成图片
└── backups/      # 备份

Special note:

  • Hugo site content is NOT written to outputs/site
  • Instead, it is written directly to tools/website/content|static

If this is your first time encountering this project, the safest onboarding sequence according to the README is:

  1. Activate Python environment
conda activate AI
  1. Install common dependencies
pip install -e ".[all]"
  1. If you also need to use the translator, install:
pip install -e ".[translator]"
  1. Prepare the root directory config.json and fill in the contents under tokens/ as needed
  2. Run a read-only check once:
bash scripts/smoke.sh
  1. Enter a specific tool based on your goal:
  • For AI daily reports: summarize
  • For paper research: research
  • For performance testing: benchmark
  • For blog maintenance: website
  • For document translation: translator

XV. Special precautions emphasized in the README

  • tokens/ stores API keys and onboarding forms, do not commit
  • outputs/ is the generation directory, which is gitignored
  • For cross-device synchronization, use:
python scripts/sync.py
  • Do not git add these contents:
    • Automatically generated content
    • rclone sync data
    • build/
    • gadget.egg-info/
    • Deployment/theme repositories under tools/website/
  • tools/website/public/ is a separate deployment repository; do not commit directly by hand
  • The license is GPL-3

XVI. Shortest command list

If you only want to copy the core commands from the README, this set is the most critical.

Environment and Installation:

conda activate AI
pip install -e ".[all]"
pip install -e ".[translator]"
pip install -e ".[website]"
pip install -e .

Repository-level scripts:

python scripts/sync.py
python scripts/onboard.py
bash scripts/smoke.sh
eval "$(bash scripts/serve_local_llm.sh env)"
bash ../ai-companion/scripts/onboard-server.sh --help

summarize:

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy

research:

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy

benchmark:

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy

website:

cd tools/website && bash update.sh
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
cd tools/website && hugo server -D

translator:

pip install -e ".[translator]"
python -m translator

If you wish, in my next step I can continue to organize this README content into a format more like a “Chinese Official Manual,” for example, by dividing it into four parts: “5-Minute Quick Start / Onboarding by Scenario / Common Configuration Items / Common Pitfalls.”

gemini-3.6-flash-high — 5,930 chars · 16/16 facts

Below is the project summary and detailed usage tutorial organized based on the original README:


Part I: Open Source Project Gadgets Summary

1. Project Introduction

Gadgets is a collection of practical tools accumulated during daily development, licensed under GPL-3. The project covers the following 5 core domains:

  • AI Conversation Daily/Weekly/Monthly Report Generation (Summarize)
  • Paper Retrieval and Researcher Analysis (Research)
  • CPU/GPU Performance Benchmarking (Benchmark)
  • Hugo Blog Automation and Media Incremental Compression (Website)
  • Gradio Document and File Translator (Translator)

Each tool under the tools/ directory can be used independently; the common/ package in the root directory provides unified shared basic capabilities (including LLM calls, JSON parsing fixes, disk caching, atomic writes, translation engines, and Hugo deployment, etc.), installed via pip install -e .. All generated intermediate and final products are uniformly saved in the outputs/ directory.

2. Repository Structure

gadget/
├── tools/              # 5 个独立的工具产品(修改具体工具逻辑去这里)
│   ├── summarize/      # AI 对话日/周/月报生成
│   ├── research/       # 论文检索 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 跨平台性能基准测试
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动化构建与发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础架构包(LLM / 缓存 / IO / 翻译 / Hugo 部署)— 被所有工具依赖
├── scripts/            # 运维与维护脚本(sync.py, onboard.py, language.py, profile_translation.py 等)
├── docs/               # 设计文档、ECL 计划 (docs/ecl/)、审计报告与历史归档 (docs/archive/)
├── outputs/            # 所有生成的产物目录(已 gitignore,可自动重建)
│   ├── logs/           # 中间日志(导出日志、运行日志)
│   ├── reports/        # 最终报告(Markdown, JSON, HTML)
│   ├── cache/          # LLM 缓存、搜索缓存
│   ├── data/           # 结构化数据(CSV, JSON profiles)
│   ├── images/         # 图表与生成的图片
│   └── backups/        # 强制覆盖备份(website-force 等)
├── AGENTS.md           # 所有 AI agent 的工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ 及各工具的打包配置 (pip install -e .)

3. Introduction to Tool Functions

  • Summarize (AI Conversation Report Generation): Automatically reads daily AI conversation logs (supporting Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM APIs to generate structured daily, weekly, and monthly reports. It uses a multi-device two-stage architecture (Device Export → Cloud Drive Sync/Manual Merge → Daily Merge Export → Generate Weekly/Monthly Reports). Integrates ccusage 20.x to automatically count Agent CLI Token usage and costs. Supports switching between 4 backends (ollama default, claude_cli, anthropic, openai).
  • Research (Paper Retrieval and Researcher Analysis): Provides four major capabilities through the unified CLI entry tools/research/research_scout.py:
    1. Paper Retrieval: Performs three-stage LLM screening, evaluation, and impact analysis via arXiv / bioRxiv / PubMed, generating research weekly reports and deploying them to Hugo;
    2. Deep Paper Insights (--insight): Downloads full texts to analyze structure and publication strategies, automatically matching OpenReview reviewer comments;
    3. Researcher Profiling: Combines arXiv + Semantic Scholar to analyze research trajectories, calculate tier scores, and extract mentor-student relationships;
    4. Citation Graph Analysis: Analyzes forward and backward citations and interprets LLM impact based on the Semantic Scholar API.
  • Benchmark (Performance Benchmarking): A cross-platform CPU/GPU FLOPS floating-point performance testing tool. Actual GPU execution supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU), covering FP64 / FP32 / FP16 / BF16 / FP8 (experimental) precisions. It employs warm-up, formal measurement, median/IQR outlier removal, and explicit GPU synchronization. Results are appended to CSV files (supporting multi-hardware accumulation), and it can generate Plotly interactive HTML reports and leaderboards.
  • Website (Hugo Blog): A blog based on Hugo (PaperMod theme) (“TzJ’s Net”), deployed to GitHub Pages. It features built-in incremental media compression (pngquant for images, HandBrakeCLI for videos) and local model bilingual translation (defaulting to Ollama; Linux uses vLLM / Windows uses transformers, automatically downloading tencent/Hy-MT2-1.8B). Generated content is written directly to tools/website/content|static (handwritten files marked with gadget_generated will not be overwritten).
  • Translator (Gradio Document Translator): A local Google Translate-like web interface built on the common translation engine. Supports text and file translation (.md / .txt / .pdf / .docx / images) while maintaining Markdown formatting (protecting code blocks, URLs, and Hugo shortcodes). It performs pure local inference with automatic model selection (prioritizing ollama, choosing transformers for Windows, vllm for Linux, and llamacpp for low VRAM), with the default model being tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF). It automatically switches between Chinese and English (zh↔en) based on CJK ratio detection.

Part II: Detailed Usage Tutorial

1. Environment Preparation and Configuration

  • Python Version: Requires Python 3.10+ (recommended to use the conda environment AI, i.e., conda activate AI).
  • Node.js Version: Node.js 18+ (only required when using optional Companion graphs and DAG publishing tools).
  • Configuration Files and Keys:
    • API Keys and machine initialization forms are stored in the tokens/ directory (gitignored).
    • Project configuration is stored in the root directory config.json (can be copied from config.example.json), and the configuration file path can be specified using the environment variable GADGET_CONFIG.
  • LLM and Translation Backend Settings:
    • LLM backends can be specified via the command line --api parameter or the environment variable GADGET_LLM_BACKEND: ollama (default), claude_cli, anthropic, openai.
    • Translation backends are specified by the environment variable GADGET_TRANSLATION_BACKEND: ollama (default) / llamacpp / vllm / transformers.

2. Installation

(1) Installing Base Infrastructure and Regular Tool Dependencies```bash

pip install -e “.[all]”

*Note: `.[all]` does not include the dependencies for the Translator `translator`.*

##### (2) Install Translator dependencies
```bash
pip install -e ".[translator]"
(3) Install Website and its translation dependencies
pip install -e ".[website]"

3. O&M and Initialization Commands

One-click Onboarding for New Machines

Execute after filling in tokens/onboard.yaml:

python scripts/onboard.py
Full Tool Smoke Test (Read-only check of --help and dependency imports)
bash scripts/smoke.sh
Cross-device Data Synchronization (Depends on rclone)
python scripts/sync.py
Start local Ollama fine-tuning variant and set environment variables
eval "$(bash scripts/serve_local_llm.sh env)"
Server-level system installation script (located in the sibling ai-companion repository)
bash ../ai-companion/scripts/onboard-server.sh --help

4. Typical Usage and Commands for Each Tool

(1) Summarize — AI Daily/Weekly/Monthly Report

# 阶段 1:导出所有未导出的日期
python -m summarize daily export

# 阶段 2:同步所有日期并按天合并
python -m summarize daily merge --sync-all

# 生成指定周的周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成指定月的月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 一键全流程:导出 → 合并 → 周报 → 月报 + 部署
python -m summarize auto --deploy

(2) Research — Paper Retrieval and Researcher Analysis

# 执行完整研究周报流水线(检索 → 三阶段评估 → 生成报告)
python tools/research/research_scout.py report --project my-project

# 自然语言检索论文(自动路由数据源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 生成研究者画像与师生网络分析
python tools/research/research_scout.py profile "Sergey Levine"

# 基于 arXiv ID 或 DOI 查询引用图谱
python tools/research/research_scout.py citations 2301.12597

# 将生成的报告部署至 Hugo 站点
python tools/research/research_scout.py deploy

(3) Benchmark — Performance Benchmarking

Note: You must enter the tools/benchmark directory before running Benchmark commands.

cd tools/benchmark

# 运行所有基准测试(结果自动追加至 CSV)
python -m benchmark.cli

# 仅进行 CPU 测试
python -m benchmark.cli --cpu-only

# 仅进行 GPU 测试
python -m benchmark.cli --gpu-only

# 运行测试并生成 HTML 交互式报告
python -m benchmark.cli --report

# 运行测试、生成报告并发布至 Hugo 的 /benchmark/ 路径
python -m benchmark.cli --report --deploy

(4) Website — Hugo Blog Building and Publishing

# macOS / Linux: 增量压缩媒体 + Hugo 构建 + 推送至 Pages
cd tools/website && bash update.sh

# Windows: 运行 PowerShell 更新脚本
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览(启动开发服务器,包含草稿)
cd tools/website && hugo server -D

(5) Translator — Gradio Document Translator

# 安装翻译器依赖
pip install -e ".[translator]"

# 启动 Gradio GUI 界面(启动后在浏览器中打开)
python -m translator
gemini-3.1-pro — 4,422 chars · 13/16 facts

This is a Chinese summary and detailed usage tutorial based on the provided README content.


Part 1: Project Summary

1. Project Introduction (What is it)

Gadgets is a collection of practical tools accumulated during daily development. It mainly covers five functional areas: AI daily conversation report generation, academic paper discovery and analysis, cross-platform hardware performance benchmarking, automated blog deployment, and document translation. The project adopts a “modular” design: all tools can be used independently, while their shared core capabilities (such as LLM invocation, disk caching, translation engines, etc.) are unified and extracted into a common package (common).

2. Repository Structure (Repository Structure)

The directory structure of the entire repository clearly divides tools, common components, scripts, and output directories:

  • tools/: Core directory, containing 5 independent tool products.
  • common/: Shared infrastructure package (handling LLM, cache, file IO, translation, Hugo deployment, etc.), which all tools depend on.
  • scripts/: O&M and management scripts directory, containing scripts such as data synchronization (sync.py) and new machine onboarding (onboard.py).
  • docs/: Documentation directory, containing design documents, plans, audit reports, and historical archives.
  • outputs/: All products automatically generated by all tools (such as logs, reports, cache, data, charts, etc.) are output here (configured with gitignore).
  • Others: AGENTS.md (AI Agent workflow protocol), CLAUDE.md (Claude Code repository guide), pyproject.toml (packaging configuration files).

3. What Each Tool Does (Tools at a Glance)

In the tools/ directory, the five tools are responsible for the following functions:

  1. summarize (AI Report Summarization): Automatically reads your AI conversation records across various devices (such as Claude, ChatGPT, etc.), calculates Token consumption and costs, and generates structured daily, weekly, and monthly summary reports via LLMs.
  2. research (Paper Discovery and Researcher Analysis): An academic research toolkit. It supports retrieving papers from major preprint and literature databases and performing three-stage deep LLM evaluations; it can also analyze researchers’ academic trajectories, generate relationship graphs, and perform paper citation graph analysis.
  3. benchmark (Performance Benchmarking): A cross-platform CPU/GPU FLOPS performance testing tool. It supports unified measurement of performance across different hardware vendors (NVIDIA, Apple, Intel) and different precisions, generating HTML reports with charts and leaderboards.
  4. website (Hugo Blog Automated Deployment): Used for building and publishing Hugo static blogs. It features a built-in incremental media compression pipeline (only compressing changed images and videos), supports bilingual translation using local models, and can automatically build and push generated reports and articles to GitHub Pages.
  5. translator (Gradio Document Translator): A Gradio-based local document translation web interface. It supports the translation of text as well as .md, .txt, .pdf, and .docx files, perfectly preserving Markdown formatting during the translation process. It uses entirely local model inference without requiring cloud APIs.

Part 2: Detailed Beginner’s Tutorial

For users encountering this project for the first time, please follow these steps for environment preparation, installation, configuration, and usage.

I. Environment Preparation

  1. Python Environment: Requires Python 3.10 or higher (it is recommended to use Conda to create an independent environment, such as conda activate AI).
  2. Node.js (Optional): Node.js 18+ (only required if you need to use the optional Companion graph and DAG publishing features).

II. Installation and Configuration

1. Dependency Installation Run the following commands in the repository root to install the base package and most tools (summarize, research, benchmark, website):

pip install -e ".[all]"

Note: [all] does not include translator. If you need to use the translation tool, you must execute extra steps:

pip install -e ".[translator]"

2. Configuration File Initialization

  • General Configuration: The project’s runtime configuration is located in config.json in the repository root. You need to copy the example file config.example.json to config.json (this file will be ignored by Git). You can also specify other paths by setting the GADGET_CONFIG environment variable.
  • One-click Onboarding for New Machines (Optional): If you are configuring on a new server, you can fill in information in tokens/onboard.yaml and then run the following script to automatically complete SSH, CLI authentication, dependency installation, and other configurations:
    python scripts/onboard.py
    

III. Typical Usage of Each Tool

The following are the most commonly used, ready-to-copy running commands for each tool.

1. Summarize (AI Report Generation)

Supports automatic collection of your AI chat records and generating summaries. The LLM backend defaults to the local ollama, but can be switched to claude_cli, anthropic, or openai via the --api parameter.

# 步骤 1:导出所有未导出的历史日期数据
python -m summarize daily export

# 步骤 2:同步并按天合并每日数据
python -m summarize daily merge --sync-all

# 步骤 3:生成指定周的周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 步骤 4:生成指定月的月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

# 🌟 懒人一键命令:全流程自动执行(导出 → 合并 → 周报 → 月报 → 部署)
python -m summarize auto --deploy
2. Research (Scientific Research and Paper Analysis)

Called uniformly through the research_scout.py entry point, which also supports switching different LLM backends via the --api parameter.

# 全流程:搜索论文 → 三阶段评估 → 生成报告
python tools/research/research_scout.py report --project my-project

# 自然语言快速搜索(自动路由来源)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 生成指定研究人员的分析画像(学术轨迹、关系网等)
python tools/research/research_scout.py profile "Sergey Levine"

# 根据 arXiv ID 或 DOI 生成引用图谱
python tools/research/research_scout.py citations 2301.12597

# 将生成的报告部署到 Hugo 博客
python tools/research/research_scout.py deploy
3. Benchmark (Performance Testing)

Used to test CPU/GPU floating-point operation performance. Note: You must enter the benchmark directory before executing these commands.

cd tools/benchmark

# 运行所有基准测试(结果会自动追加到 CSV 文件中)
python -m benchmark.cli

# 仅测试 CPU
python -m benchmark.cli --cpu-only

# 仅测试 GPU
python -m benchmark.cli --gpu-only

# 运行测试并生成包含图表的 HTML 报告
python -m benchmark.cli --report

# 生成报告并将其发布到 Hugo 博客的 /benchmark/ 路径下
python -m benchmark.cli --report --deploy
4. Website (Hugo Blog)

Used for automated building of static blogs. It includes built-in scripts for incremental compression and automatic pushing to GitHub Pages.

# 确保你已安装对应的 website 依赖包
pip install -e ".[website]"

# 【macOS / Linux 系统】执行增量压缩、Hugo 构建并推送
cd tools/website && bash update.sh

# 【Windows 系统】执行增量压缩、构建并推送
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# 本地预览你的博客网站(包含草稿)
cd tools/website && hugo server -D

Tip: All automatically generated content will be written directly to tools/website/content|static. The built public website is deployed in a separate tools/website/public/ repository; the script will automatically commit and push, so please do not manually commit code to the public directory.

5. Translator (Document Translator)

Starts a web-based UI that supports document translation, capable of safely protecting code blocks and formatting when translating long Markdown files and other documents.

# 确保已安装翻译组件所需依赖
pip install -e ".[translator]"

# 启动 Gradio 网页界面(会自动在浏览器中打开)
python -m translator

Tip: This tool will automatically download the default translation model tencent/Hy-MT2-1.8B upon its first run. The translation engine runs entirely locally. You can switch models via the UI or by setting the GADGET_TRANSLATION_MODEL environment variable.

gpt-5.4-mini-high — 6,677 chars · 15/16 facts

I will first organize the information in the README into two parts: a project overview and repository structure, followed by a ready-to-use Chinese tutorial organized by tool, using only the content and commands explicitly stated in the README. The following is organized solely based on your provided README.md, without adding any commands or parameters not mentioned in the README.

1. Project Summary

Gadgets is a “set of practical tools accumulated through daily development,” with core features:

  • Each directory under tools/ is an independent tool that can be used separately.
  • common/ provides all shared core capabilities for the tools, such as:
    • LLM invocation
    • JSON parsing
    • Disk caching
    • Atomic writing
    • Translation
    • Hugo deployment
  • scripts/ contains O&M and maintenance scripts.
  • outputs/ stores all generated results; it is reconstructible and ignored by Git.
  • There is also an optional adjacent repository ../ai-companion/ used for capabilities like DAG publishing.

In short: This is a tool repository built around five types of tasks: AI reports, paper research, performance benchmarking, blog automation, and document translation.

Repository Structure

The structure provided in the README can be understood as follows:- tools/summarize/:AI Conversation Daily / Weekly / Monthly Reports

  • tools/research/:Paper Discovery + Researcher Analysis + Citation Graphs
  • tools/benchmark/:CPU / GPU Performance Benchmarking
  • tools/website/:Hugo blog site, with automatic compression, build, and publish
  • tools/translator/:Gradio Document Translator
  • common/:Shared Base Library
  • scripts/:Maintenance scripts for sync, onboarding configuration, smoke tests, etc.
  • docs/:Design docs, ECL plans, audit reports, historical archives
  • outputs/:All generated artifacts
  • AGENTS.md / CLAUDE.md:Workflow and repository guides
  • pyproject.toml:Packaging configuration

What each tool does

summarize

Automatically reads your daily AI conversation logs to generate structured daily, weekly, and monthly reports. It supports multi-device workflows: first export conversation logs from various devices, then sync and merge them to generate the final report. The README also explains that it can automatically calculate tokens and costs for various Agent CLI via ccusage 20.x.

There are four supported backends, switchable via --api:

  • ollama, default
  • claude_cli
  • anthropic
  • openai

research

This is a unified academic research tool, with the entry point being tools/research/research_scout.py. It mainly includes four types of capabilities:

  • Paper Discovery: Search for papers from arXiv / bioRxiv / PubMed and generate research weekly reports, which can also be deployed to Hugo.
  • Deep Paper Insights: Download full texts, let LLM analyze paper writing structures, publication strategies, and reusable knowledge, and combine with OpenReview to analyze review comments.
  • Researcher Profiling: Analyze research trajectories, hierarchical scoring, mentor-student relationships, etc., based on ArXiv + Semantic Scholar.
  • Citation Graph Analysis: Perform forward citation and backward reference analysis, interpreted by LLM for impact.

It also supports switching LLM backends via --api.

benchmark

This is a cross-platform CPU/GPU floating-point performance testing tool that measures FLOPS performance on different hardware. The README states it supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

It performs warm-up, formal measurement, and statistical analysis, appends results to a CSV, and can generate HTML reports and leaderboards.

website

This is a Hugo blog site named TzJ’s Net, using the PaperMod theme. Its focus is on:

  • Incremental image / video compression
  • Automatic build and publish
  • Automatic content translation
  • Writing generated content directly to tools/website/content|static
  • tools/website/public/ is a separate deployment repository for automatic commit + push

translator

This is a Gradio document translator based on the common translation engine, functioning like a local version of a Google Translate-style webpage:

  • Supports text and file translation
  • Supports .md / .txt / .pdf / .docx / images
  • Preserves Markdown structure, such as code blocks, URLs, and Hugo shortcodes
  • Uses local inference by default, without calling cloud APIs
  • Default model is tencent/Hy-MT2-1.8B or its GGUF variants

2. Detailed Chinese Usage Tutorial

Step 1: Prepare the Environment

The minimum environment requirements provided in the README are:

  • Python 3.10+
  • conda activate AI is recommended
  • Node.js 18+ only for optional Companion graphs and DAG publishing capabilities

If you want to use all the tools mentioned in the repository, there are several dependency installation methods provided in the README:

pip install -e .
pip install -e ".[all]"
pip install -e ".[translator]"
pip install -e ".[website]"

The README instructions are:

  • pip install -e .: Install the shared package at the repository root
  • pip install -e ".[all]": Install common package + extra dependencies like summarize / research / benchmark / website
  • pip install -e ".[translator]": Install translator dependencies separately
  • pip install -e ".[website]": Install website-related dependencies, including torch and transformers required for translation

If this is your first time encountering this project, the README also suggests running a read-only self-check first:

bash scripts/smoke.sh

It will perform --help / --info / import checks; it will not use LLM, will not connect to the internet, and will not write files.

Step 2: Configure the Project

The main configuration points explicitly mentioned in the README are:

1. config.json

Tool settings are located in config.json at the repository root, which is gitignored. The README suggests:

  • Copy a version from config.example.json as a starting point
  • If you need to change the configuration file location, you can use GADGET_CONFIG

2. tokens/

This directory stores API keys and onboarding forms; do not commit this to Git.

3. LLM Backend Switching

The README explains that all LLM-related functions can be switched uniformly through these backends:

  • ollama, default
  • claude_cli
  • anthropic
  • openai

The corresponding global environment variable is GADGET_LLM_BACKEND.

4. Translation Backend Switching

The README explains that the translation path also has unified local inference backend choices; the environment variable is GADGET_TRANSLATION_BACKEND, with options including:

  • ollama
  • llamacpp
  • vllm
  • transformers

The translation model can also be overridden using GADGET_TRANSLATION_MODEL.

5. First-time Machine Configuration

If you are using this repository on a new machine, the README recommends using:

python scripts/onboard.py

It requires filling out tokens/onboard.yaml first, then it will automatically complete:

  • SSH configuration
  • Claude / Codex CLI installation and authentication
  • pip extras installation
  • Configuration for each tool
  • rclone bootstrap

Step 3: Usage by Tool

Below are the most commonly used commands categorized by tool.

1) Typical usage of summarize

The new entry point recommended by the README is python -m summarize.

python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy

These correspond to:

  • daily export: Export all dates that haven’t been exported yet
  • daily merge --sync-all: Sync all dates and merge them by day
  • weekly generate: Generate weekly reports and deploy
  • monthly generate: Generate monthly reports and deploy
  • auto --deploy: One-click execution of export, merge, weekly report, monthly report, and deployment

The README also states that the old entry point is still available, but the new form python -m summarize is recommended.

2) Typical usage of research

The entry point for the research tool is:

python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy

Representing:

  • report: Search papers, perform three-stage evaluation, and generate reports
  • ask: Natural language questioning with automatic routing of retrieval sources
  • profile: Generate researcher profiles
  • citations: Perform citation graph analysis; input arXiv ID / DOI is supported
  • deploy: Deploy reports to Hugo

3) Typical usage of benchmark

The README explicitly states: All benchmark commands must first enter tools/benchmark/.

cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy

Meaning:

  • Run all benchmarks by default, appending results to CSV
  • --cpu-only: Run CPU only
  • --gpu-only: Run GPU only
  • --report: Run tests and generate HTML reports
  • --report --deploy: Generate reports and publish to Hugo’s /benchmark/

4) Typical usage of website

The website tools mainly have three common commands. The build scripts for Windows and macOS/Linux are different:

pip install -e ".[website]"
cd tools/website && bash update.sh
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
cd tools/website && hugo server -D

Purposes are:

  • pip install -e ".[website]": Install website-related dependencies
  • bash update.sh:Perform incremental compression, Hugo build, and push on macOS/Linux
  • update.ps1:Execute the same process on Windows
  • hugo server -D:Local preview, including drafts

The README also emphasizes:

  • Automatically generated content will be written into tools/website/content|static
  • tools/website/public/ is a separate deployment repository
  • Do not manually commit directly to public/

5) Typical usage of translator

The simplest way to start the translator is:

pip install -e ".[translator]"
python -m translator

It will start the Gradio interface and open it in your browser.

The README also explains several usage points:

  • Supports text, Markdown, PDF, DOCX, and images
  • Preserves Markdown structure
  • Default model is tencent/Hy-MT2-1.8B
  • Also supports switching via GADGET_TRANSLATION_MODEL or model management within the interface
  • Source language can be set to auto
  • When target language is set to auto, it will switch between Chinese and English

Step 4: Understanding Output and Sync

The README explains that all generated artifacts are concentrated in the outputs/ directory, which includes:

  • logs/
  • reports/
  • cache/
  • data/
  • images/
  • backups/

If you need to sync data across devices, the README provides:

python scripts/sync.py
python scripts/sync.py push/pull

sync.py also covers patterns like status, bootstrap, config, etc., and is used for syncing categories such as summarize / website / research / benchmark / backups.

If you are encountering this project for the very first time, the most stable path is:1. Set up Python 3.10+, conda activate AI is recommended. 2. First, install the base environment:

pip install -e .
  1. If you want to use most tools, install the extras:
    pip install -e ".[all]"
    
  2. If you want to use the translator, install it separately:
    pip install -e ".[translator]"
    
  3. Copy and fill in config.example.json, and set GADGET_CONFIG if necessary.
  4. If you have API keys, put them into tokens/.
  5. Run this first:
    bash scripts/smoke.sh
    
  6. Then run the corresponding command for the tool you want to use.

If you wish, in my next message I can reorganize this content into a “step-by-step getting started checklist” more suitable for beginners, compressed into the easiest version to follow.

gpt-5.4-nano-high — 9,295 chars · 15/16 facts

1. Project Overview (What it is, repository structure, and what each tool does)

Gadgets is a “collection of practical tools accumulated during daily development.” It covers the following areas: AI daily/weekly/monthly report generation, paper discovery and research analysis, CPU/GPU performance benchmarking, Hugo blog automation, and document translation.

The core design of the repository root is:

  • Each subdirectory under tools/ is an independent tool that can be used separately;
  • Shared capabilities are centralized in the common/ package in the root directory (installed via pip install -e .), providing common capabilities such as LLM invocation, JSON parsing/repair, disk caching, atomic writes, translation, Hugo deployment, etc., to each tool;
  • Optional Companion/planning tools come from the sibling repository ../ai-companion/ (local tools in this repository will not be “intercepted” by Companion);
  • The AI agent coding workflow follows the AGENTS.md in the root directory.

Repository Structure (Directory division provided in README)

gadget/
├── tools/              # 五个独立工具产品
│   ├── summarize/      # AI 对话日报/周报/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引文图谱
│   ├── benchmark/      # CPU/GPU 性能基准
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建与发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM / cache / IO / translation / Hugo)
├── scripts/           # 运维与维护脚本(sync.py, onboard.py 等)
├── docs/              # 设计文档、ECL 计划、审计报告、历史归档等
├── outputs/           # 生成的所有产物(gitignored,可重建)
├── AGENTS.md          # AI agent 工作协议(读后再行动)
├── CLAUDE.md          # 给 Claude Code 的仓库指南
└── pyproject.toml    # packaging 配置:common/ 与各工具(pip install -e .)

What each tool does

  1. tools/summarize/ — Summarize (AI conversation daily / weekly / monthly reports)
  • Automatically reads AI conversation records exported from different devices (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), and calls LLMs to generate structured daily/weekly/monthly summaries.
  • The multi-device workflow is: first export the unexported dates from each device, then aggregate/merge them, then generate weekly and monthly reports, which can then be deployed.
  • Uses the per-source command of ccusage 20.x to automatically discover and calculate token usage and costs.
  • The LLM backend can be switched via a unified --api: ollama (default, local Ollama, no key required; Gemma4-26B), claude_cli, anthropic, or openai.
  1. tools/research/ — Research (Paper discovery and researcher analysis)
    Provided by a single CLI entry point tools/research/research_scout.py, offering four types of capabilities:
  • Paper discovery: Performs three-stage LLM pipeline screening and evaluation from arXiv / bioRxiv / PubMed, generates research weekly reports, and deploys them to Hugo; supports conference paper search and author search.
  • Deep paper insight(--insight): Downloads full paper texts, allowing LLMs to analyze writing structure, publication strategies, and reusable core knowledge; automatically matches OpenReview comments and analyzes consensus and divergence; synthesizes cross-paper writing guides.
  • Researcher profiling: Retrieves paper and citation data from ArXiv + Semantic Scholar to perform research trajectory analysis and layered scoring, and discovers mentor-student relationships through homepage extraction and co-authorship patterns (supports name disambiguation and reverse lookup).
  • Citation graph analysis: Performs forward citation/backward reference based on the Semantic Scholar API, with explanations provided by LLMs.
    Similarly supports switching LLM backends via --api: ollama (default) / claude_cli / anthropic / openai.
  1. tools/benchmark/ — Benchmark (CPU/GPU performance benchmark suite)
  • Measures floating-point performance (FLOPS) on different hardware using a unified standard, supporting NVIDIA (CUDA), Apple Silicon (MPS), and Intel XPU for actual GPU runs; OpenCL may only appear in --info detection.
  • Precision coverage includes FP64 / FP32 / FP16 / BF16 / FP8 (FP8 experimental).
  • Uses warm-up + formal measurement + statistical analysis (median, IQR outlier removal), and explicitly uses GPU synchronization to ensure timing accuracy.
  • Results are written to CSV in an append mode (not overwritten), and can generate Plotly interactive HTML reports and leaderboards; can also be deployed to Hugo and submitted to public leaderboards.
  1. tools/website/ — Website (Hugo blog)
  • Deployed to GitHub Pages (the site provided in README: https://tzj2006.github.io/), using the PaperMod theme.
  • Built-in incremental media compression: uses .last_build to compress only changed media; images go through pngquant, and videos go through HandBrakeCLI.
  • Local model bilingual translation: defaults to Ollama (and reuses the chat tag gemma4:26b); uses vLLM for translation under Linux and transformers under Windows; the model tencent/Hy-MT2-1.8B is automatically downloaded upon first run (does not use cloud LLM APIs).
  • Automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images, etc.) will be written to tools/website/content|static (a single Hugo content root directory), and files will be marked with gadget_generated; handwritten files without marks will not be overwritten.
  • tools/website/public/ is a separate deployment repository (tzj2006/tzj2006.github.io), which will be automatically committed and pushed by build scripts; do not commit to it directly.
  1. tools/translator/ — Translate (Gradio document translator)
  • A Gradio local translation web page based on the common translation engine: supports translating text and files (.md / .txt / .pdf / .docx / images, etc.), and attempts to preserve Markdown/structure (protecting fragments like code blocks, URLs, Hugo shortcodes, etc.).
  • Uses local inference (no cloud APIs): the backend is automatically selected via common.engine.create_engine():
    • ollama (prioritizes when the corresponding model tag is pulled, defaults to local Ollama);
    • Windows fallback uses transformers; Linux prefers vLLM;
    • Also provides a low-VRAM GGUF solution llamacpp.
  • Default model: tencent/Hy-MT2-1.8B (GGUF variant: tencent/Hy-MT2-1.8B-GGUF); automatically downloads upon first use.
  • Can be overridden via GADGET_TRANSLATION_MODEL or model management in the GUI; source language supports auto (detected by CJK ratio), and if the target is auto, it switches between zh↔en.

2. Detailed Chinese Usage Tutorial (Guide for first-timers: Environment Preparation, Installation, Configuration, Typical Usage)

Note: All commands/parameters below come only from the README you provided; if the README does not explicitly state a “specific command-line form” for a step, I will use text descriptions instead of inventing parameters.

2.1 Environment Preparation

  1. Python: Requires Python 3.10+ (README recommends using a conda environment AI: conda activate AI).
  2. Node.js: Requires Node.js 18+ (only for the optional Companion graph / DAG publishing tools).
  3. Tool Dependencies: Each tool has a requirements.txt in its corresponding directory (README mentions “please see each tool’s own requirements.txt”).
  4. Local Inference/Models: Website translation and the translator both use local inference engines (README specifies Ollama as default, and uses vLLM/transformers as fallbacks on Linux/Windows; models will be automatically downloaded upon first run).

2.2 Installation (pip install -e)

According to the README suggestions, you need to install at least common + the dependencies for the non-translator tools:

  • Install common + summarize/research/benchmark/website extra dependencies (all does not include translator):
pip install -e ".[all]"
  • If you want to use the translator, you need to install the translator dependencies additionally:
pip install -e ".[translator]"
  • If you are only focused on website-related tasks (README provides an extra installation command for the website):
pip install -e ".[website]"

2.3 Configuration (config.json, tokens, and environment variables)

  1. General Tool Configuration: config.json
  • Tool settings are located in config.json in the repository root (README states that config.json is gitignored and must be copied from config.example.json).
  • You can override the configuration file path using the environment variable GADGET_CONFIG.
  1. Keys/Onboarding: tokens/ directory
  • The tokens/ directory stores API keys and the onboarding sheet; this directory is gitignored, and the README explicitly states “never commit its contents.”
  • The onboarding sheet is in tokens/onboard.yaml (README mentions “fill out a YAML sheet, then run the script once”).
  1. Switching LLM Backends (Unified Method)
  • The LLM backend can be switched via the --api parameter (four backends: ollama default, claude_cli, anthropic, and openai).
  • Alternatively, use the global environment variable GADGET_LLM_BACKEND.4. Translation Backend Switching and Models
  • The translation backend uses the environment variable GADGET_TRANSLATION_BACKEND (default is ollama; llamacpp / vllm / transformers are also mentioned as options).
  • The translation model can be overridden via GADGET_TRANSLATION_MODEL; models can also be managed within the GUI.

2.4 One-time Machine Onboarding

The README provides two paths:

  • Machine Configuration for this Repository:

    • After filling out tokens/onboard.yaml, run scripts/onboard.py once; it will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, configuration for each tool, and rclone bootstrap.
    • The README does not list the “full command line of this script” in the snippet, but the script name is explicitly scripts/onboard.py.
  • Server System-level Installation: This logic has been migrated to the sibling repository ../ai-companion/scripts/onboard-server.sh, and usage instructions can be found at: bash ../ai-companion/scripts/onboard-server.sh --help.

2.5 Data Synchronization (rclone)

The README states that cross-device data synchronization uses python scripts/sync.py push/pull and “requires rclone configuration”.

  • You can run it directly:
python scripts/sync.py
  • Its config.json contains sync section controls (the configuration path can be overridden using GADGET_CONFIG).

It also mentions at the top of the README: “To sync data, run python scripts/sync.py”.

2.6 Output Directory (outputs/)

All generated results are concentrated in outputs/ (which is gitignored in the README and can be rebuilt). The directory includes:

  • outputs/logs/ (intermediate processes)
  • outputs/reports/ (final reports: Markdown/JSON/HTML)
  • outputs/cache/ (LLM cache, search cache)
  • outputs/data/ (CSV/JSON profiles)
  • outputs/images/ (charts and generated images)
  • outputs/backups/ (forced override backups, such as website-force)

Hugo site content will be written to tools/website/content|static (the README explicitly states there is no separate outputs/site staging tree).


2.7 Typical Usage for Each Tool (Commands can be copied directly)

A) summarize: AI Conversation Daily/Weekly/Monthly Reports

The README recommends using the python -m summarize format (compatible with old scripts, but written here as recommended):

  1. Phase 1: Export unexported dates (daily export)
python -m summarize daily export
  1. Phase 2: Sync all dates and merge by day
python -m summarize daily merge --sync-all
  1. Generate and deploy weekly reports
python -m summarize weekly generate --week 2026-W12 --deploy
  1. Generate and deploy monthly reports
python -m summarize monthly generate --month 2026-02 --deploy
  1. One-click full process (export → merge → weekly → monthly + deploy)
python -m summarize auto --deploy

If you want to switch the LLM backend, the README states that the four summary backends for summarize can be switched via a unified --api (ollama default, claude_cli, anthropic, openai).


B) research: Paper Discovery and Research Analysis

The unified entry point is tools/research/research_scout.py}, with typical commands:

  1. Full research pipeline (search → three-stage evaluation → report)
python tools/research/research_scout.py report --project my-project
  1. Natural language retrieval (automatically routed to corresponding sources)
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
  1. Researcher profiling
python tools/research/research_scout.py profile "Sergey Levine"
  1. Citation graph (by arXiv ID / DOI)
python tools/research/research_scout.py citations 2301.12597
  1. Deploy reports to Hugo
python tools/research/research_scout.py deploy

The README explains that the research LLM backend can also be switched via --api (ollama default, claude_cli, anthropic, openai). Additionally, the “Deep paper insight” feature supports the --insight parameter, but the README snippet does not provide a corresponding full command line example.


C) benchmark: CPU/GPU Performance Benchmark Suite

The README explicitly requires: perform cd tools/benchmark/ before all benchmark commands.

  1. Run all
cd tools/benchmark
python -m benchmark.cli
  1. CPU only
cd tools/benchmark
python -m benchmark.cli --cpu-only
  1. GPU only
cd tools/benchmark
python -m benchmark.cli --gpu-only
  1. Run benchmarks and generate HTML reports
cd tools/benchmark
python -m benchmark.cli --report
  1. Generate reports and deploy to Hugo /benchmark/
cd tools/benchmark
python -m benchmark.cli --report --deploy

D) website: Hugo Blog (Compress + Build + Publish)

  1. Install website dependencies (method provided in README)
pip install -e ".[website]"
  1. macOS/Linux: Incremental compression + Hugo build + push to Pages
cd tools/website && bash update.sh
  1. Windows: Run PowerShell update script (will switch to the script directory)
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
  1. Local preview (dev server, including drafts)
cd tools/website && hugo server -D

The README adds a reminder: tools/website/public/ is an independent deployment repository that automatically commits and pushes; do not commit to it manually.


E) translator: Gradio Document Translator

  1. Install translator dependencies
pip install -e ".[translator]"
  1. Start Gradio GUI (open in browser)
python -m translator

The README states the default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF}), which will be automatically downloaded upon first use; it can be overridden via GADGET_TRANSLATION_MODEL or within the GUI’s model management.


Finally: README Rules to Avoid Pitfalls (Short but Important)

  • Do not treat automatically generated content, rclone synced data, build artifacts (such as build/, gadget.egg-info/), or the deployment/theme repositories under tools/website/ as “source code that needs git add”.
  • Do not commit directly to tools/website/public/ (it is an independent deployment repository pushed automatically by scripts).
  • tokens/ contains keys and the onboarding sheet: keep it gitignored and do not commit.

If you wish, I can also organize a sequential checklist for the “minimum path from zero to running summarize/research/website” based on the README without fabricating commands (using only information present in the README). Which tool would you like to run first: summarize, research, benchmark, website, or translator?

gpt-5.1-high — 10,795 chars · 15/16 facts

I. Project Overview (Chinese Summary)

1. What is this project?

Gadgets is a repository that organizes useful scripts accumulated during daily development into a suite, centered around these types of tasks:

  • AI Conversation Daily/Weekly/Monthly Report Generation
  • Paper Search and Scientific Research Persona Analysis
  • CPU/GPU Performance Benchmarking
  • Hugo Blog Automated Building and Media Compression
  • Local Document Translation Web GUI

All tools share the common/ package in the root directory (installed via pip install -e .), providing unified:

  • LLM Calls (supporting ollama / claude_cli / anthropic / openai)
  • JSON Parsing and Repair
  • Disk Caching (SHA-256 + TTL) and Atomic Writes
  • Local Translation Engine
  • Hugo Deployment Encapsulation

The optional AI Companion (independent repository ../ai-companion/ ) provides DAG publishing and graph tools, but is not required.

2. Repository Structure Introduction

  • tools/: 5 mutually independent “product-level” tool directories
    • tools/summarize/: AI conversation daily/weekly/monthly report generation
    • tools/research/: Paper discovery, researcher profiling, and citation graph analysis
    • tools/benchmark/: CPU/GPU FLOPS benchmark suite
    • tools/website/: Hugo blog (incremental media compression + automated build and publish)
    • tools/translator/: Gradio document translation Web application
  • common/: Infrastructure package shared by all tools (LLM calls, cache, IO, translation, Hugo deployment).
  • scripts/: Operations scripts, such as data synchronization, one-click environment configuration, and translation performance analysis.
  • docs/: Design documents, ECL plans, audit reports, and historical archives.
  • outputs/: All outputs produced during execution, categorized by logs, reports, cache, data, images, and backups; fully rebuildable and has been .gitignore.
  • Other Important Files
    • AGENTS.md: Working protocols for all AI agents within the repository.
    • CLAUDE.md: Repository instructions for Claude Code.
    • pyproject.toml: Packaging configuration for the entire project and its tools.

3. What does each tool do?- tools/summarize/ – Session Daily/Weekly/Monthly Reports

  • Reads your AI session logs from multiple sources (Claude Code, Codex, Cursor Agent, ChatGPT, custom JSON).

  • Generates structured Daily → Weekly → Monthly Trends in two stages.

  • Automatically calculates tokens and costs for various agent CLIs via ccusage 20.x.

  • Supports four LLM backends, switched uniformly via --api: ollama (default, local), claude_cli, anthropic, openai.

  • tools/research/ – Paper Discovery & Researcher Profiling

    • A unified CLI: tools/research/research_scout.py.
    • Paper Discovery: Searches for papers from arXiv / bioRxiv / PubMed, using a three-stage LLM pipeline (initial screening → deep evaluation → citation impact) and generates Hugo reports.
    • Deep Insights (--insight): Downloads full texts, analyzes writing structure, publication strategies, and core knowledge; automatically scrapes OpenReview reviews and summarizes opinions.
    • Scholar Profiling: Calculates research trajectories, Tier scores, and mentor-student relationships based on arXiv + Semantic Scholar.
    • Citation Graph Analysis: Based on Semantic Scholar’s forward/backward citation graphs + LLM interpretation.
  • tools/benchmark/ – Performance Benchmarking

    • Cross-platform CPU/GPU FLOPS testing, providing unified evaluation for GPUs from different vendors (NVIDIA CUDA / Apple MPS / Intel XPU).
    • Supports precisions such as FP64 / FP32 / FP16 / BF16 / FP8.
    • Includes warmup + formal measurement + statistical analysis (median, IQR for outlier removal), with results appended to CSV.
    • Can generate Plotly interactive HTML reports and supports deployment to Hugo sites or public leaderboards.
  • tools/website/ – Hugo Blog Site

    • Blog site “TzJ’s Net” (PaperMod theme), deployed to GitHub Pages.
    • Built-in incremental media compression (only compresses images/videos changed since .last_build):
      • Images via pngquant
      • Videos via HandBrakeCLI
    • Local bilingual translation (default Ollama; vLLM available on Linux, transformers on Windows), automatically downloads tencent/Hy-MT2-1.8B models on first use.
    • All auto-generated content (summary reports, research reports, benchmark pages, images) is written directly to tools/website/content|static with gadget_generated tags, and will not overwrite handwritten content.
    • tools/website/public/ is a separate deployment repository (automatic commit + push; manual modification is not recommended).
  • tools/translator/ – Gradio Document Translator

    • A Web interface implemented based on the common translation engine, similar to Google Translate.
    • Supports translating text and various file types (.md / .txt / .pdf / .docx / images), preserving Markdown format, code blocks, URLs, Hugo shortcodes, etc.
    • Fully utilizes local inference (default tencent/Hy-MT2-1.8B, GGUF variant); models are automatically downloaded upon first call.
    • Supports automatic detection of source and target languages for Chinese-English mutual translation; the backend can be selected via GUI or environment variables.
  • common/ – Shared Infrastructure

    • Unified LLM calling interface (ollama / claude_cli / anthropic / openai).
    • JSON repair, disk caching, atomic writes, translation engine, and Hugo deployment encapsulation.
  • scripts/ – Operations & Maintenance Scripts

    • sync.py: Unified rclone data synchronization (push/pull/status/config/backup, including DAG sites).
    • onboard.py: One-click completion after filling in tokens/onboard.yaml: SSH, Claude/Codex CLI, pip extras, tool configurations, and rclone startup.
    • smoke.sh: Smoke tests that do not modify any data (--help / --info / import).
    • serve_local_llm.sh : Creates Ollama models adapted for summarize and outputs environment variable settings.
    • Others such as language.py (Hugo language audit), profile_translation.py (translation GPU profiler).
  • ../ai-companion/ (Independent Repository)

    • Provides DAG publishing tools, idea graph, and skill pipeline, but this repository itself does not enable Companion intercept hooks.

II. Detailed Tutorial (For first-time users)

Note: All example commands below are taken directly from the README; no new commands or parameters have been added. You can copy and run them directly, but please replace paths, project names, timestamps, etc., according to your own environment.

1. Environment Preparation

  • Base Environment
    • Python 3.10+ (A separate virtual environment or conda environment is recommended, such as the AI environment, then conda activate AI).
    • Node.js 18+ (Only required when using optional Companion graph / DAG publishing tools).
  • Hardware
    • If you need to use benchmark or high-performance translation, it is recommended to have a corresponding GPU (NVIDIA CUDA / Apple MPS / Intel XPU); the project will detect it automatically.
  • Data & API keys
    • There is a tokens/ directory in the repository root (already gitignored) used for storing sensitive information like API keys and onboard configurations; do not commit it to git.

2. Project Installation & Public Dependencies

Assuming you have placed the repository code in a local directory, execute the following commands from the repository root.

  • Install base packages + dependencies required for summarize / research / benchmark / website
pip install -e ".[all]"
  • If you want to use the translator tool (Gradio document translation), you also need to install its extras separately:
pip install -e ".[translator]"

Note: pip install -e ".[all]" does not include dependencies related to translator; you must explicitly add the command above.

3. Configuration Files & Environment Variables

  • Global Configuration Files
    • config.json in the root directory (gitignored) saves configurations for various tools. The README mentions you can copy one from config.example.json and modify it as needed.
    • If you need to use a custom path, you can override the default path via the environment variable GADGET_CONFIG.
  • LLM Backend Selection
    • All features using LLM (summarize / research / common) support selecting the backend via the --api parameter:
      • ollama (default, local Ollama, gemma4:26b)
      • claude_cli
      • anthropic
      • openai
    • You can also use the environment variable GADGET_LLM_BACKEND for global default settings.
  • Translation Backend & Models
    • The translation path uses the environment variable GADGET_TRANSLATION_BACKEND to specify the backend:
      • Default is ollama (local service, reuses gemma4:26b tag).
      • When falling back to llamacpp / vllm / transformers, it will use tencent/Hy-MT2-1.8B, which is automatically downloaded on first use.
    • The default model for the Translator tool is tencent/Hy-MT2-1.8B (GGUF variant), which can be overridden via GADGET_TRANSLATION_MODEL or the GUI.

4. One-click Initialization for New Machines (Optional)

  • Repository-level machine configuration: scripts/onboard.py

    1. Fill in information such as SSH, various tokens, and tools you wish to enable in tokens/onboard.yaml.

    2. Run the following in the repository root:

      python scripts/onboard.py
      
    3. The script will automatically:

      • Configure SSH
      • Install/login to Claude/Codex CLI
      • Install required pip extras for each tool
      • Configure each tool
      • Start rclone synchronization
  • Server-level installation (within the ai-companion repository)

    • If you are performing a full-site installation (SSH key, Claude Code, Superpowers, Ponytail, AI Companion, etc.) on an Ubuntu 22.04/24.04 server, you need to run this in the sibling repository ../ai-companion/:

      bash ../ai-companion/scripts/onboard-server.sh --help
      

5. Data Synchronization & Output Directories

  • Data Synchronization (Multi-device scenarios)
    • The README indicates:
      • The top-level synchronization entry point is:

        python scripts/sync.py
        ```- More granular cross-device synchronization examples are provided in the form of `python scripts/sync.py push/pull` (choose push or pull based on your scenario).
        
      • The script uses the sync configuration section of the root directory config.json (the path can be overridden using GADGET_CONFIG).

      • DAG site publishing uses scripts/sync.py --category dag.

  • Output Location
    • All content generated by running the tools is placed under outputs/, with a structure roughly as follows:
      • outputs/logs/: Run logs, export logs
      • outputs/reports/: Final reports (Markdown / JSON / HTML)
      • outputs/cache/: LLM and search cache
      • outputs/data/: Structured data (CSV / JSON)
      • outputs/images/: Charts and generated images
      • outputs/backups/: Backups during forced overrides
    • Hugo site content is written directly to tools/website/content|static.

6. Quick Self-Check Before Running (Optional)

  • Smoke Test Script: scripts/smoke.sh

    • Confirm that the --help / --info and imports for each tool are correct (without triggering LLM, network, or writes):

      bash scripts/smoke.sh
      
  • Local LLM Service Helper Script: scripts/serve_local_llm.sh

    • Creates an Ollama tag optimized for summarize, and prints a set of environment variables (applied via eval):

      eval "$(bash scripts/serve_local_llm.sh env)"
      
    • Persistent configuration items are written in the summarize section of the root directory config.json.


III. Typical Usage for Each Tool (Commands Ready to Copy)

1. Summarize: AI Session Daily / Weekly / Monthly Reports

Goal: Automatically organize AI conversations scattered across multiple devices and tools into structured daily/weekly/monthly reports, with optional automatic deployment to the Hugo site.

  1. Daily Workflow Overview

    • Export the day’s AI conversation records from each device.
    • Sync the exported data from all devices to the same location (cloud drive or python scripts/sync.py).
    • Run the summarize daily/weekly/monthly commands to generate reports, with an option to --deploy automatically publish to Hugo.
  2. Typical Commands

python -m summarize daily export
  • Meaning: Phase 1, export conversation records for all dates that are “not yet exported.”
python -m summarize daily merge --sync-all
  • Meaning: Phase 2, sync all dates and merge them by day to generate daily summaries.
python -m summarize weekly generate --week 2026-W12 --deploy
  • Meaning: Generate the weekly report for Week 12 of 2026 and deploy it.
python -m summarize monthly generate --month 2026-02 --deploy
  • Meaning: Generate the monthly report for February 2026 and deploy it.
python -m summarize auto --deploy
  • Meaning: One-click full pipeline: export → merge → weekly → monthly and deploy.

Switching LLM Backends: --api can be added after any of the above commands, such as --api ollama / --api claude_cli / --api anthropic / --api openai.

Legacy Entry Compatibility: python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available, but the new python -m summarize format is recommended.

2. Research: Paper Discovery and Scientific Figure Analysis

Unified Entry Script: tools/research/research_scout.py.

  1. Full Paper Search + Weekly Report Generation
python tools/research/research_scout.py report --project my-project
  • Meaning: Using my-project as the project name, execute:
    • Multi-source paper search (arXiv / bioRxiv / PubMed)
    • Three-stage LLM evaluation
    • Generate research weekly reports and deploy to Hugo (based on internal tool configuration).
  1. Natural Language Retrieval
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
  • Meaning: Use natural language queries to automatically route to appropriate data sources for paper searching.
  1. Researcher Profiling
python tools/research/research_scout.py profile "Sergey Levine"
  • Meaning: Based on ArXiv + Semantic Scholar, construct a research trajectory analysis and tier rating for “Sergey Levine.”
  1. Citation Graph Analysis
python tools/research/research_scout.py citations 2301.12597
  • Meaning: Construct a citation/cited-by graph using an arXiv ID (or DOI) and use LLM to interpret the impact.
  1. Deploy Reports to Hugo
python tools/research/research_scout.py deploy
  • Meaning: Deploy the generated research reports to the Hugo site.

Similarly, all commands involving LLM can add --api to switch backends, for example, appending --api claude_cli after the report command.

3. Benchmark: CPU/GPU Performance Benchmarking

Important: The README explicitly requires that all benchmark commands must first cd tools/benchmark.

  1. Enter Tool Directory
cd tools/benchmark
  1. Run All Benchmarks (Results appended to CSV)
python -m benchmark.cli
  1. Run CPU Benchmarks Only
python -m benchmark.cli --cpu-only
  1. Run GPU Benchmarks Only
python -m benchmark.cli --gpu-only
  1. Run Benchmarks and Generate HTML Report
python -m benchmark.cli --report
  1. Generate Report and Deploy to Hugo
python -m benchmark.cli --report --deploy

4. Website: Hugo Blog Automated Construction and Publishing

  1. Install website-related dependencies
pip install -e ".[website]"
  1. macOS / Linux: Media Compression + Hugo Build + Push to GitHub Pages
cd tools/website && bash update.sh
  1. Windows: Media Compression + Build + Push
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
  • The script will automatically switch to its own directory internally before execution.
  1. Local Site Preview (Development mode, including drafts)
cd tools/website && hugo server -D
  • This allows you to open the Hugo dev server on your local machine to preview blog content in real-time.

Note:

  • Automatically generated content is written to tools/website/content|static and marked with gadget_generated; manually written content will not be overwritten.
  • tools/website/public/ is an independent Git repository used for deployment; the build script will automatically commit + push.

5. Translator: Gradio Document Translation Web App

  1. Install translator dependencies
pip install -e ".[translator]"
  1. Start Gradio GUI
python -m translator
  • After starting, a browser page will open where you can:
    • Input or paste text
    • Upload .md / .txt / .pdf / .docx / images, etc.
    • Select source language (can be set to auto) and target language (can be set to auto to achieve Chinese-English mutual translation)
    • Select or switch models (default is tencent/Hy-MT2-1.8B, automatically downloaded on first use)

This tool uses common.engine.create_engine() to select the backend: prioritizing ollama, preferring vllm on Linux, using transformers on Windows, and using llamacpp GGUF for low VRAM scenarios.


IV. Typical Usage of Scripts and Helper Tools

1. Data Synchronization Script scripts/sync.py

  • Basic Call:
python scripts/sync.py
  • Purpose (according to README description):
    • Centralized management of rclone data synchronization (push / pull / status / bootstrap / config).
    • Covers categories such as summarize / website / research / benchmark / backups, etc.
    • The special dag category is used via scripts/sync.py --category dag to generate + deploy DAG sites.
    • Also used for cross-device synchronization (explained in the README in the form of python scripts/sync.py push/pull).

2. One-click Onboarding (Re-emphasized)

  • Repository-level:
python scripts/onboard.py
  • Run once after filling out tokens/onboard.yaml.

3. Smoke Test and Local LLM Service

  • Smoke Test:
bash scripts/smoke.sh
  • Local LLM Environment Variable Output:
eval "$(bash scripts/serve_local_llm.sh env)"

The above is an overview and tutorial organized entirely based on the README, without adding any commands or parameters outside of the README. If you later wish to create more in-depth Chinese steps for a specific tool (for example, using only summarize or only benchmark), I can help you break it down into a more detailed operation checklist following that tool’s README / TUTORIAL structure.

gemini-3-flash — 2,767 chars · 13/16 facts

This report is organized based on the provided gadget project README.md.

1. Project Summary

Gadgets is a practical toolset oriented towards developers’ daily work. It integrates functions such as AI report generation, paper research, performance evaluation, blog automation, and document translation, aiming to improve development efficiency.

Repository Structure

  • tools/: Contains five independent tool products (where the core logic resides).
  • common/: Shared infrastructure package, providing general capabilities such as LLM calls, caching, IO, translation, Hugo deployment, etc.
  • scripts/: Operations and maintenance scripts, such as the synchronization tool sync.py and new machine configuration script onboard.py.
  • docs/: Design documents, plans, and audit reports.
  • outputs/: Stores all automatically generated artifacts (Git is ignored; can be rebuilt automatically).
  • AGENTS.md / CLAUDE.md: Running protocols and guidelines for AI agents and Claude Code.

Detailed Tool Functions- Summarize (AI 报表): Reads AI session logs (Claude, ChatGPT, etc.), utilizes LLMs to generate daily, weekly, and monthly summaries, and statistics Token usage costs.

  • Research (论文调研): Supports paper searching on platforms like arXiv/PubMed, deep analysis (including OpenReview evaluations), scholar profile analysis, and citation graph analysis.
  • Benchmark (性能评测): A cross-platform CPU/GPU FLOPS benchmarking tool supporting NVIDIA, Apple Silicon, and Intel hardware, capable of generating interactive HTML reports.
  • Website (博客运维): Personal blog management based on Hugo, featuring incremental media compression (images/videos) and local model-driven bilingual automatic translation.
  • Translator (文档翻译): A Gradio-based Web UI tool that utilizes local models to translate documents (PDF, Docx, Markdown, etc.) while preserving formatting.

2. Detailed Usage Tutorial

This tutorial is intended for users encountering this project for the first time, guiding them on how to configure and run the tools from scratch.

Environment Preparation

  • Python: 3.10+ (Conda is recommended: conda activate AI)
  • Node.js: 18+ (for optional Companion components)
  • Hardware: Supports CUDA (NVIDIA), MPS (Apple), or XPU (Intel) for GPU-related operations.

Installation Steps

Execute the following commands in the repository root directory:

# 安装核心依赖及主要工具
pip install -e ".[all]"

# 安装翻译工具额外依赖 (包含 Gradio 和本地推理引擎)
pip install -e ".[translator]"

Initialization Configuration

  1. Configuration File: Copy config.example.json in the root directory to config.json and modify as needed.
  2. Credential Management: Place API keys in the tokens/ directory (this directory is ignored by Git).
  3. One-click Onboarding (Optional): After filling in tokens/onboard.yaml, run:
    python scripts/onboard.py
    

Typical Usage for Each Tool

1. Summarize — AI Report Generation

Supports four backends: ollama (default), claude_cli, anthropic, and openai.

# 一键完成:导出、合并、生成周报/月报并部署
python -m summarize auto --deploy

# 手动生成特定周报
python -m summarize weekly generate --week 2026-W12 --deploy
2. Research — Paper Research & Scholar Analysis
# 生成特定项目的研究周报(搜索 -> 评估 -> 报告)
python tools/research/research_scout.py report --project my-project

# 自然语言搜索论文
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

# 分析学者画像
python tools/research/research_scout.py profile "Sergey Levine"
3. Benchmark — Hardware Benchmarking

Note: You must enter the corresponding directory first.

cd tools/benchmark
# 运行完整跑分并生成交互式 HTML 报告
python -m benchmark.cli --report

# 仅运行 CPU 跑分
python -m benchmark.cli --cpu-only
4. Website — Blog Operations & Building
# Windows 用户执行:增量压缩媒体、Hugo 构建并推送
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

# macOS/Linux 用户执行
cd tools/website && bash update.sh

# 本地预览博客
cd tools/website && hugo server -D
5. Translator — Web-based Document Translation
# 启动 Gradio GUI (自动在浏览器打开)
python -m translator

Advanced Tips

  • Switching LLM Backends: Most tools support switching via the --api parameter, such as --api claude_cli or --api openai.
  • Data Synchronization: Use python scripts/sync.py push or pull to sync data across devices (requires rclone configuration).
  • Default Model: The translation tool uses tencent/Hy-MT2-1.8B by default, which will be automatically downloaded upon the first run.
gemini-3.5-flash — 5,722 chars · 14/16 facts

Based on the README.md content of the open-source project gadget you provided, I have organized a project summary and a detailed Chinese usage tutorial for beginners.


Part 1: Open Source Project gadget Summary

1. Project Introduction

Gadgets is a collection of practical tools accumulated during daily development. It covers scenarios such as AI daily report generation, academic paper discovery and analysis, hardware performance benchmarking, Hugo blog automated building and publishing, and local document translation. The core philosophy of the project is high modularity, where each tool can be used independently while sharing the underlying infrastructure located in the root directory.

2. Repository Structure

The project directory structure is clearly divided, mainly containing the following parts:

  • tools/ (Tool Product Directory): Contains five completely independent sub-toolkits, serving as the location for specific tool logic.
  • common/ (Shared Infrastructure): General underlying code providing cross-tool basic capabilities such as LLM invocation, JSON parsing and repair, SHA-256 disk caching, atomic writing, translation engines, and Hugo deployment.
  • scripts/ (Ops & Maintenance Scripts): Contains scripts for machine setup, multi-device synchronization, smoke testing, and local LLM startup.
  • docs/ (Documentation): Stores design documents, ECL plans, audit reports, and historical archives.
  • outputs/ (Output Directory): A unified location for all generated artifacts (such as logs, reports, caches, data, charts, backups, etc.). This directory is ignored by Git and can be automatically rebuilt.
  • Protocol/Guide Files:
    • AGENTS.md: AI Agent workflow protocol (must read before modifying code).
    • CLAUDE.md: Repository guide specifically for Claude Code.
    • pyproject.toml: Bundled configuration files used for installing common packages and various tool dependencies.

3. Functional Overview of Each Tool

  • summarize (AI Conversation Reports): Reads AI conversation logs from multiple devices (such as Claude Code / Cursor, etc.), calls LLMs to automatically generate structured daily, weekly, and monthly reports, and uses ccusage to automatically calculate Token consumption and costs for each Agent CLI.
  • research (Academic Research Toolkit): Integrates multiple data sources like arXiv and Semantic Scholar, providing automatic paper discovery with three-stage LLM filtering, deep paper insights (structural analysis, OpenReview evaluation synthesis), researcher trajectory profiling, and citation graph analysis.
  • benchmark (Performance Benchmarking): A cross-platform CPU/GPU floating-point performance measurement tool. It uniformly supports multi-precision testing (FP64 to FP8) for CUDA, Apple MPS, and Intel XPU. Results are written in append mode to CSV and can generate Plotly interactive chart leaderboards.
  • website (Hugo Blog): A static blog website based on Hugo. It features built-in incremental media compression (pngquant, HandBrakeCLI) and a bilingual translation pipeline using local models (Hy-MT2-1.8B) without needing an internet connection, achieving fully automated building and publishing.
  • translator (Gradio Document Translator): A local Web-based translation interface built on the common translation engine. It supports translating text while preserving Markdown formatting and various document types (.pdf, .docx, etc.), and can automatically identify languages based on CJK ratios for Chinese-English mutual translation.

Part 2: gadget Detailed Chinese Usage Tutorial

This tutorial is intended for users encountering the project for the first time, guiding you through the entire process from environment preparation, installation, and configuration to the actual running of each tool.

1. Environment Preparation

Before starting, please ensure your system meets the following basic software requirements:

  • Python: 3.10+ (Conda environment AI is recommended)
  • Node.js: 18+ (Only required when using the optional Companion graph and DAG publishing tools)
  • rclone: (Only required when cross-device data synchronization is needed)

Activate your Conda environment in the terminal:

conda activate AI

2. Installation Steps

The project installs dependencies on demand via Extra features. Please execute the corresponding installation command in the root directory based on your usage scenario:

  • To install general base dependencies and all tool extras (does not include translator dependencies):
    pip install -e ".[all]"
    
  • If you need to use the translation and compression features of the blog (Website):
    pip install -e ".[website]"
    
  • If you need to use the Gradio translator (Translator):
    pip install -e ".[translator]"
    

3. Initialization and Machine Configuration

3.1 One-click Onboarding Script

For the first environment configuration on a new machine, the project provides an onboarding script. It automatically configures SSH, installs and authenticates Claude/Codex CLI, installs dependency packages, and configures rclone:

  1. Copy and fill in tokens/onboard.yaml (this directory is ignored by Git for safe storage of sensitive Tokens).
  2. Run the onboarding script in the project root directory:
    python scripts/onboard.py
    

3.2 Configuration Files

Global settings for the tools are stored in config.json in the root directory.

  • Please copy config.example.json and rename it to config.json for modification.
  • Environment Variable Override: You can redirect the configuration file path by setting the system environment variable GADGET_CONFIG.

4. Global Core Configuration and Environment Variables

The project supports flexible switching of underlying engines via environment variables and command-line parameters:

  • LLM Interface Switching: Switch via parameter --api or global environment variable GADGET_LLM_BACKEND. Optional values include:
    • ollama (Default: local Ollama service, using the keyless gemma4:26b model)
    • claude_cli (No API Key required, directly reuses the login status of the local Claude Code CLI)
    • anthropic
    • openai
  • Translation Backend Switching: Switch via global environment variable GADGET_TRANSLATION_BACKEND. Optional values include:
    • ollama (Default: reuses the gemma4:26b model from the local Ollama service)
    • llamacpp / vllm / transformers (In-process local inference, defaults to using the automatically downloaded tencent/Hy-MT2-1.8B model)
  • Translation Model Overwrite: You can specify other translation models by setting the environment variable GADGET_TRANSLATION_MODEL.

5. Typical Usage and Commands for Each Tool

Note: Please copy and run the following commands directly. All generated artifacts will be saved in the outputs/ folder in the root directory.

5.1 Summarize — AI Conversation Daily/Weekly/Monthly Reports* Step 1: Export all unexported conversation histories

```bash
python -m summarize daily export
```
  • Step 2: Sync and merge daily reports day by day
    python -m summarize daily merge --sync-all
    
  • Generate a weekly report for a specified week and deploy to the blog
    python -m summarize weekly generate --week 2026-W12 --deploy
    
  • Generate a monthly report for a specified month and deploy to the blog
    python -m summarize monthly generate --month 2026-02 --deploy
    
  • One-click full pipeline (Automatically executes Export $\rightarrow$ Merge $\rightarrow$ Weekly Report $\rightarrow$ Monthly Report and Deployment)
    python -m summarize auto --deploy
    

5.2 Research — Paper Discovery and Researcher Analysis

  • Run the full research report pipeline (Search $\rightarrow$ Three-stage evaluation $\rightarrow$ Generate research report)
    python tools/research/research_scout.py report --project my-project
    
  • Natural language search for papers (Automatically routes academic data sources)
    python tools/research/research_scout.py ask "Find recent robot manipulation papers by Pieter Abbeel"
    
  • Analyze a specific researcher’s academic trajectory, calculate scores, and extract mentor-student relationships
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Analyze the citation graph of a specific paper (Supports arXiv ID or DOI)
    python tools/research/research_scout.py citations 2301.12597
    
  • One-click deploy generated academic reports to Hugo blog
    python tools/research/research_scout.py deploy
    

5.3 Benchmark — Performance Benchmarking

Before running this tool, you must enter the tools/benchmark directory.

cd tools/benchmark
  • Run full benchmark (Automatically identifies CUDA/MPS/XPU, appends results to CSV)
    python -m benchmark.cli
    
  • Test CPU performance only
    python -m benchmark.cli --cpu-only
    
  • Test GPU performance only
    python -m benchmark.cli --gpu-only
    
  • Run tests and generate Plotly interactive HTML reports
    python -m benchmark.cli --report
    
  • Run tests, generate reports, and one-click publish to the /benchmark/ page on Hugo blog
    python -m benchmark.cli --report --deploy
    

5.4 Website — Hugo Blog Automated Build

  • Update, compress media, and publish on macOS / Linux systems
    cd tools/website && bash update.sh
    
  • Update, compress media, and publish on Windows systems
    powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
    
  • Start local preview development server (including drafts)
    cd tools/website && hugo server -D
    

5.5 Translator — Gradio Web Translator

  • Start local Gradio web-based translation service (After starting, you can open the service address in a browser for visual translation)
    python -m translator
    

6. Common Operations and Auxiliary Commands

  • Read-only smoke test (Quickly check dependency imports for all tools and whether --help/--info are functioning normally)
    bash scripts/smoke.sh
    
  • Cloud data synchronization (Use rclone to sync data, supporting push or pull)
    python scripts/sync.py push
    python scripts/sync.py pull
    
  • Start local Ollama fine-tuned for summarization and import environment variables
    eval "$(bash scripts/serve_local_llm.sh env)"
    
gpt-5-mini — 9,165 chars · 16/16 facts

Answer in two parts as requested: first a Chinese summary of the project (what it is, repository structure, what each tool does), then a detailed Chinese user tutorial for first-time users (environment preparation, installation, configuration, typical replicable commands for each tool). All content is based solely on the information in README.md, without extrapolation or adding new commands.

  1. Project Overview (Chinese Summary)
  • What it is

    • Gadgets: A collection of practical development tools covering AI session summarization (daily/weekly/monthly reports), paper retrieval and researcher analysis, performance benchmarking (CPU/GPU FLOPS), Hugo blog automated deployment and incremental media compression, and document translation based on local inference (Gradio GUI). Each tool is independent and shares the common/ base package under the repository root (LLM calls, caching, translation, Hugo publishing, etc.).
  • Repository Structure (Simplified)

    • tools/
      • summarize/ — AI session daily/weekly/monthly summarization tool (multi-device, two-stage)
      • research/ — Paper discovery, researcher profiling, citation graph
      • benchmark/ — Cross-platform CPU/GPU performance benchmark suite
      • website/ — Hugo blog (incremental media compression + automated build & publish)
      • translator/ — Gradio-based document translation frontend (local inference)
    • common/ — Shared base package: LLM interfaces, JSON repair, disk cache, atomic writes, local translation engine, Hugo deployment, etc. (installed via pip install -e .)
    • scripts/ — Operations scripts (sync.py, onboard.py, smoke.sh, serve_local_llm.sh, etc.)
    • docs/ — Design documents and archives
    • outputs/ — All generated artifacts (logs/reports/cache/data/images/backups, gitignored)
    • Others: AGENTS.md (proxy workflows), pyproject.toml (packaging configuration)
  • What each tool does (Summary)

    • summarize: Reads AI session logs from multiple devices (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), uses LLMs to generate structured daily/weekly/monthly summaries, and can track token/cost (via ccusage 20.x); supports multiple LLM backends (--api).
    • research: A unified academic research tool featuring paper discovery (arXiv/bioRxiv/PubMed), three-stage LLM review, deep insight downloading and analysis, researcher profiling (ArXiv + Semantic Scholar), citation graph analysis, and the ability to deploy reports to Hugo.
    • benchmark: Cross-platform FLOPS benchmark supporting NVIDIA CUDA / Apple MPS / Intel XPU, covering various precisions (FP64/FP32/FP16/BF16/FP8 (experimental)), measuring including warmup and statistical analysis, appending results to CSV, generating interactive HTML reports, and deploying to Hugo.
    • website: A Hugo-based static blog pipeline with built-in incremental media compression (pngquant, HandBrakeCLI) and local model bilingual translation (defaulting to Ollama / local model tencent/Hy-MT2-1.8B automatic download), automatically writing generated content to tools/website/content|static and building/pushing to Pages via scripts (tools/website/public/ is a separate deployment repository and should not be manually committed).
    • translator: A document translator with Gradio Web UI, supporting .md/.txt/.pdf/.docx/图片, etc., protecting code blocks/URLs/Hugo shortcodes, using the local inference translation engine from common (automatically selecting ollama / vllm / transformers / llamacpp), with default model tencent/Hy-MT2-1.8B (automatically downloaded on first run).
  • Shared Base and Script Key Points

    • common/ implements unified LLM backend access (ollama, claude_cli, anthropic, openai), disk cache, translation engine, Hugo deployment, etc.
    • scripts/ includes data synchronization (sync.py, based on rclone), machine onboarding (onboard.py), local LLM startup scripts, read-only smoke test scripts, etc.
    • Outputs are uniformly written to outputs/ (logs/reports/cache/data/images/backups).- Key points to note (Reminders in README)
    • Python 3.10+, Node.js 18+ (only required when using Companion/DAG tools)
    • tokens/ stores API keys and onboarding forms; it is gitignored; do not commit
    • All generated files are under outputs/ and are gitignored
    • LLM backend is switched globally via the --api parameter, or via the GADGET_LLM_BACKEND environment variable
    • Translation backend is controlled via GADGET_TRANSLATION_BACKEND, and models via GADGET_TRANSLATION_MODEL
    • Do not commit auto-generated content, rclone sync data, build/, gadget.egg-info/, or deployment theme repository content to git
    • License: GPL-3

  1. Detailed Chinese Usage Tutorial (For first-timers, covering environment preparation, installation, configuration, and typical usage of each tool; commands can be copied directly; all sourced solely from README)

Prerequisites: The following steps and commands are based strictly on the instructions and descriptions listed in the README, without adding extra parameters or commands not appearing in the README.

A. Environment Preparation (Minimum Requirements)

  • Python: 3.10+
  • Recommended (Optional): Use a conda environment (README recommends named AI), for example:
    • conda environment (README suggests): Create and activate first (README only suggests activate):
      • conda create -n AI python=3.10
      • conda activate AI (Note: README recommends using conda activate AI, but does not provide the specific creation command; the above is just a common practice)
  • Node.js: 18+ (only when Companion / DAG functionality is required)
  • Other system tools: pngquant, HandBrakeCLI, Hugo (for website tools; README mentions these dependencies in the website section)
  • rclone (for cross-device sync, if using push/pull of scripts/sync.py)

B. Basic Repository Installation & common packages

  • In the repository root, install the common editable package (minimal):
pip install -e .
  • To install the full set of extras (summarize / research / benchmark / website), README suggests using:
pip install -e ".[all]"

(Note: all does not include translator; translator must be installed separately, see below)

C. Configuration (Must Read)

  • The config.example.json at the repository root is an example; tools actually read config.json (repo root), and this file is gitignored. README suggests: Copy the example to config.json and modify as needed.
    • Operation example (README indicates this file exists but does not provide the exact command; the following are common steps):
cp config.example.json config.json
# Windows PowerShell 可用复制命令:Copy-Item config.example.json config.json
  • The tokens/ directory saves API keys and onboarding forms (tokens/onboard.yaml); this directory is gitignored. Do not commit its contents.
  • Available environment variables (mentioned in README):
    • GADGET_CONFIG —— Overrides the configuration file path (tools read the repo-root config.json; set this variable if an override is needed)
    • GADGET_LLM_BACKEND —— Globally switches the LLM backend (equivalent to command line --api)
    • GADGET_TRANSLATION_BACKEND / GADGET_TRANSLATION_MODEL —— Controls the translation backend and model (used for translator / website translation)

D. General Operations Scripts

  • Data synchronization (rclone required):
python scripts/sync.py
# cross-device push/pull(README 指出可用 push/pull,例如)
python scripts/sync.py push
python scripts/sync.py pull
  • One-time machine configuration (onboarding):
python scripts/onboard.py

(README: Fill in tokens/onboard.yaml and run the script once to complete configuration)

  • Read-only smoke check (no LLM/network/write operations):
bash scripts/smoke.sh
  • Local LLM service (generates an Ollama variant optimized for summarize and prints env), README provides:
eval "$(bash scripts/serve_local_llm.sh env)"

(This command is used in Unix-like/bash environments; README contains this example)

E. outputs/ Directory Description (Where to find and what it’s for)

  • All generated artifacts are written to outputs/ under the repository root:
    • outputs/logs/ — Intermediate products (export logs, runtime logs)
    • outputs/reports/ — Final reports (Markdown, JSON, HTML)
    • outputs/cache/ — LLM / Search cache
    • outputs/data/ — Structured data (CSV/JSON)
    • outputs/images/ — Charts and generated images
    • outputs/backups/ — Forced overwrite backups
  • Note: Hugo content is written directly to tools/website/content|static (not outputs/site)

F. Typical Usage of Each Tool (Commands that can be copied and run directly; all from README)

  1. Summarize (AI session daily/weekly/monthly summaries)
  • Recommended entry point (new format, README recommends using python -m summarize):
python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy
python -m summarize auto --deploy
  • Key points (all from README):
    • Phase 1: daily export exports unexported dates
    • Phase 2: daily merge merge (--sync-all can sync all dates)
    • weekly generate and monthly generate support separate generation and can be published via --deploy
    • auto --deploy is the “one-click” full pipeline: export → merge → weekly → monthly + deploy
    • LLM backend is switched via --api (ollama is default; also claude_cli / anthropic / openai)
    • README notes that the old entry point is still available (backward compatible): python tools/summarize/daily_summary.py ... (but -m summarize is recommended)
  1. Research (Paper discovery and researcher analysis)
  • Unified CLI (README specifies script path and example commands):
python tools/research/research_scout.py report --project my-project
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
python tools/research/research_scout.py profile "Sergey Levine"
python tools/research/research_scout.py citations 2301.12597
python tools/research/research_scout.py deploy
  • Key points:
    • report: Full pipeline (search → three-stage evaluation → report generation)
    • ask: Natural language search (automatically routes to appropriate sources)
    • profile: Researcher profiling
    • citations: Citation graph (can use arXiv ID / DOI)
    • LLM backend is switched via --api (same as summarize)
  1. Benchmark (Performance benchmarks)
  • First switch to the benchmark directory (explicitly required by README):
cd tools/benchmark
python -m benchmark.cli
python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only
python -m benchmark.cli --report
python -m benchmark.cli --report --deploy
  • Key points:
    • python -m benchmark.cli runs all benchmarks (results appended to CSV)
    • --cpu-only / --gpu-only restrict the execution range respectively
    • --report generates HTML reports (can be added to --deploy for Hugo publication)
    • README mentions automatic detection of CUDA / MPS / Intel XPU, etc. (no extra commands)
  1. Website (Hugo blog)
  • Install website-related dependencies:
pip install -e ".[website]"
  • Execute update and build on macOS / Linux (provided by README):
cd tools/website && bash update.sh
  • Execute PowerShell script on Windows (noted by README):
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
  • Local preview (Hugo dev server):
cd tools/website && hugo server -D
  • Key points:
    • update.sh implements incremental compression (only processes media changed since .last_build), builds, and pushes tools/website/public/ (this is a separate deployment repo)
    • tools/website/public/ should not be committed manually; the script will automatically commit + push
    • Local translation and model: Defaults to Ollama; the local model tencent/Hy-MT2-1.8B will be automatically downloaded on the first run (as explained in README)
  1. Translator (Gradio document translation)
  • Install translator dependencies (separate installation):
pip install -e ".[translator]"
  • Start Gradio GUI:
python -m translator
  • Key points (README):
    • The translator uses common.engine.create_engine() to automatically select the backend (ollama preferred; Linux prefers vLLM; Windows falls back to transformers; llamacpp is an option for low VRAM)
    • Default model tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded on first run
    • Supports file types .md/.txt/.pdf/.docx/图片 and protects code blocks / URLs / Hugo shortcodes
    • Default model can be overridden via the GADGET_TRANSLATION_MODEL environment variable (README mentions the variable name but does not provide example syntax)

G. Other Tips and Constraints (Rules in README)

  • Global LLM backend switch: command line --api or environment variable GADGET_LLM_BACKEND (optional values: ollama (default) / claude_cli / anthropic / openai))
  • Translation backend selection: GADGET_TRANSLATION_BACKEND (ollama default → llamacpp/vllm/transformers etc.)
  • Do not add contents of tokens/, outputs/, build/, gadget.egg-info/, or tools/website/public/ to git (explicitly warned by README)
  • Regarding server one-click onboarding (in sibling repo ai-companion):
bash ../ai-companion/scripts/onboard-server.sh --help

(README states this script is in the ai-companion repository; example command as shown above)H. Quick Example Workflow (Combined)

  • Install full extras (summarize/research/benchmark/website):
pip install -e ".[all]"
  • Install translator (separately) and start translation GUI:
pip install -e ".[translator]"
python -m translator
  • Run summarize full pipeline (example):
python -m summarize daily export
python -m summarize daily merge --sync-all
python -m summarize weekly generate --week 2026-W12 --deploy
  • Run benchmark and generate report:
cd tools/benchmark
python -m benchmark.cli --report --deploy
  • Build and publish website (macOS / Linux):
pip install -e ".[website]"
cd tools/website && bash update.sh

I. Common Security / Operational Notes (from README)

  • Keys and sensitive onboarding forms are stored in tokens/, which is gitignored; never commit them.
  • All auto-generated files are centralized in outputs/, which is gitignored.
  • Never manually commit changes to tools/website/public/ (scripts will handle this automatically during build).
  • GPU benchmark will automatically detect CUDA/MPS/XPU (no extra commands needed).
  • If you need to override the default configuration file path, set the GADGET_CONFIG environment variable to point to your config file (README specifies the variable name).

If needed, I can:

  • Provide more detailed step-by-step operational instructions for each tool based on the tool documentation in the README (such as tools/summarize/tutorial.md, tools/research/TUTORIAL.md, tools/benchmark/tutorial.md, tools/website/CLAUDE.md, tools/translator/core.py, etc.), or extract and organize the TUTORIAL.md content mentioned in the README into executable steps (but this will require reading these files; currently I am only answering based on the README).
  • Or read the TUTORIAL.md/source files of these tools from the repository now and generate a more detailed step-by-step guide for you (please confirm if you want me to proceed).
kimi-k3-high — 6,354 chars · 15/16 facts

I. Project Summary

What is this

Gadget is a collection of daily tools for an individual developer, written in Python. The author has accumulated practical tools used repeatedly in daily development into a single repository, covering five major scenarios: AI conversation daily/weekly/monthly report generation, academic paper discovery and analysis, hardware performance benchmarking, Hugo blog automation, and document translation.

Core design philosophy:

  • Each directory under tools/ is an independent tool that can be used separately;
  • All tools share the common/ infrastructure package in the root directory (LLM calls, JSON parsing, disk caching, atomic writes, translation engine, Hugo deployment), installed via pip install -e .;
  • LLM backends are unified and switched via the --api parameter, with four choices: ollama (default, local, no key required), claude_cli (reuses Claude Code login state), anthropic, and openai;
  • All outputs are unified into outputs/ (gitignored), and configurations are unified in the root directory config.json.

Repository Structure

gadget/
├── tools/              # 五个独立工具
│   ├── summarize/      # AI 对话日报/周报/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客(增量压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM/缓存/IO/翻译/Hugo)
├── scripts/            # 运维脚本(sync.py、onboard.py 等)
├── docs/               # 设计文档、ECL 计划、审计报告
├── outputs/            # 所有生成产物(gitignored)
├── AGENTS.md           # AI agent 工作协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common/ + 各工具的打包配置

What each tool does

Tool Function
summarize Reads AI conversation logs from Claude Code / Codex / Cursor / ChatGPT, etc., and calls LLMs to generate structured daily, weekly, and monthly reports. Multi-device two-stage architecture: export from each device → sync and aggregate via cloud drive → merge and generate. Uses ccusage 20.x to statistics token usage and costs for various agent CLIs
research A unified academic research tool. A single entry point research_scout.py provides four capabilities: ① Paper discovery (arXiv/bioRxiv/PubMed, three-stage LLM pipeline: rapid screening → deep evaluation → citation impact); ② Deep paper insights (--insight, full-text download + writing structure analysis + OpenReview comment matching); ③ Researcher profiling (paper/citation data + research trajectory analysis + teacher-student relationship discovery); ④ Citation graph analysis (Semantic Scholar API)
benchmark Cross-platform CPU/GPU FLOPS benchmarking, supporting NVIDIA CUDA, Apple MPS, and Intel XPU, covering FP64/FP32/FP16/BF16/FP8 (experimental) precision. Statistical method: warmup + formal measurement + median/IQR outlier removal + explicit GPU synchronization. Results are appended to CSV, and Plotly interactive HTML reports and leaderboards can be generated
website Hugo static blog (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages. Built-in incremental media compression (pngquant for images, HandBrakeCLI for video, only processing files changed after .last_build) and local model bilingual translation. Each tool’s deployment pipeline writes directly to `tools/website/content
translator A Gradio-based document translation web app, providing a Google Translate-like experience. Supports text and .md/.txt/.pdf/.docx/images, while protecting Markdown formatting (code blocks, URLs, Hugo shortcodes). Pure local inference, default model tencent/Hy-MT2-1.8B, with the model residing in memory

II. Beginner’s Tutorial

1. Environment Preparation

Required basic environment (from the “Environment Requirements” section of the README):

  • Python 3.10+, recommended to use conda environment AI:
conda activate AI
  • Node.js 18+ (only required if you want to use the optional Companion graph / DAG publishing tools)
  • rclone (only if cross-device data synchronization is needed)
  • Specific dependencies for each tool can be found in their respective requirements.txt directories

2. Installation

After cloning the repository, execute in the root directory:

# 安装 common 包 + summarize / research / benchmark / website 全部 extras
pip install -e ".[all]"

Note: all does not include translator; the translator must be installed separately:

pip install -e ".[translator]"

If you only use a single tool, you can install just the corresponding extra, for example, only website:

pip install -e ".[website]"

After installation, you can use a read-only smoke test to verify each tool’s availability (no LLM calls, no internet access, no file writing):

bash scripts/smoke.sh

3. Configuration

  • Configuration Files: Copy the template to generate root directory configurations (gitignored):
cp config.example.json config.json

You can use the GADGET_CONFIG environment variable to specify other paths.

  • API Keys: Place them in the tokens/ directory (gitignored, never commit).
  • One-click Initialization for New Machines: Fill out one form in tokens/onboard.yaml, then run once:
python scripts/onboard.py

It will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone guidance.

  • LLM Backend Selection: All tools use --api to switch LLM functions: ollama (default, local Ollama, no key required, Gemma4-26B), claude_cli (no API key required), anthropic, and openai; you can also use the GADGET_LLM_BACKEND environment variable for global specification.

4. Typical Usage for Each Tool

4.1 Summarize — AI Conversation Daily/Weekly/Monthly Reports

python -m summarize daily export                                   # 阶段 1:导出所有未导出的日期
python -m summarize daily merge --sync-all                         # 阶段 2:同步所有日期并逐日合并
python -m summarize weekly generate --week 2026-W12 --deploy       # 周报 + 部署
python -m summarize monthly generate --month 2026-02 --deploy      # 月报 + 部署
python -m summarize auto --deploy                                  # 一键全流程:导出 → 合并 → 周报 → 月报 + 部署

Old entry points like python tools/summarize/daily_summary.py ... are still available (backward compatible), but the python -m summarize format above is recommended.

Optional: Start a local Ollama variant optimized for summarize:

eval "$(bash scripts/serve_local_llm.sh env)"

4.2 Research — Paper Discovery and Researcher Analysis

python tools/research/research_scout.py report --project my-project        # 完整流水线:搜索 → 三阶段评估 → 报告
python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"  # 自然语言搜索(自动路由来源)
python tools/research/research_scout.py profile "Sergey Levine"             # 研究者画像
python tools/research/research_scout.py citations 2301.12597               # 引用图谱(支持 arXiv ID / DOI)
python tools/research/research_scout.py deploy                              # 部署报告到 Hugo

All LLM functions can use --api to switch backends (ollama / claude_cli / anthropic / openai).

4.3 Benchmark — Performance Benchmarking

Note: All commands must first be cd to tools/benchmark/:

cd tools/benchmark
python -m benchmark.cli                # 跑全部基准测试(结果追加到 CSV)
python -m benchmark.cli --cpu-only     # 只测 CPU
python -m benchmark.cli --gpu-only     # 只测 GPU
python -m benchmark.cli --report       # 测试 + 生成 HTML 报告
python -m benchmark.cli --report --deploy  # 生成报告 + 发布到 Hugo /benchmark/

GPU will automatically detect CUDA / Apple MPS / Intel XPU.

4.4 Website — Hugo Blog

pip install -e ".[website]"                          # 安装依赖(含翻译用的 torch + transformers)
cd tools/website && bash update.sh                   # macOS/Linux:增量压缩 + Hugo 构建 + 推送 Pages
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1  # Windows(脚本会自己 cd)
cd tools/website && hugo server -D                   # 本地预览(开发服务器,含草稿)

The translation model tencent/Hy-MT2-1.8B will be automatically downloaded upon the first run. tools/website/public/ is an independent deployment repository, which is automatically committed and pushed by build scripts; do not commit to it manually.

4.5 Translator — Document Translator

pip install -e ".[translator]"   # 安装依赖(gradio + GGUF 翻译栈)
python -m translator             # 启动 Gradio 界面(自动在浏览器打开)
  • Default model is tencent/Hy-MT2-1.8B, downloaded automatically on first use; you can switch via the GADGET_TRANSLATION_MODEL environment variable or within the GUI.
  • Source language can be set to auto (detected by CJK ratio), and when the target language is auto, it will automatically flip between Chinese and English.
  • Translation backend is specified by GADGET_TRANSLATION_BACKEND: ollama (default) → llamacpp/vllm/transformers.

5. Data Synchronization and Output Locations

Cross-device data synchronization (requires rclone configuration, configured in the sync section of the root directory config.json):

python scripts/sync.py            # 查看用法
python scripts/sync.py push       # 推送
python scripts/sync.py pull       # 拉取

All generated items (logs, reports, cache, structured data, charts, backups) are under outputs/, all of which are gitignored and can be automatically rebuilt if deleted.

6. Common Precautions

  • Never git add auto-generated content, rclone synchronized data, build artifacts (build/, gadget.egg-info/), or the deployment/theme repositories under tools/website/.
  • The tokens/ directory stores keys; never commit them.
  • License: GPL-3.

For more detailed step-by-step operations, data formats, and FAQs, the README points to TUTORIAL.md as well as the source documentation in each tool’s directory (such as tools/summarize/tutorial.md, tools/research/TUTORIAL.md, etc.). This tutorial only covers content appearing in the README.

kimi-k2.7-code — 5,907 chars · 15/16 facts

Based on the README content, organized as follows:

I. Project Summary

Gadget is a repository of personal development toolsets, collecting practical tools accumulated during daily development, covering scenarios such as AI conversation summarization, paper discovery, performance testing, blog automation, and document translation.

Repository Structure

Directory Role
tools/ 5 independent tools, each subdirectory can be used separately
tools/summarize/ AI conversation daily/weekly/monthly report generation
tools/research/ Paper discovery, researcher analysis, citation networks
tools/benchmark/ CPU/GPU performance benchmarking
tools/website/ Hugo static blog (incremental compression + automatic build and publish)
tools/translator/ Gradio document translator
common/ Public base package (LLM calls, cache, IO, translation, Hugo deployment), installed via pip install -e .
scripts/ Operations scripts (data synchronization, machine initialization, smoke testing, etc.)
docs/ Design documents, ECL plans, audit reports, historical archives
outputs/ All generated artifacts (gitignored, can be automatically rebuilt)
AGENTS.md AI agent workflow protocol
CLAUDE.md Claude Code repository guide
pyproject.toml Package configuration

Responsibilities of Each Tool

  • summarize: Reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM to generate structured daily, weekly, and monthly reports. Supports a two-stage workflow across multiple devices and tracks token consumption and costs for each CLI via ccusage.
  • research: A unified academic research toolkit providing four major functions: paper discovery, deep paper insights, researcher profiling, and citation network analysis, with the entry point being tools/research/research_scout.py.
  • benchmark: A cross-platform CPU/GPU FLOPS performance testing tool, supporting NVIDIA CUDA, Apple MPS, and Intel XPU, covering precisions such as FP64/FP32/FP16/BF16/FP8, and generating CSV cumulative results and interactive HTML reports.
  • website: A static blog “TzJ’s Net” based on Hugo + PaperMod theme, deployed to https://tzj2006.github.io/. Built-in incremental image/video compression (pngquant, HandBrakeCLI) and local model bilingual translation.
  • translator: A Gradio document translator based on the common translation engine, supporting text and file translation while preserving Markdown format, defaulting to the local model tencent/Hy-MT2-1.8B.

II. Detailed Tutorial (For Beginners)

1. Environment Preparation

  • Python 3.10+
  • Recommended to use conda environment AI: conda activate AI
  • Node.js 18+ (only for optional Companion charts and DAG publishing tools)
  • Some tools require additional system dependencies:
    • Hugo (website tool)
    • pngquant, HandBrakeCLI (website media compression)
    • rclone (data synchronization)
    • Ollama (default backend for local LLM)

2. Installation

Install public package and all tool dependencies (excluding translator)

pip install -e ".[all]"

all does not include translator, which must be installed separately.

Install translator dependencies

pip install -e ".[translator]"

Install website dependencies (includes torch + transformers)

pip install -e ".[website]"

3. Configuration

Basic Configuration Files

Copy example configurations:

cp config.example.json config.json

config.json is gitignored; other paths can be specified via environment variables:

export GADGET_CONFIG=/path/to/config.json

API Key / Token Directory

tokens/
  • Stores API keys and onboarding forms
  • This directory is gitignored, do not commit

One-click Initialization for New Machines

Run after filling out tokens/onboard.yaml:

python scripts/onboard.py

This script will automatically complete: SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone guidance.

Local LLM Service (summarize optimized Ollama version)

eval "$(bash scripts/serve_local_llm.sh env)"

Persistent parameters are written in the summarize section of config.json.


4. Typical Usage for Each Tool

The following commands are directly extracted from the README and can be copied for use.

4.1 Summarize — AI Conversation Summarization

Two-stage daily workflow:

# 第一阶段:导出所有未导出日期的对话
python -m summarize daily export

# 第二阶段:同步所有日期并逐日合并
python -m summarize daily merge --sync-all

Generate weekly/monthly reports and deploy:

python -m summarize weekly generate --week 2026-W12 --deploy
python -m summarize monthly generate --month 2026-02 --deploy

One-click full pipeline (Export → Merge → Weekly Report → Monthly Report + Deploy):

python -m summarize auto --deploy

Old entry points are still compatible:

python tools/summarize/daily_summary.py ...
python tools/summarize/weekly_summary.py ...
python tools/summarize/monthly_summary.py ...

Switch LLM backend: All LLM-related commands support --api, options include:

  • ollama (default, local Ollama, no API key required, uses Gemma4-26B)
  • claude_cli (reuses Claude Code CLI login state, no API key required)
  • anthropic
  • openai

For example:

python -m summarize auto --deploy --api openai

Can also be set via global environment variables:

export GADGET_LLM_BACKEND=openai

4.2 Research — Academic Research and Paper Discovery

Entry script:

python tools/research/research_scout.py

Full paper discovery pipeline (Search → Three-stage evaluation → Generate report):

python tools/research/research_scout.py report --project my-project

Natural language search:

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Researcher profiling:

python tools/research/research_scout.py profile "Sergey Levine"

Citation network analysis:

python tools/research/research_scout.py citations 2301.12597

Deploy report to Hugo:

python tools/research/research_scout.py deploy

Switch LLM backend:

python tools/research/research_scout.py report --project my-project --api claude_cli

4.3 Benchmark — Performance Benchmarking

Note: All benchmark commands require entering the tools/benchmark/ directory first.

cd tools/benchmark

Run all benchmarks:

python -m benchmark.cli

CPU only:

python -m benchmark.cli --cpu-only

GPU only:

python -m benchmark.cli --gpu-only

Run tests and generate HTML report:

python -m benchmark.cli --report

Generate report and publish to Hugo /benchmark/:

python -m benchmark.cli --report --deploy

4.4 Website — Hugo Blog

Install dependencies:

pip install -e ".[website]"

macOS/Linux: Incremental compression + Hugo build + Push to GitHub Pages

cd tools/website && bash update.sh

Windows:

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (development server, including drafts):

cd tools/website && hugo server -D

4.5 Translator — Gradio Document Translator

Install dependencies:

pip install -e ".[translator]"

Start Gradio interface:

python -m translator

5. Data Synchronization

Use rclone to synchronize data between different devices:

python scripts/sync.py push
python scripts/sync.py pull
python scripts/sync.py status

Configuration is located in the sync section of config.json.


6. Other Useful Scripts

# 只读冒烟测试(检查 --help、--info、imports;不调用 LLM、不联网、不写文件)
bash scripts/smoke.sh

# 启动 summarize 调优版 Ollama 并打印环境变量
eval "$(bash scripts/serve_local_llm.sh env)"

# 双语内容审计 + summarize 报告重命名
python scripts/language.py

# 翻译引擎 GPU 性能分析
python scripts/profile_translation.py

7. Important Notes

  1. Do not commit automatically generated content: Including outputs/, build/, gadget.egg-info/, rclone synchronized data, and deployment/theme repositories under tools/website/.
  2. Translation backend selection: Controlled via GADGET_TRANSLATION_BACKEND, options include ollama (default, gemma4:26b) → llamacpp / vllm / transformers (using tencent/Hy-MT2-1.8B).
  3. Unified LLM backend switching: Via the --api parameter or GADGET_LLM_BACKEND environment variable.
  4. tools/website/public/ is an independently deployed repository (tzj2006/tzj2006.github.io), automatically committed and pushed by build scripts; do not commit code directly to it.
  5. AI Companion is optional, located in the sibling directory ../ai-companion/, and will not be automatically installed.
glm-5.2-high — 10,360 chars · 16/16 facts

I. Project Summary

1. What is it

Gadgets is a collection of practical tools accumulated by a developer during daily work, covering five major scenarios:

  • AI conversation daily/weekly/monthly report generation (Summarize)
  • Paper discovery and researcher analysis (Research)
  • CPU/GPU performance benchmarking (Benchmark)
  • Hugo blog automation (Website)
  • Document translation (Translator)

There are several key design features:- Each subdirectory under tools/ is a standalone tool

  • common/ is the shared infrastructure package for all tools (LLM calls, JSON parsing, disk caching, atomic writes, translation, Hugo deployment), installed via pip install -e .
  • All LLM functions are unified through the --api parameter to switch between four backends: ollama (default, local without key), claude_cli (reuses Claude Code CLI login state), anthropic, openai
  • All generated outputs are unified to outputs/ (already gitignored)
  • Configurations are unified in config.json at the repository root (gitignored, copied from config.example.json), with paths that can be overridden using GADGET_CONFIG
  • License: GPL-3

2. Repository Structure

gadget/
├── tools/              # 五个独立工具产品(改工具就改这里)
│   ├── summarize/      # AI 对话日/周/月报
│   ├── research/       # 论文发现 + 研究者分析 + 引用图
│   ├── benchmark/      # CPU/GPU 性能基准
│   ├── website/        # Hugo 博客(增量媒体压缩 + 自动构建发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包(LLM/缓存/IO/翻译/Hugo)
├── scripts/            # 运维与维护脚本(sync.py, onboard.py 等)
├── docs/               # 设计文档、ECL 计划、审计报告、历史归档
├── outputs/            # 所有生成产物(gitignored)
├── AGENTS.md           # AI agent 工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # common + 各工具的打包配置

Sub-classifications within the output directory outputs/:

outputs/
├── logs/      # 中间日志
├── reports/   # 最终报告(Markdown/JSON/HTML)
├── cache/     # LLM 缓存、搜索缓存
├── data/      # 结构化数据(CSV、JSON profile)
├── images/    # 图表与生成图片
└── backups/   # 强制覆盖备份

Note: Hugo site content is written directly to tools/website/content|static; no outputs/site staging directory exists.

3. What Each Tool Does

Summarize — AI Daily/Weekly/Monthly Reports

Automatically reads daily AI conversation logs (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON) and calls LLMs to generate structured daily/weekly/monthly summaries.

  • Multi-device Two-stage Architecture: Export conversation logs from various devices → aggregate via cloud drive sync or manual copy → generate daily reports → accumulate to generate weekly reports and monthly trends
  • Automatically discovers and statistics token usage and costs for each agent CLI via the namespace-by-source command in ccusage 20.x (ccusage claude, ccusage codex, ccusage gemini…)
  • Four LLM backends are switched via --api: ollama (default, local Gemma4-26B), claude_cli, anthropic, openai

Research — Paper Discovery and Researcher Analysis

Provides four major capabilities through a single CLI entry point tools/research/research_scout.py:

  • Paper Discovery: Searches arXiv / bioRxiv / PubMed, generates research weekly reports deployed to Hugo via a three-stage LLM pipeline (fast screening → deep evaluation → citation impact); supports conference paper and author searches
  • Deep Paper Insights (--insight): Downloads full papers, lets LLMs analyze writing structure, publication strategies, and reusable core knowledge; automatically matches OpenReview to obtain reviews and analyze consensus vs. controversy; synthesizes cross-paper scientific writing guides
  • Researcher Profiling: Scrapes paper and citation data from arXiv + Semantic Scholar, uses LLM to generate research trajectory analysis, calculates tier scores, and automatically discovers mentor–student relationships via homepage extraction + co-authorship patterns; supports name disambiguation and reverse lookup
  • Citation Graph Analysis: Forward citation / backward reference analysis based on Semantic Scholar API, paired with LLM-driven impact interpretation

Benchmark — Performance Benchmark Suite

A cross-platform CPU/GPU FLOPS benchmarking tool that uniformly measures floating-point performance across different hardware vendors and precision levels.

  • Supports real runs on NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU) (OpenCL only appears in --info detection)
  • Precision coverage: FP64 / FP32 / FP16 / BF16 / FP8 (experimental)
  • Measurement process: Warmup + formal measurement + statistical analysis (median, IQR outlier removal) + explicit GPU synchronization
  • Results are accumulated in CSV in append mode (never overwritten, naturally supporting multi-hardware cumulative leaderboards)
  • Can generate Plotly interactive HTML reports and leaderboards, supporting deployment to Hugo sites / submission to public leaderboards

Website — Hugo Blog

A Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages (https://tzj2006.github.io/).

  • Built-in incremental image/video compression pipeline (only compresses media changed since .last_build; images use pngquant, videos use HandBrakeCLI)
  • Local model bilingual translation (default Ollama; uses vLLM for Linux / transformers as fallback for Windows; model tencent/Hy-MT2-1.8B is automatically downloaded on first run, no cloud LLM API used)
  • Automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) is written directly by the deployment pipeline to tools/website/content|static (single Hugo content root, files marked with gadget_generated; unmarked handwritten files are never overwritten)
  • tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), automatically committed and pushed by build scripts; do not commit it directly

Translator — Gradio Document Translator

A Gradio document translator built on the common translation engine: a Google-Translate style local translation web interface.

  • Translates text and files (.md / .txt / .pdf / .docx / images), preserving Markdown format (code blocks, URLs, Hugo shortcodes, etc., are protected)
  • Local inference without cloud APIs: reuses common.engine.create_engine() to automatically select backends (ollama preferred; transformers as Windows fallback; vllm as Linux preference; llamacpp as low-VRAM GGUF option)
  • Models stay in memory (warm), with on-demand lazy loading when switching models
  • Default model is tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF), automatically downloaded on first use; can be overridden via GADGET_TRANSLATION_MODEL or the GUI’s model management
  • Source language can be set to auto (detected by CJK ratio); when target is auto, it flips between zh↔en

common/ — Shared Infrastructure Package

The shared layer that all tools depend on, installed as a Python package via pip install -e .:

  • LLM calls (unified two-layer API, supporting four backends: ollama (default) / claude_cli / anthropic / openai)
  • JSON parsing and repair
  • SHA-256 disk caching (namespace + TTL)
  • Atomic writes and content hashing
  • Local inference translation engine (Ollama / vLLM / transformers / GGUF) and bilingual content generation
  • Cross-platform Hugo deployment

scripts/ — Operations and Maintenance Scripts

  • sync.py — Centralized rclone data synchronization (push / pull / status / bootstrap / config, covering summarize / website / research / benchmark / backups categories; also includes a special dag category for generating + deploying DAG sites). Configuration is in the sync section of the repository root’s config.json
  • onboard.py — Repository-level one-time machine configuration: fill out a tokens/onboard.yaml, run the script once, and it automatically completes SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap
  • smoke.sh — A read-only smoke test spanning all tools (--help / --info / imports; no LLM calls, no internet, no file writing)
  • serve_local_llm.sh — Creates an Ollama variant optimized for summarize and prints env (eval "$(bash scripts/serve_local_llm.sh env)"); persistence knobs are in the summarize section of config.json
  • Others: language.py (Hugo bilingual audit + summarize report renaming), profile_translation.py (translation engine GPU profiler)

AI Companion — Optional Tool

The sibling repository ../ai-companion/ provides DAG publishing tools, used by scripts/sync.py --category dag. This repository does not have Companion interception hooks; onboarding will not install Companion. Old install.ai_companion settings are ignored.


II. Detailed Tutorial (For Beginners)

1. Environment Preparation

1.1 Basic Environment

  • Python 3.10+ (recommended to use conda environment AI)
  • Node.js 18+ (only for optional Companion graphs and DAG publishing tools)
  • The requirements.txt in each tool directory lists the specific dependencies for that tool

1.2 Create and Activate conda Environment

conda create -n AI python=3.10
conda activate AI

1.3 Configuration File Preparation

Tool configurations are unified in config.json at the repository root (already gitignored). Copy from example files:

cp config.example.json config.json

To specify other paths, set environment variables:

# Linux/macOS
export GADGET_CONFIG=/path/to/your/config.json
# Windows PowerShell
$env:GADGET_CONFIG = "C:\path\to\your\config.json"

1.4 Global LLM Backend Configuration (Optional)

Globally specify the backend via the GADGET_LLM_BACKEND environment variable. Optional values: ollama (default), claude_cli, anthropic, openai.

export GADGET_LLM_BACKEND=ollama

1.5 Global Translation Backend Configuration (Optional)

Specified via GADGET_TRANSLATION_BACKEND, default is ollama, options include llamacpp / vllm / transformers.

export GADGET_TRANSLATION_BACKEND=ollama

2. Installation

2.1 Install common package + most tool extras

pip install -e ".[all]"

Note: [all] does not include translator; translator must be installed separately.

2.2 Install translator dependencies separately

pip install -e ".[translator]"

2.3 Install website dependencies separately (includes torch + transformers for translation)```bash

pip install -e “.[website]”


### 2.4 One-time Machine Configuration (Optional but Recommended)

Run after filling in `tokens/onboard.yaml`:

```bash
python scripts/onboard.py

It will automatically complete: SSH configuration, Claude/Codex CLI installation and authentication, pip extras installation, tool configurations, and rclone bootstrap.

Note: The tokens/ directory saves API keys and onboarding tables; it is already gitignored, do not commit its contents.

2.5 Server-level System Installation (Ubuntu 22.04/24.04 Servers Only)

This script has been migrated to the ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help

3. Typical Usage of Each Tool

3.1 Summarize — AI Conversation Reports

The python -m summarize format is recommended (old entries like python tools/summarize/daily_summary.py are still available as backward-compatible re-export shims).

Two-stage daily workflow:

# 阶段 1:导出所有未导出的日期
python -m summarize daily export

# 阶段 2:同步所有日期并按天合并
python -m summarize daily merge --sync-all

Weekly and Monthly Reports:

# 生成周报并部署
python -m summarize weekly generate --week 2026-W12 --deploy

# 生成月报并部署
python -m summarize monthly generate --month 2026-02 --deploy

One-click full pipeline:

# 导出 → 合并 → 周报 → 月报 + 部署
python -m summarize auto --deploy

Example of switching LLM backends:

python -m summarize daily merge --sync-all --api anthropic

3.2 Research — Paper and Researcher Analysis

Entry point: tools/research/research_scout.py.

Full pipeline research report generation:

python tools/research/research_scout.py report --project my-project

Natural Language Search (automatic source routing):

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

Researcher Profiling:

python tools/research/research_scout.py profile "Sergey Levine"

Citation Graph Analysis (by arXiv ID / DOI):

python tools/research/research_scout.py citations 2301.12597

Deploy Report to Hugo:

python tools/research/research_scout.py deploy

Example of switching LLM backends:

python tools/research/research_scout.py report --project my-project --api openai

3.3 Benchmark — Performance Benchmarking

Note: All benchmark commands must first cd enter tools/benchmark/.

cd tools/benchmark

# 跑全部基准(结果 append 到 CSV)
python -m benchmark.cli

# 仅 CPU
python -m benchmark.cli --cpu-only

# 仅 GPU
python -m benchmark.cli --gpu-only

# 跑基准 + 生成 HTML 报告
python -m benchmark.cli --report

# 生成报告 + 发布到 Hugo /benchmark/
python -m benchmark.cli --report --deploy

3.4 Website — Hugo Blog

Install dependencies (including torch + transformers for translation):

pip install -e ".[website]"

macOS/Linux one-click build and release (incremental compression + Hugo build + push Pages):

cd tools/website && bash update.sh

Windows (the script will automatically cd to its own directory):

powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

Local preview (development server, including drafts):

cd tools/website && hugo server -D

Important Reminder: tools/website/public/ is an independent deployment repository (tzj2006/tzj2006.github.io), which is automatically committed and pushed by the build script; do not commit it directly.

3.5 Translator — Gradio Document Translator

Install dependencies:

pip install -e ".[translator]"

Start Gradio GUI (browser will open automatically):

python -m translator

Optional: Override default translation models via environment variables:

export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF

4. Operations and Maintenance Scripts

4.1 Data Synchronization (requires rclone configuration first)

python scripts/sync.py            # 默认行为
python scripts/sync.py push       # 推送
python scripts/sync.py pull       # 拉取
python scripts/sync.py --category dag   # 生成 + 部署 DAG 站点

4.2 Read-only Smoke Test (no LLM calls, no internet, no file writing)

bash scripts/smoke.sh

4.3 Start Local LLM (Ollama variant optimized for summarize)

eval "$(bash scripts/serve_local_llm.sh env)"

4.4 One-time Machine Configuration

After filling in tokens/onboard.yaml:

python scripts/onboard.py

5. Important Notes

  • GPU benchmark automatically detects CUDA / Apple MPS## 5. Important Notes (Continued)

  • GPU benchmark automatic detection of CUDA / Apple MPS / Intel XPU

  • tokens/ directory saves API keys and onboarding tables; it is already gitignored, do not commit its contents

  • All generated files are output to the outputs/ directory, which is gitignored

  • LLM backend switching is unified via the --api parameter: ollama (default), claude_cli, anthropic, openai (or global environment variable GADGET_LLM_BACKEND)

  • Translation path uses the local inference engine selected by GADGET_TRANSLATION_BACKEND: ollama (default, reuses chat tag gemma4:26b) → llamacpp/vllm/transformers (in-process, model tencent/Hy-MT2-1.8B)

  • Cross-device data synchronization uses python scripts/sync.py push/pull (requires rclone configuration first)

  • Do not git add: auto-generated content, rclone synced data, build artifacts (build/, gadget.egg-info/), and deployment/theme repositories under tools/website/

  • Tool configurations are placed in the repository root config.json (gitignored, copied from config.example.json), use GADGET_CONFIG to override paths

  • License: GPL-3 (see LICENSE)


The above is a complete Chinese summary and beginner’s tutorial based on the README. For step-by-step details for each tool, data formats, or FAQ, the README points to TUTORIAL.md and the tutorial.md / CLAUDE.md within each tool’s source directory for in-depth reading.

Tip: Currently in Ask mode; the above content is for informational purposes only and has not made any modifications to the system. If you need me to help execute installation, configuration, or run a specific tool, please switch to Agent mode.

Local Ollama

Gemma4 26B — 3,442 chars · 12/16 facts

1. Project Summary

Gadgets is a practical toolkit accumulated through daily development, designed to automate repetitive tasks in development, research, and content publishing using AI capabilities. It not only contains multiple independent tools but also builds a complete automated workflow through a core shared package (common).

Repository Structure

  • tools/: Core tools directory, containing five independent tool products. Each tool can run independently.
  • common/: Shared infrastructure package. Provides unified underlying capabilities for all tools, such as LLM calls, JSON parsing, disk caching, atomic writes, translation engines, and Hugo deployment functionality.
  • scripts/: Operations and maintenance scripts used for data synchronization, new machine initialization configuration, etc.
  • outputs/: Storage for all generated artifacts (reports, caches, logs, data, etc.).
  • docs/: Design documents and archives.
  • ai-companion/ (External Repository): A sibling directory linked via hooks, responsible for providing the development workflow engine (planning/execution/change tracking) and all Claude Code related skills.

Tool Functionality Overview

  1. Summarize: AI conversation summarization tool. Automatically reads AI conversation records from different devices (Claude/ChatGPT, etc.) to generate daily/weekly/monthly reports.
  2. Research: Academic research tool. Supports paper discovery, deep paper insights (analyzing writing structure/OpenReview comments), researcher profiling, and citation graph analysis.
  3. Benchmark: Performance testing suite. Cross-platform (NVIDIA/Apple/Intel) CPU/GPU floating-point operation performance testing.
  4. Website: Hugo blog management. Includes automatic media compression, bilingual translation, and automated build and release processes.
  5. Translator: Document translator. A Gradio-based local translation web interface that supports translating documents, images, and files while maintaining Markdown formatting.

2. Tutorial

This tutorial is intended for users encountering Gadgets for the first time.

I. Environment Preparation

Before starting, please ensure your system has the following environments installed:

  • Python 3.10+ (It is recommended to use Conda to manage environments, e.g., conda activate AI)
  • Node.js 18+ (Primarily for the associated ai-companion repository)
  • Ollama (Recommended, for running LLMs locally)

II. Installation and Configuration

  1. Install core package and most tools: Enter the project root directory and run the following command to install the common package and dependencies required by most tools:

    pip install -e ".[all]"
    
  2. Install Translator tool (requires extra installation): Since the translator depends on specific Gradio and model stacks, it must be installed separately:

    pip install -e ".[translator]"
    
  3. Initialize Configuration:

    • The project uses config.json for configuration. Please first copy one from the template:
      cp config.example.json config.json
      
    • One-click configuration for new machines: If you are deploying on a brand-new server, you can use the built-in onboarding script (requires preparing tokens/onboard.yaml first):
      python scripts/onboard.py
      

III. Typical Usage of Tools

1. Summarize (Conversation Summarization)This tool runs through a two-stage workflow: first exporting data, then merging to generate reports.
  • Stage 1: Export unexported dates
    python -m summarize daily export
    
  • Stage 2: Sync and merge by day
    python -m summarize daily merge --sync-all
    
  • Generate weekly/monthly reports and deploy
    python -m summarize weekly generate --week 2026-W12 --deploy
    python -m summarize monthly generate --month 2026-02 --deploy
    
  • One-click full process (Export $\rightarrow$ Merge $\rightarrow$ Weekly Report $\rightarrow$ Monthly Report $\rightarrow$ Deploy)
    python -m summarize auto --deploy
    
  • Tip: You can switch backends via the --api parameter, such as --api ollama or --api openai.
2. Research

Operate using the unified entry point research_scout.py.

  • Execute full research pipeline (Search $\rightarrow$ Evaluate $\rightarrow$ Report)
    python tools/research/research_scout.py report --project my-project
    
  • Search for papers using natural language
    python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
    
  • View researcher profiles
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Analyze paper citation networks (using arXiv ID)
    python tools/research/research_scout.py citations 2301.12597
    
3. Benchmark

Note: Please enter the tool directory before running.

cd tools/benchmark
# 运行所有测试(结果追加至 CSV)
python -m benchmark.cli
# 仅运行 GPU 测试
python -m benchmark.cli --gpu-only
# 运行测试、生成 HTML 报告并发布到 Hugo 网站
python -m benchmark.cli --report --deploy
4. Website
  • Local preview
    cd tools/website && hugo server -D
    
  • Update website (Compress media $\rightarrow$ Build $\rightarrow$ Push to GitHub Pages)
    • macOS/Linux: bash update.sh
    • Windows: powershell -ExecutionPolicy Bypass -File update.ps1
5. Translator
  • Start Gradio GUI
    python -m translator
    
    After starting, open the displayed address in your browser to perform document translation. The tencent/Hy-MT2-1.8B model will be downloaded automatically upon the first run.
Gemma4 12B — 3,465 chars · 14/16 facts

Project Summary

Gadgets is a practical toolkit designed to simplify daily development workflows. It integrates multiple functional modules such as AI assistants, academic research, performance benchmarking, automated blog publishing, and document translation.

Repository Structure

  • tools/: The core functional area of the project, containing 5 independent tools:
    • summarize: Processes AI conversation logs to generate daily/weekly/monthly summary reports.
    • research: Academic research tool, including paper discovery, researcher analysis, and citation networks.
    • benchmark: Cross-platform CPU/GPU performance benchmarking suite.
    • website: Blog system based on Hugo, including automated deployment and media compression.
    • translator: Document translation tool based on Gradio, supporting multiple formats while preserving Markdown formatting.
  • common/: Shared infrastructure package, containing common functions like LLM calls, caching, translation engines, Hugo deployment, etc.
  • scripts/: Operations and maintenance scripts, handling data synchronization, environment initialization, language checks, etc.
  • outputs/: Stores all generated content (logs, reports, cache, etc.), which is not tracked by Git.
  • ai-companion (Independent Repository): Located in the sibling directory, providing development workflows, code change tracking, and a series of AI skills.

Usage Tutorial

This tutorial aims to help beginners get started with the Gadget project quickly.

1. Environment Preparation

Before starting, please ensure your machine meets the following requirements:

  • Python: 3.10+ (recommended to use the Conda environment named AI).
  • Node.js: 18+ (primarily used for the ai-companion module).
  • Basic Dependencies: It is recommended to install the basic rclone tool first (used for data synchronization).

2. Installation and Initialization

After cloning the repository, enter the project root directory and execute the following steps:

Basic Installation (includes core tools and most functions):

pip install -e ".[all]"

If translation functionality is needed (requires additional dependency installation):

pip install -e ".[translator]"

New Machine Initialization (automatic environment configuration): If you are configuring this project on a machine for the first time, you can use the onboarding script:

  1. Fill in onboard.yaml (including API Keys, etc.) in the tokens/ directory.
  2. Run the following command to complete configuration automatically (including SSH, tool configuration, rclone initialization, etc.):
    python scripts/onboard.py
    

3. Core Tool Usage Guide

Each tool can be run independently in its corresponding directory or called through a unified module.

A. AI Conversation Summarization (Summarize)

Used to organize your AI conversation logs (Claude, ChatGPT, etc.) into structured reports.

  • Fully Automated Process (Recommended):
    python -m summarize auto --deploy
    
  • Step-by-step Operations:
    • Export unexported dates: python -m summarize daily export
    • Merge dates: python -m summarize daily merge --sync-all
    • Generate weekly report: python -m summarize weekly generate --week 2026-W12 --deploy
    • Generate monthly report: python -m summarize monthly generate --month 2026-02 --deploy
B. Academic Research (Research)

Provides paper retrieval, in-depth analysis, researcher profiles, and citation network analysis.

  • Start full research process:
    python tools/research/research_scout.py report --project my-project
    
  • Natural language search:
    python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"
    
  • Get researcher profile:
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Analyze citation network of specific literature:
    python tools/research/research_scout.py citations 2301.12597
    
C. Performance Benchmark (Benchmark)

Cross-platform CPU/GPU performance testing. Note: Please enter the corresponding directory before execution.

cd tools/benchmark
# 运行所有基准测试并将结果追加到 CSV
python -m benchmark.cli
# 仅测试 GPU
python -m benchmark.cli --gpu-only
# 运行测试并生成 HTML 报告
python -m benchmark.cli --report
# 生成报告并发布到 Hugo 网站
python -m benchmark.cli --report --deploy
D. Document Translation (Translator)

Starts a Gradio interface for translating various documents (supports .md, .pdf, .docx, etc.).

  • Start translation interface:
    python -m translator
    
E. Blog Sync and Deployment (Website)

Used to manage and update the Hugo blog.

  • Install relevant dependencies: pip install -e ".[website]"
  • Update and push content:
    • Windows: powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
    • Linux/macOS: cd tools/website && bash update.sh
  • Local preview:
    cd tools/website && hugo server -D
    

4. Other Common Operations

  • Data Synchronization: If you operate on multiple devices, you can use the sync scripts:
    python scripts/sync.py push
    # or
    python scripts/sync.py pull
    
  • Switch Model Backend: All tools supporting LLM (Summarize, Research) can switch backends via the --api parameter: ollama (default), claude_cli, anthropic, openai.
    • Example: python -m summarize auto --api anthropic

5. Notes

  • Configuration Files: Core project configuration is located in config.json in the root directory (please copy config.example.json for first-time use).
  • Output Directory: All generated content will be saved in the outputs/ folder.
  • Git Conventions: Do not commit outputs/, build/, gadget.egg-info, or deployment-related content under tools/website/.
Qwen3.8 27B — 8,044 chars · 14/16 facts

1. Project Summary: What is Gadget?Gadget is an open-source developer toolkit repository designed to solve daily development pain points through automated scripts and integrated workflows. It is more than just a codebase; it is a complete ecosystem covering AI report generation, academic research assistance, performance benchmarking, blog automation/O&M, and document translation.

The project adopts a “shared infrastructure + independent tools” architectural design, where all tools rely on the common package in the root directory to handle common tasks such as LLM calls, caching, and atomic writes.

Repository Structure Overview

gadget/
├── tools/              # 核心工具目录(每个子目录是一个独立应用)
│   ├── summarize/      # AI 对话日报/周报/月报生成器
│   ├── research/       # 论文发现、研究者分析、引用图谱工具
│   ├── benchmark/      # CPU/GPU 跨平台性能基准测试
│   ├── website/        # 基于 Hugo 的个人博客站点(含自动压缩与部署)
│   └── translator/     # 基于 Gradio 的本地文档翻译 Web 应用
├── common/             # 共享基础设施包(LLM API、缓存、翻译引擎、Hugo 部署)
├── scripts/            # 运维脚本(数据同步、新机器初始化、冒烟测试)
├── docs/               # 设计文档、计划、审计报告
├── outputs/            # 所有生成产物的存放地(已 gitignore,可重建)
├── AGENTS.md           # AI 代理工作协议
├── CLAUDE.md           # Claude Code 指引
└── pyproject.toml      # Python 打包配置(支持 pip install -e .)

Note: Development workflows and Skills are located in a separate sibling repository ../ai-companion/.

Detailed Tool Functions

Tool Name Core Function Key Features
Summarize AI Daily/Weekly/Monthly Reports Automatically reads conversation logs from Claude Code/Codex/ChatGPT, etc., and uses LLMs to generate structured reports. Supports multi-device data aggregation and automatic statistics for Token usage and costs.
Research Research Assistant 1. Paper Discovery: Retrieves papers from sources like arXiv/PubMed and generates weekly reports via a three-stage LLM evaluation.
2. Deep Insights: Analyzes paper writing structures and publication strategies, matching OpenReview comments.
3. Researcher Profiling: Analyzes scholar trajectories, calculates scores, and discovers mentor-student relationships.
4. Citation Mapping: Performs forward/backward citation analysis based on Semantic Scholar.
Benchmark Performance Benchmarking Measures CPU/GPU floating-point performance across platforms (CUDA/MPS/XPU). Supports multiple precisions from FP64 to FP8. Results are accumulated in CSV files, supporting the generation of Plotly interactive HTML reports and deployment to blogs.
Website Hugo Blog Automation Personal blog site. Core features include incremental media compression (only compressing newly changed images/videos) and bilingual translation. Automatically writes reports and charts generated by the above tools into the blog and deploys them to GitHub Pages.
Translator Local Document Translation A Gradio-based Web interface. Supports formats such as .md/.pdf/.docx/images, etc. Uses local models (Ollama/Transformers, etc.) to protect Markdown formatting (code blocks and URLs are not translated).
Common Shared Base Library Provides a unified LLM interface (supporting Ollama/Claude CLI/Anthropic/OpenAI), SHA-256 disk caching, atomic writes, local translation engines, etc.

2. Detailed Gadget Usage Tutorial

This tutorial is intended for developers using Gadget for the first time. We will proceed in the order of Environment Preparation -> Installation & Configuration -> Tool Usage.

Phase 1: Environment Preparation and Installation

1.1 Environment Requirements

  • Python: 3.10+ (Recommended in a Conda environment named AI)
  • Node.js: 18+ (Only required if using features from the ai-companion repository)
  • Dependency Tools:
    • rclone: Used for data synchronization (optional, mandatory for multi-device users)
    • Hugo: Static site generator (for the Website tool)
    • pngquant & HandBrakeCLI: Used for media compression (for the Website tool, optional but recommended)
    • Ollama: Local LLM runtime environment (recommended, used for default LLM backend and translation)

1.2 Clone the Repository

# 克隆主仓库
git clone git@github.com:TzJ2006/gadget.git
cd gadget

# 克隆 AI 伴侣仓库(同级目录,用于开发工作流和技能)
git clone git@github.com:TzJ2006/ai-companion.git ../ai-companion

1.3 Install Python Dependencies

Gadget uses pyproject.toml to manage dependencies.

Option A: Install all core tool dependencies except Translator (Recommended for most users)

# 激活 Python 环境
conda activate AI  # 或者你的虚拟环境

# 安装 common 包及 summarize, research, benchmark, website 的依赖
pip install -e ".[all]"

Option B: If document translation functionality is required [all] does not include translator because its dependencies are large (involving the GPU inference stack).

# 单独安装 Translator 依赖
pip install -e ".[translator]"

Note: translator dependencies include the gradio, gguf translation stack, etc.

1.4 Configure Configuration Files

Tool configurations are located in config.json in the repository root (this file is gitignored and must be created manually).

  1. Copy the example configuration:
    cp config.example.json config.json
    
  2. Edit config.json to fill in necessary API keys (if using Claude/Anthropic/OpenAI backends) or adjust other settings.
    • LLM 后端切换: Globally controlled via the --api parameter or the GADGET_LLM_BACKEND environment variable.
    • 翻译模型: Uses tencent/Hy-MT2-1.8B by default; automatically downloaded upon first run.

1.5 One-click Initialization for New Machines (Optional)

If you are configuring a new server, you can use the built-in Onboard script to automatically configure SSH, CLI authentication, Pip dependencies, etc.

# 1. 填写 tokens/onboard.yaml (包含 SSH 密钥、API Keys 等敏感信息,请勿提交)
# 2. 运行初始化脚本
python scripts/onboard.py

This script will automatically complete: SSH configuration, Claude/Codex CLI installation and authentication, Pip Extras installation, and Rclone basic configuration.


Phase 2: Typical Usage of Each Tool

2.1 Summarize: AI Daily/Weekly/Monthly Reports

This tool automatically aggregates your AI conversation logs from different devices (Claude Code, Codex, ChatGPT, etc.) to generate statistical reports.

Prerequisites: Ensure the log export function of each AI tool is enabled, or manually export logs to the specified directory.

Typical Workflow:

  1. Stage 1: Export Conversation Logs Extract conversation logs for all unexported dates.

    python -m summarize daily export
    
  2. Stage 2: Sync and Merge If you have multiple devices, first sync data via scripts/sync.py, then merge daily data.

    # Sync data for all dates and merge day by day
    python -m summarize daily merge --sync-all
    
  3. Generate Reports

    # Generate a weekly report for a specific week and deploy to the blog
    python -m summarize weekly generate --week 2026-W12 --deploy
    
    # Generate a monthly report for a specific month and deploy to the blog
    python -m summarize monthly generate --month 2026-02 --deploy
    
  4. One-click Full Process (Recommended) Automatically executes: Export -> Merge -> Generate Weekly Report -> Generate Monthly Report -> Deploy.

    python -m summarize auto --deploy
    

Tip: Uses ollama backend (local Qwen3.8-27B) by default, no API Key required. To switch, use --api claude_cli or --api anthropic.

2.2 Research: Research Assistant

This is a powerful academic tool supporting natural language queries, deep paper analysis, researcher profiling, and citation mapping.

1. Natural Language Paper Search Automatically routes to appropriate data sources (arXiv, PubMed, etc.).

python tools/research/research_scout.py ask "找 Pieter Abbeel 最近的机器人操作论文"

2. Generate Complete Research Weekly Reports Executes the full process: Search -> Three-stage LLM evaluation (Fast screening -> Deep evaluation -> Citation impact) -> Report generation.

python tools/research/research_scout.py report --project my-project

3. Researcher Profiling Obtains a scholar’s papers and citation data to generate trajectory analysis, scores, and mentor-student relationships.

python tools/research/research_scout.py profile "Sergey Levine"

4. Citation Mapping Analysis Based on arXiv ID or DOI, analyzes forward citations and backward references.

python tools/research/research_scout.py citations 2301.12597

5. Deploy Reports to Blog

python tools/research/research_scout.py deploy

2.3 Benchmark: Performance Benchmarking

Measures CPU/GPU FLOPS performance, supporting NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU).

Note: The Benchmark command must be executed in the tools/benchmark/ directory.

1. Run All Benchmarks Results will be appended to a CSV file (supports multi-hardware accumulation).

cd tools/benchmark
python -m benchmark.cli

2. Test CPU or GPU Only

python -m benchmark.cli --cpu-only
python -m benchmark.cli --gpu-only

3. Generate HTML Report

python -m benchmark.cli --report

4. Generate Report and Deploy to Blog Publishes benchmark results to the /benchmark/ path of the Hugo website.

python -m benchmark.cli --report --deploy

View report: Visit https://tzj2006.github.io/benchmark/

2.4 Website: Hugo Blog Automation

This tool is responsible for integrating content generated by other tools (daily reports, weekly reports, charts) into the blog, and handling media compression and bilingual translation.

1. Update Blog (Compress + Build + Deploy) This is the core command; it performs incremental compression (only processing new files), Hugo build, and pushes to GitHub Pages.

# macOS / Linux
cd tools/website && bash update.sh

# Windows
powershell -ExecutionPolicy Bypass -File tools/website/update.ps1

2. Local Preview Starts the Hugo development server locally to view drafts and recent changes.

cd tools/website
hugo server -D

Note: -D indicates including Drafts.

3. Translation Mechanism The Website tool has a built-in translation engine. During the build process, it automatically detects bilingual content and calls a local model (default tencent/Hy-MT2-1.8B) for translation.

  • Default backend: ollama
  • Alternative backends: vllm (Linux), transformers (Windows)
  • Models are downloaded automatically; no manual configuration required.

2.5 Translator: Local Document Translation

Provides a Web interface for translating local files (.md, .pdf, .docx, images, etc.) while preserving Markdown formatting.

1. Start Translation Service

# 确保已安装 translator 依赖: pip install -e ".[translator]"
python -m translator

The Gradio interface will automatically open in your browser after starting.

2. How to Use

  1. Open the local address in your browser (usually http://127.0.0.1:7860).
  2. Upload a file or input text.
  3. Select the source language and target language (supports auto auto-detection).
  4. Click Translate.
  5. Copy the result or download the translated file.Advanced Configuration:
  • Model Switching: tencent/Hy-MT2-1.8B is used by default. You can switch models via the model management interface in the GUI, or by setting the environment variable GADGET_TRANSLATION_MODEL.
  • Backend Switching: ollama is prioritized by default. If Ollama is not installed, it will automatically fall back to transformers (Windows) or vllm (Linux). You can also force a specific backend via GADGET_TRANSLATION_BACKEND.

Phase 3: Operations and Data Synchronization

3.1 Data Synchronization (Rclone)

If you are developing across multiple devices, you can use the built-in synchronization scripts.

# 查看同步状态
python scripts/sync.py status

# 推送本地更改到云端
python scripts/sync.py push

# 从云端拉取最新数据
python scripts/sync.py pull

Configuration is located in the sync section of config.json.

3.2 Smoke Test

Before running the full workflow, you can quickly check if the environment is configured correctly (read-only operation, does not consume LLM Tokens).

bash scripts/smoke.sh

3.3 Output Directory Management

All generated artifacts (logs, reports, charts, cache) are stored in the outputs/ directory.

  • This directory is ignored by .gitignore.
  • If outputs/ is deleted, all reports can be reconstructed by re-running the corresponding tool’s generate command.

FAQ

Q: How do I use different LLM backends? A: Most tools support the --api parameter.

  • ollama (Default): Runs locally, no Key required, Qwen3.8-27B is recommended.
  • claude_cli: Reuses the Claude Code login state, no additional API Key required.
  • anthropic: Uses Anthropic API Key.
  • openai: Uses OpenAI API Key. Global default values can be set via the environment variable GADGET_LLM_BACKEND.

Q: Why is translation so slow/failing? A: Translation uses local inference.

  1. Ensure Ollama is running and the model has been pulled (ollama pull tencent/Hy-MT2-1.8B).
  2. If Ollama is unavailable, the program will fall back to transformers (high CPU/memory consumption) or vllm (GPU).
  3. Check if the GADGET_TRANSLATION_BACKEND environment variable correctly points to your installed backend.

Q: Blog deployment failed? A:

  1. Check the Hugo path and Git configuration in config.json.
  2. Ensure the tools/website/public/ directory is an independent Git repository (usually managed automatically by scripts; do not manually git add files under this directory to the main repository).
  3. View the build logs in outputs/logs/.

Q: How do I back up? A: Your source code is in Git. For your data (conversation logs, CSV benchmark data, generated reports), it is recommended to keep them outside the outputs/ directory or sync them to the cloud via scripts/sync.py. The tokens/ directory contains sensitive information; please back it up yourself and never commit it to Git.


End of tutorial. Happy using! If you have more questions, please refer to TUTORIAL.md and the documentation under each tool’s directory.

Qwen3.6 36B — 7,847 chars · 15/16 facts

Below is the Project Summary and Detailed Usage Tutorial organized based on the provided README content.


Part 1: Project Summary

1. What is it?

Gadget is a practical toolkit for developers, primarily serving daily development workflows. Its core functions include:

  • AI Report Generation: Automatically summarizes AI conversation logs and generates daily/weekly/monthly reports.
  • Academic Research Assistance: Paper discovery, researcher profiling, and citation network construction.
  • Performance Benchmarking: Cross-platform (CPU/GPU) performance benchmarking tools.
  • Blog Automation: A blog building and auto-publishing system based on Hugo, supporting media compression and local translation.
  • Document Translation: A local document translation web application based on Gradio.

The project adopts a modular design where each tool runs independently, shares underlying infrastructure (common), and relies on an independent external repository ai-companion to provide development workflows and code change tracking.

2. Repository Structure

gadget/
├── tools/              # 五个独立的工具模块(核心功能)
│   ├── summarize/      # AI 对话日报/周报/月报生成
│   ├── research/       # 论文发现、研究者分析与引用图谱
│   ├── benchmark/      # CPU/GPU 性能基准测试
│   ├── website/        # Hugo 博客系统(含自动化构建与发布)
│   └── translator/     # Gradio 文档翻译器
├── common/             # 共享基础设施包 (LLM调用、缓存、IO、翻译、Hugo部署等)
├── scripts/            # 运维与维护脚本 (同步、新机配置、烟雾测试等)
├── docs/               # 设计文档、ECL计划、审计报告及历史归档
├── outputs/            #所有生成的产物(报告、日志、缓存),已被 gitignore
├── AGENTS.md           # AI Agent 工作流协议
├── CLAUDE.md           # Claude Code 仓库指南
└── pyproject.toml      # Python 打包配置

Key Dependencies:

  • ai-companion: Located in the parent directory ../ai-companion/, providing code change tracking, planning/execution workflows, and skills, integrated into this project via hooks.

3. What does each tool do?

Tool Directory Core Function Key Technologies/Stack
tools/summarize/ AI Conversation Report Generation:
Reads AI conversation logs from multiple devices to generate structured daily/weekly/monthly reports. Uses ccusage to track token usage. Supports local Ollama, Claude CLI, Anthropic, and OpenAI backends.
Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Academic Research Assistant:
1. Paper Discovery: Searches arXiv/PubMed, etc., and generates weekly reports.
2. Deep Insights: Analyzes article structure, writing strategies, and core knowledge.
3. Researcher Profiling: Analyzes researcher trajectories and mentor-student relationships.
4. Citation Mapping: Analyzes forward/backward citations.
arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
tools/benchmark/ Performance Benchmarking:
Cross-platform CPU/GPU FLOPS testing. Supports NVIDIA (CUDA), Apple Silicon (MPS), and Intel (XPU). Outputs CSV results and interactive HTML leaderboards that can be deployed to the blog.
PyTorch, NumPy, Plotly
tools/website/ Hugo Blog Automation:
A blog based on the PaperMod theme. Automatically performs incremental compression of images/videos, local model translation, and one-click builds/publishes to GitHub Pages. Automatically generates tool report pages.
Hugo, pngquant, HandBrakeCLI, Python (translation)
tools/translator/ Document Translator:
Gradio Web UI. Supports Markdown format preservation for text and files (.md/.txt/.pdf/.docx/images). Uses local model inference without relying on cloud APIs.
Gradio, GGUF/transformers/vLLm/Ollama

Part 2: Detailed Chinese Usage Tutorial

This tutorial is intended for users encountering this project for the first time. Please operate strictly according to the information provided in the README.

1. Environment Preparation

Before installation, please ensure the following basic environment requirements are met:

  • Python: Version 3.10+. Using a conda environment AI (conda activate AI) is recommended.
  • Node.js: Version 18+ (only for the standalone ai-companion repository; the core tools in this repo primarily depend on Python).
  • Git: Used for cloning code.

Pre-check (Smoke Test): During the configuration process, you can run the following command to perform a read-only smoke test to ensure there are no errors:

bash scripts/smoke.sh

2. Installation and Initialization

Step 1: Clone the Repository and Prepare Dependencies

Assuming the ai-companion repository already exists in your working directory.

  1. Clone the Gadget repository (if not already cloned):

    git clone <gadget_repo_url>
    cd gadget
    
  2. Install the shared infrastructure package (common) and all core tool dependencies: The README indicates that common is the foundation, while each tool is installed as an extra. To cover summarize, research, benchmark, and website, it is recommended to install the all extra package.

    Note: translator is not included in all and must be installed separately.

    # Install common and dependencies for summarize/research/benchmark/website
    pip install -e ".[all]"
    
    # If you need to use the Translator tool, execute additionally:
    pip install -e ".[translator]"
    
  3. Configure AI Companion (Workflow Engine): The Gadget development workflow depends on the parent directory ../ai-companion/. Please ensure this directory exists and has been correctly initialized. Refer to ../ai-companion/scripts/install.ts for specific installation steps.

Step 2: Configuration Files and Keys

  1. Create Configuration Files: All tool settings are located in config.json in the root directory (this file is gitignored).

    # Copy example configuration and modify it
    cp config.example.json config.json
    
    • The configuration file path can be specified via the environment variable GADGET_CONFIG.
  2. Manage Keys (Tokens): API keys and onboarding information are stored in the tokens/ directory (which is gitignored; never commit this to Git).

    • API Keys: Place them in the corresponding locations under tokens/.
    • Onboarding Sheet: Fill out tokens/onboard.yaml for one-click machine configuration.
  3. Set LLM Backend: By default, ollama is used (local, no Key required, uses Qwen3.8-27B). Global switching can be done via the environment variable GADGET_LLM_BACKEND or by setting it in config.json. Supported values: ollama, claude_cli, anthropic, openai.

3. Detailed Tool Usage

A. Summarize: AI Conversation Report Generation

Scenario: Automatically summarize AI conversations from multiple devices to generate daily/weekly reports. Architecture: Two-stage (Export -> Merge/Generate).1. Phase 1: Export unexported date data bash python -m summarize daily export

  1. Phase 2: Sync all dates and merge daily data

    python -m summarize daily merge --sync-all
    
  2. Generate weekly reports

    • Specify a specific week (e.g., Week 12 of 2026):
      python -m summarize weekly generate --week 2026-W12 --deploy
      
    • The --deploy parameter will publish the report to the Hugo blog.
  3. Generate monthly reports

    • Specify a specific month (e.g., February 2026):
      python -m summarize monthly generate --month 2026-02 --deploy
      
  4. One-click full process Execute the complete pipeline: Export -> Merge -> Weekly/Monthly report generation -> Deployment.

    python -m summarize auto --deploy
    

Tip: Backend switching uses the --api parameter (such as --api openai), specifically supporting ollama, claude_cli, anthropic, openai.

B. Research: Academic Research Assistant

Entry Command: python tools/research/research_scout.py

  1. Full Pipeline: Paper Search and Report Generation

    python tools/research/research_scout.py report --project my-project
    # Workflow: Search -> Three-stage evaluation (Fast screening -> Deep evaluation -> Citation impact) -> Generate report
    
  2. Natural Language Paper Search

    python tools/research/research_scout.py ask "Find recent robot manipulation papers by Pieter Abbeel"
    # Automatically routes to appropriate data sources (arXiv/PubMed, etc.)
    
  3. Generate Researcher Profiles

    python tools/research/research_scout.py profile "Sergey Levine"
    # Includes research trajectory analysis, mentor-student relationship mining, etc.
    
  4. View Citation Graphs

    python tools/research/research_scout.py citations 2301.12597
    # Analyze forward/backward citations via arXiv ID or DOI
    
  5. Deploy Reports to Blog

    python tools/research/research_scout.py deploy
    

Tip: Also supports --api for backend switching. For in-depth analysis of paper content, use the --insight parameter (refer to source code documentation for specific usage; README only lists entry points).

C. Benchmark: Performance Benchmarking

Note: All commands must be executed in the tools/benchmark/ directory.

cd tools/benchmark
  1. Run all tests (CPU + GPU) Results are appended to a CSV and will not overwrite old data.

    python -m benchmark.cli
    
  2. CPU-only testing

    python -m benchmark.cli --cpu-only
    
  3. GPU-only testing Automatically detects CUDA / MPS / XPU.

    python -m benchmark.cli --gpu-only
    
  4. Generate HTML report

    python -m benchmark.cli --report
    
  5. Generate report and deploy to Hugo blog Publish results to the /benchmark/ path.

    python -m benchmark.cli --report --deploy
    

D. Website: Hugo Blog Management

Directory: tools/website/

  1. Local Preview (Development Mode)

    cd tools/website
    hugo server -D
    
  2. Build and deploy to GitHub Pages (macOS/Linux) This script performs incremental media compression, Hugo build, and push.

    bash update.sh
    
  3. Build and deploy to GitHub Pages (Windows)

    powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
    

Important Warning: tools/website/public/ is an independent deployment repository. Do not perform git commit directly on this directory; it is managed automatically by scripts.

E. Translator: Document Translator

Scenario: Translate Markdown, PDF, and other files via Web UI while preserving formatting.

  1. Start Gradio Interface

    python -m translator
    # The browser will open automatically (or visit localhost:7860)
    
  2. Configure Default Model Uses tencent/Hy-MT2-1.8B by default; it will be downloaded automatically on the first run. Can be overridden via the GADGET_TRANSLATION_MODEL environment variable.

  3. Backend Switching Ollama is prioritized by default. On Windows, it falls back to transformers; on Linux, vLLm or GGUF can be configured.

4. Operations and Maintenance (Scripts)

Data Sync (Sync)

Used for synchronizing data generated by summarize/website/research, etc., across multiple devices.

# 推送数据
python scripts/sync.py push

# 拉取数据
python scripts/sync.py pull

# 查看状态
python scripts/sync.py status

Configuration is in the sync section of config.json. rclone must be configured first.

Onboarding (New Machine Setup)

For new machines, fill out tokens/onboard.yaml and then run:

python scripts/onboard.py

This will automatically complete SSH, CLI authentication, pip dependency installation, and rclone bootstrap.

Server-level One-click Deployment

System-level installation (Claude Code, Codex, etc.) for Ubuntu servers is located in the ai-companion repository:

bash ../ai-companion/scripts/onboard-server.sh --help
# 示例用法 (需传入 ai-companion 路径)
# bash ../ai-companion/scripts/onboard-server.sh --companion-repo git@github.com:TzJ2006/ai-companion.git

5. Outputs and Precautions

  • All generated files are located in the outputs/ directory (logs, reports, cache, etc.), which has been added to .gitignore.
  • Do not commit:
    • Any content under outputs/.
    • Keys under tokens/.
    • tools/website/public/ (it is an independent repository).
    • build/ and gadget.egg-info/.
    • Data synchronized via rclone.
  • LLM Backend Switching: Can be set globally via the GADGET_LLM_BACKEND environment variable, or by using the --api parameter in various tool commands.

By following these steps, you can fully run all core tools in the Gadget project. For detailed advanced configurations (such as specific tool JSON formats or more CLI parameters), please refer to the TUTORIAL.md or README.md under each tool’s directory.

Reproducing

docbench.py (run, resumable) → docbench.json (full record) → gen_doc_post.py (builds this page).