The [README.md](20,768 characters) from the gadget repository is handed over as is to 4 local Ollama models and three Agent CLI models on the cloud, with a requirement to first summarize the project and then write a Chinese usage guide. Below are the model information, speed, VRAM, latency, token data, document structure statistics, and the entire original output recorded during each run.

Task

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

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

The full README should be submitted together with this description, and the entire prompt consists of 20,768 characters.

Running Conditions

The sixteen models receive exactly the same prompt, without any additional prefixes or system prompts.

Local (Ollama) — RTX 5090 / 32 GB. POST 127.0.0.1:11434/api/chat, stream: false, think: false. No sampling parameters are specified; temperature, num_predict, and context all use the default values from the model Modelfile and ollama. Before running each model, ollama stop is used to clear the VRAM, so the loading time is cold start time. The peak VRAM usage nvidia-smi minus the desktop baseline (2.2–2.6 GB). Speed is directly read from the response body eval_count / eval_duration, without HTTP and Python overhead.

Cloud (Agent CLI)codex exec --json, claude -p --output-format json, cursor-agent --print --output-format json; all run serially, with an empty temporary folder as the working directory. After running, it is checked to ensure no residual files remain. The prompt is sent from stdin (the .cmd shim on Windows truncates command-line parameters at the first newline). Total time is measured using perf_counter for the entire process; token, API time, and first token latency are read from the usage fields in each JSON.

Each model runs once. Sampling is random, and the numbers for single-run results and speed will vary.

Three facts affecting the metrics

  1. The two speed tables cannot be compared against each other. The input for local models is this prompt itself (5,230–8,000 tokens); Cloud models use a coding agent CLI, and their inputs also include their respective system prompts and tool definitions.

  2. The input_tokens field of Claude Code reports single digits, and the real context is in cache_creation_input_tokens + cache_read_input_tokens; the input column in Table 3 already sums all three. Codex and Cursor report the complete input.

  3. The first token latency is only reported by Claude Code (ttft_ms); this field does not exist in the JSON of Codex and Cursor.

  4. The two VRAM numbers in Table 2 are inconsistent. “Peak VRAM increment” comes from nvidia-smi; “ollama ps persistent” is reported by ollama itself; for Gemma4 26B, the former is 28.4 GB and the latter is 4.2 GB. Both columns are listed as they are.

  5. The running conditions for Fable 5.1 are different from those of the other Claude Code models. It was added later: --effort high is explicitly specified, while the other three Claude Code models use the default effort of the CLI; The CLI version has also increased from 2.1.223 to 2.1.258.

Table 1: Local Model Information

Model Parameter Count Architecture Quantization Disk Size Digest Training Context Running Context
Gemma4 12B 11.9B gemma4 Q4_K_M 7.6 GB 4eb23ef187e2 262,144 65,536
Gemma4 26B 25.2B gemma4 Q4_K_M 18 GB 08ae7ec1744b 262,144 65,536
Qwen3.8 27.3B qwen35 Q4_K_M 17 GB 67a1c5bfe600 262,144 65,536
Qwen3.6 36.0B qwen35moe Q4_K_M 23 GB c4f897240059 262,144 65,536

Table 2: Local Running Metrics

Model Peak VRAM Increment ollama ps Persistent Loading Input Tokens Prefill Output Tokens Decoding Speed Generation Time End Reason
Gemma4 12B 15.3 GB 10 GB 5.29 s 5,230 5,396 tok/s 1,493 117.4 tok/s 19.0 s stop
Gemma4 26B 28.4 GB 4.2 GB 15.69 s 5,230 5,433 tok/s 1,439 217.8 tok/s 23.29 s stop
Qwen3.8 20.1 GB 17 GB 13.81 s 5,112 2,731 tok/s 3,713 122.9 tok/s 45.9 s stop
Qwen3.6 23.3 GB 23 GB 14.84 s 5,112 5,116 tok/s 3,288 211.3 tok/s 31.43 s stop

Table 3: Agent CLI

Tool / Model CLI Version Total Time API Time First Token Latency Input Tokens Cache Hits Output Tokens Inference Tokens Effective Throughput
Claude Code · Haiku 4.5 2.1.223 (Claude Code) 79.43 s 77.42 s 14.95 s 26,548 12,059 7,438 93.6 tok/s
Codex · GPT-5.6-Sol codex-cli 0.149.1 104.37 s 23,347 11,008 5,512 241 52.8 tok/s
Codex · GPT-5.6-Terra codex-cli 0.149.1 57.77 s 21,738 11,008 2,984 82 51.7 tok/s
Codex · GPT-5.6-Luna codex-cli 0.149.1 68.01 s 21,789 9,984 3,589 274 52.8 tok/s
Codex · GPT-5.5 codex-cli 0.149.1 68.32 s 22,355 1,408 3,595 21 52.6 tok/s
Codex · GPT-5.4-Mini codex-cli 0.149.1 64.87 s 20,618 4,480 4,365 1,475 67.3 tok/s
Claude Code · Opus 5 2.1.223 (Claude Code) 96.55 s 94.92 s 2.56 s 29,786 8,456 87.6 tok/s
Claude Code · Sonnet 5 2.1.223 (Claude Code) 35.99 s 34.37 s 3.00 s 37,413 3,578 99.4 tok/s
Cursor · Composer 2.5 2026.08.25-3e8eec8 56.78 s 54.33 s 15,075 5,489 4,119 72.5 tok/s
Cursor · Grok 4.6 High 2026.08.25-3e8eec8 88.81 s 86.44 s 16,836 5,376 5,690 64.1 tok/s
Cursor · Gemini 3.7 Flash 2026.08.25-3e8eec8 48.01 s 44.28 s 24,461 3,165 65.9 tok/s
Claude Code · Fable 5.1 · effort high 2.1.258 (Claude Code) 86.32 s 84.32 s 21.06 s 35,732 15,248 7,048 81.6 tok/s

Table 4: Structural Statistics of Output Documents

All are calculated using regular expressions. “Number of commands” is counted from the lines starting with pip / python / cd / bash / git / hugo / conda / ollama / npm / node / eval / export / rclone / source; “With original text in README” means the command, after removing comments and compressing whitespace, can be found in the original README; otherwise, it is counted as “No original text in README”.| Model | Character Count | Chinese Characters | Foreign Words | Full Angle Punctuation Rate | Title | List Items | Table Rows | Code Block | Code Lines | Number of Commands | Original Text in README | No Original Text in README | |—|—|—|—|—|—|—|—|—|—|—|—|—| | Gemma4 12B | 3,465 | 873 | 228 | 65.9% | 17 | 37 | 0 | 12 | 22 | 17 | 15 | 2 | | Gemma4 26B | 3,442 | 876 | 215 | 62.0% | 15 | 33 | 0 | 15 | 22 | 18 | 17 | 1 | | Qwen3.8 | 8,044 | 2,344 | 531 | 66.2% | 34 | 37 | 8 | 24 | 69 | 32 | 26 | 6 | | Qwen3.6 | 7,847 | 1,838 | 541 | 60.8% | 25 | 50 | 7 | 28 | 62 | 31 | 26 | 5 | | Claude Code · Haiku 4.5 | 11,235 | 2,385 | 917 | 69.0% | 135 | 62 | 7 | 27 | 245 | 75 | 46 | 29 | | Codex · GPT-5.6-Sol | 11,731 | 3,411 | 850 | 73.6% | 62 | 125 | 8 | 61 | 88 | 39 | 35 | 4 | | Codex · GPT-5.6-Terra | 6,622 | 1,725 | 523 | 74.6% | 13 | 40 | 7 | 42 | 64 | 38 | 33 | 5 | | Codex · GPT-5.6-Luna | 7,667 | 1,946 | 586 | 71.0% | 37 | 72 | 7 | 53 | 87 | 39 | 35 | 4 | | Codex · GPT-5.5 | 8,517 | 1,969 | 718 | 73.5% | 1 | 5 | 0 | 57 | 100 | 46 | 41 | 5 | | Codex · GPT-5.4-Mini | 6,730 | 1,428 | 555 | 61.8% | 5 | 108 | 0 | 22 | 55 | 41 | 38 | 3 | | Claude Code · Opus 5 | 12,340 | 2,974 | 988 | 37.6% | 26 | 26 | 14 | 24 | 65 | 43 | 33 | 10 | | Claude Code · Sonnet 5 | 5,754 | 1,037 | 478 | 70.0% | 16 | 11 | 7 | 13 | 46 | 31 | 30 | 1 | | Cursor · Composer 2.5 | 10,088 | 1,905 | 847 | 70.2% | 51 | 59 | 35 | 17 | 106 | 38 | 33 | 5 | | Cursor · Grok 4.6 High | 11,015 | 2,531 | 906 | 73.9% | 15 | 31 | 8 | 14 | 46 | 32 | 31 | 1 | | Cursor · Gemini 3.7 Flash | 7,229 | 1,673 | 536 | 75.3% | 19 | 46 | 10 | 31 | 44 | 29 | 28 | 1 | | Claude Code · Fable 5.1 · effort high | 8,091 | 1,944 | 698 | 74.4% | 2 | 30 | 15 | 15 | 34 | 34 | 32 | 2 |

Commands with “No Original Text in README” in the「README」 section

  • Gemma4 12B (2)
    • python scripts/onboard.py
    • python scripts/sync.py pull
  • Gemma4 26B (1)
    • python scripts/onboard.py
  • Qwen3.8 (6)
    • cd gadget
    • git clone git@github.com:TzJ2006/ai-companion.git ../ai-companion
    • git clone git@github.com:TzJ2006/gadget.git
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python scripts/sync.py status
  • Qwen3.6 (5)
    • cd gadget
    • git clone <gadget_repo_url>
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python scripts/sync.py status
  • Claude Code · Haiku 4.5 (29)
    • cd gadget
    • cd tools/benchmark && python -c "import torch; print(torch.cuda.is_available())"
    • conda create -n AI python=3.10
    • export GADGET_CONFIG=/path/to/custom/config.json
    • export GADGET_LLM_BACKEND=claude_cli
    • export GADGET_TRANSLATION_BACKEND=ollama
    • export GADGET_TRANSLATION_BACKEND=transformers
    • export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF
    • git clone <gadget-repository-url>
    • python -c "import research; print('OK')"
    • python -c "import summarize; print('OK')"
    • python -m summarize auto --deploy --api openai
  • Codex · GPT-5.6-Sol (4)
    • export → merge → weekly → monthly → deploy
    • python scripts/sync.py pull
    • python tools/summarize/monthly_summary.py ...
    • python tools/summarize/weekly_summary.py ...
  • Codex · GPT-5.6-Terra (5)
    • ollama → llamacpp / vllm / transformers
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python tools/summarize/monthly_summary.py
    • python tools/summarize/weekly_summary.py
  • Codex · GPT-5.6-Luna (4)
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python tools/summarize/monthly_summary.py
    • python tools/summarize/weekly_summary.py
  • Codex · GPT-5.5 (5)
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python tools/summarize/monthly_summary.py ...
    • python tools/summarize/weekly_summary.py ...
    • rclone 同步数据
  • Codex · GPT-5.4-Mini (3)
    • cd tools/benchmark && python -m benchmark.cli --report
    • python tools/summarize/monthly_summary.py ...
    • python tools/summarize/weekly_summary.py ...
  • Claude Code · Opus 5 (10)
    • export GADGET_CONFIG=/path/to/your/config.json
    • export GADGET_LLM_BACKEND=ollama
    • export GADGET_TRANSLATION_BACKEND=ollama
    • export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B
    • export GADGET_TRANSLATION_MODEL=tencent/Hy-MT2-1.8B-GGUF
    • python -m summarize auto --deploy --api claude_cli
    • python scripts/language.py
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python tools/research/research_scout.py report --project my-project --api claude_cli
  • Claude Code · Sonnet 5 (1)
    • python scripts/onboard.py
  • Cursor · Composer 2.5 (5)
    • python scripts/onboard.py
    • python scripts/sync.py pull
    • python tools/summarize/monthly_summary.py ...
    • python tools/summarize/weekly_summary.py ...
  • Cursor · Grok 4.6 High (1)
    • python scripts/sync.py pull
  • Cursor · Gemini 3.7 Flash (1)
    • python scripts/onboard.py
  • Claude Code · Fable 5.1 · effort high (2)
    • python scripts/onboard.py
    • python scripts/sync.py pull

Table 5: Coverage of Facts in README

Sixteen facts that can be found word for word in the README; checked to see if each output mentions them. Pure string matching.| Model | [all] | [tr] | sum | res | cd | web | trl | cfg | env | api | out | syn | tok | py | gpl | cmp | Total | |—|—|—|—|—|—|—|—|—|—|—|—|—|—|—|—|—|—| | Gemma4 12B | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 14/16 | | Gemma4 26B | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | ✅ | — | ✅ | ✅ | — | ✅ | 12/16 | | Qwen3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 14/16 | | Qwen3.6 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 15/16 | | Claude Code · Haiku 4.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 15/16 | | Codex · GPT-5.6-Sol | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Codex · GPT-5.6-Terra | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 15/16 | | Codex · GPT-5.6-Luna | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Codex · GPT-5.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Codex · GPT-5.4-Mini | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 15/16 | | Claude Code · Opus 5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Claude Code · Sonnet 5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Cursor · Composer 2.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Cursor · Grok 4.6 High | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 | | Cursor · Gemini 3.7 Flash | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ | 15/16 | | Claude Code · Fable 5.1 · effort high | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 16/16 |

  • [all]pip install -e ".[all]"
  • [tr][translator] needs to be installed separately / is a separate extra
  • sumpython -m summarize
  • resresearch_scout.py
  • cdcd tools/benchmark
  • webupdate.sh / update.ps1
  • trlpython -m translator
  • cfgconfig.json
  • envGADGET_CONFIG
  • api--api claude_cli and other backends / the --api backends
  • outoutputs/
  • synscripts/sync.py
  • toktokens/
  • py — Python 3.10+
  • gpl — GPL-3
  • cmp — ai-companion is a separate repo

All Output

Gemma4 12B — 3,465 characters · 12 code blocks · 14/16 facts in README

Project Summary

Gadgets is a practical toolkit aimed at simplifying daily development processes. It integrates multiple functional modules such as AI assistants, academic research, performance benchmarks, automated blog publishing, and document translation.

Repository Structure

  • tools/: The core functional area of the project, containing 5 independent tools:
    • summarize: Handles AI conversation records and generates daily/weekly/monthly summary reports.
    • research: Academic research tool, including paper discovery, researcher analysis, and citation graph.
    • benchmark: Cross-platform CPU/GPU performance benchmark suite.
    • website: Hugo-based blog system, including automated deployment and media compression.
    • translator: Gradio-based document translation tool, supporting multiple formats while preserving Markdown format.
  • common/: Shared infrastructure package, containing LLM invocation, caching, translation engine, Hugo deployment, and other general functions.
  • scripts/: Operations and maintenance scripts, handling data synchronization, environment initialization, language checks, etc.
  • outputs/: Stores all generated content (logs, reports, cache, etc.), not counted in the Git repository.
  • ai-companion (separate repository): Located in the same directory, providing development workflows, code change tracking, and a range of AI skills.

Usage Guide

This guide aims to help beginners get started with the Gadget project quickly.

1. Environment Preparation

Before starting, ensure your machine meets the following requirements:

  • Python: 3.10+ (It is recommended to use the AI Conda environment).
  • Node.js: 18+ (Primarily used for ai-companion modules).
  • Basic dependencies: It is suggested to install the basic rclone tools first (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 you need the translation function (requires additional dependency installation):

pip install -e ".[translator]"

Initialization for a new machine (automatic environment configuration): If this is your first time configuring this project on a machine, you can use the onboarding script:

  1. Fill in onboard.yaml (including API Key and other information) in the tokens/ directory.
  2. Run the following command to automatically complete the configuration (including SSH, tool configuration, rclone initialization, etc.):
    python scripts/onboard.py
    

3. Usage Guide for Core Tools

Each tool can be run independently in its corresponding directory or called through a unified module.

A. AI Conversation Summary (Summarize)

Used to organize your AI conversation records (Claude, ChatGPT, etc.) into structured reports.

  • Fully automated process (recommended):
    python -m summarize auto --deploy
    
  • Step-by-step operation:
    • 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 search, deep analysis, researcher profiles, and citation graph analysis.

  • Start the full research process:
    python tools/research/research_scout.py report --project my-project
    
  • Natural language search:
    python tools/research/research_scout.py ask "Find Pieter Abbeel's latest robot operation papers"
    
  • Get researcher profiles:
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Analyze citation graphs of a 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)

Start a Gradio interface to translate various documents (supports .md, .pdf, .docx, etc.).

  • Start the translation interface:
    python -m translator
    
E. Blog Synchronization and Deployment (Website)
For managing and updating the Hugo blog. * **Installation-related dependencies**: `pip install -e ".[website]"` * **Updating and pushing content**: * Windows: `powershell -ExecutionPolicy Bypass -File tools/website/update.ps1` * Linux/macOS: `cd tools/website && bash update.sh` * **Local preview**: ```bash cd tools/website && hugo server -D ```

4. Other common operations

  • Data synchronization: If you operate on multiple devices, you can use a synchronization script:
    python scripts/sync.py push
    # or
    python scripts/sync.py pull
    
  • Switching model backend: All tools supporting LLMs (Summarize, Research) can switch the backend via the --api parameter: ollama (default), claude_cli, anthropic, openai.
    • Example: python -m summarize auto --api anthropic

5. Notes

  • Configuration file: The core configuration of the project is located in the root directory’s config.json (copy config.example.json for first-time use).
  • Output directory: All generated content will be saved in the outputs/ folder.
  • Git norms: Do not commit outputs/, build/, gadget.egg-info, and tools/website/ related deployment content.
Gemma4 26B — 3,442 characters · 15 code blocks · 12/16 facts in README

1. Project summary

Gadgets is a collection of practical tools accumulated by developers, aiming to automate repetitive tasks in development, research, and content publishing through AI capabilities. It not only includes multiple independent tools but also builds a complete automation workflow through a core shared package common.

Repository structure

  • tools/: Core tool 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 writing, translation engines, and Hugo deployment features.
  • scripts/: Operations and maintenance scripts, used for data synchronization, new machine initialization configuration, etc.
  • outputs/: Location of all generated outputs (reports, caches, logs, data, etc.).
  • docs/: Design documents and archives.
  • ai-companion/ (external repository): This project uses a linked brother directory via hooks, responsible for providing the development workflow engine (planning/execution/change tracking) and all Claude Code-related skills.

Overview of tool functions

  1. Summarize: AI dialogue summarization tool. Automatically reads AI dialogue records from different devices (Claude/ChatGPT, etc.) and generates daily/weekly/monthly reports.
  2. Research: Academic research tools. 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 tests.
  4. Website: Hugo blog management. Includes media auto-compression, bilingual translation, and automated build and publishing processes.
  5. Translator: Document translator. A localized translation web interface based on Gradio, supporting document translation in Markdown format, images, and files.

2. Usage guide

This guide is for users who are encountering Gadgets for the first time.

I. Environment preparation

Before starting, ensure your system has the following environment installed:

  • Python 3.10+ (It is recommended to use Conda to manage the environment, e.g. conda activate AI)
  • Node.js 18+ (Primarily used for the associated ai-companion repository)
  • Ollama (Recommended, for running LLMs locally)

II. Installation and configuration

  1. Install core packages and most tools: Enter the root directory of the project and run the following command to install the common package and dependencies required by most tools:

    pip install -e ".[all]"
    
  2. Install the translator tool (requires additional installation): Since the translator depends on specific Gradio and model stack, it needs to be installed separately:

    pip install -e ".[translator]"
    
  3. Initial configuration:

    • The project uses config.json for configuration. Please copy a copy from the template first:
      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 (prepare tokens/onboard.yaml first):
      python scripts/onboard.py
      

III. Typical usage of tools

1. Summarize (Dialogue summarization)

This tool operates through a two-stage workflow: first export data, then merge to generate reports.

  • First stage: Export un-exported data:
    python -m summarize daily export
    
  • Second stage: 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 the backend via the --api parameter, such as --api ollama or --api openai.
2. Research (Academic research)

Operate using the unified entry point research_scout.py.

  • Execute the full research pipeline (search $\rightarrow$ evaluation $\rightarrow$ report):
    python tools/research/research_scout.py report --project my-project
    
  • Search papers in natural language:
    python tools/research/research_scout.py ask "Find the latest robot operation paper by Pieter Abbeel"
    
  • View researcher profiles:
    python tools/research/research_scout.py profile "Sergey Levine"
    
  • Analyze citation graphs of papers (using arXiv ID):
    python tools/research/research_scout.py citations 2301.12597
    
3. Benchmark (Performance testing)

Note: Enter the tool directory first 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 (Blog management)
  • Local preview:
    cd tools/website && hugo server -D
    
  • Update the website (compress media $\rightarrow$ build $\rightarrow$ push to GitHub Pages):
    • macOS/Linux: bash update.sh
    • Windows: powershell -ExecutionPolicy Bypass -File update.ps1
5. Translator (Document translation)
  • Start the Gradio graphical interface:
    python -m translator
    
    After starting, open the displayed address in a browser to translate documents. The tencent/Hy-MT2-1.8B model will be automatically downloaded during the first run.
| Tool Name | Core Function | Key Features | | :--- | :--- | :--- | | **Summarize** | **AI Dialogue Daily/Weekly/Monthly Report** | Automatically reads dialogue logs from Claude Code/Codex/ChatGPT, generating structured reports using LLMs. Supports data aggregation across multiple devices, and automatically tracks Token usage and costs. | | **Research** | **Scientific Research Assistant** | 1. **Paper Discovery**: Searching papers from arXiv/PubMed, generating weekly reports after three-stage LLM evaluation.
2. **Deep Insights**: Analyzing paper writing structure and publication strategies, matching OpenReview comments.
3. **Researcher Profiles**: Analyzing scholar trajectories, computational scores, and identifying mentor-student relationships.
4. **Citation Graph**: Forward/backward citation analysis based on Semantic Scholar. | | **Benchmark** | **Performance Benchmarking** | Measuring CPU/GPU floating-point performance across platforms (CUDA/MPS/XPU). Supports multiple precision levels from FP64 to FP8. Results are accumulated in CSV, and can generate interactive Plotly HTML reports for deployment on a blog. | | **Website** | **Hugo Blog Automation** | A personal blog site. Its core features include **incremental media compression** (compressing only 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 Web interface based on Gradio. Supports formats such as `.md`/`.pdf`/`.docx`/images. Uses local models (Ollama/Transformers, etc.), preserving Markdown format (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 cache, atomic writing, and a local translation engine. |

2. Detailed Usage Guide for Gadget

This guide is 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 Environmental Requirements

  • Python: 3.10+ (Recommended in a Conda environment, named AI)
  • Node.js: 18+ (Required only when using the features of ai-companion repository)
  • Dependency Tools:
    • rclone: For data synchronization (optional, required for multi-device users)
    • Hugo: Static site generator (used by Website tool)
    • pngquant & HandBrakeCLI: For media compression (used by Website tool, optional but recommended)
    • Ollama: Local LLM runtime environment (recommended, used for the 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: Installing 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 needed [all] does not include translator, as its dependency is large (involves GPU inference stack).

# 单独安装 Translator 依赖
pip install -e ".[translator]"

Note: translator depends on gradio, gguf translation stack, etc.

1.4 Configure Configuration Files

Tool configurations are located in the root directory of the repository under config.json (this file is already in gitignore, need to create manually).

  1. Copy the example configuration:
    cp config.example.json config.json
    
  2. Edit config.json and fill in necessary API keys (if using Claude/Anthropic/OpenAI backend) or adjust other settings.
    • LLM 后端切换: Global defaults are controlled via --api parameters or environment variable GADGET_LLM_BACKEND.
    • 翻译模型: Uses tencent/Hy-MT2-1.8B by default, automatically downloaded on first run.

1.5 One-click Initialization on New Machine (Optional)

If configuring on 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 basic Rclone configuration.


Phase 2: Typical Usage of Tools

2.1 Summarize: AI Dialogue Daily/Weekly/Monthly Report

This tool automatically aggregates your AI dialogue records on different devices (Claude Code, Codex, ChatGPT, etc.) to generate statistical reports.

Prerequisites: Ensure the log export features of each AI tool are enabled, or manually export logs to a specified directory.

Typical Workflow:

  1. Phase 1: Export Dialogue Logs Extract dialogue logs for all dates that were not exported.

    python -m summarize daily export
    
  2. Phase 2: Sync and Merge If you have multiple devices, first sync data using scripts/sync.py, then merge the daily data.

    # Sync data for all dates and merge daily
    python -m summarize daily merge --sync-all
    
  3. Generate Reports

    # Generate weekly report for a specific week and deploy it to the blog
    python -m summarize weekly generate --week 2026-W12 --deploy
    
    # Generate monthly report for a specific month and deploy it 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 by default (local Qwen3.8-27B), no API key required. To switch, use --api claude_cli or --api anthropic.

2.2 Research: Scientific Research Assistant

This is a powerful academic tool that supports natural language queries, paper deep analysis, scholar profiles, and citation graphs.

1. Natural language search for papers Automatically routed to appropriate data sources (arXiv, PubMed, etc.).

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

2. Generate complete research weekly report Executes the full process: Search -> Three-stage LLM evaluation (fast screening -> deep review -> citation impact) -> Generate report.

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

3. Scholar profile analysis Obtains scholars’ papers and citation data, generating trajectory analysis, scores, and mentor-student relationships.

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

4. Citation graph analysis Analyzes forward citations and backward references based on arXiv ID or DOI.

python tools/research/research_scout.py citations 2301.12597

5. Deploy report to the blog

python tools/research/research_scout.py deploy

2.3 Benchmark: Performance Benchmarking

Measures CPU/GPU FLOPS performance, supports NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU).

Note: Benchmark commands must be executed in the tools/benchmark/ directory.

1. Run all benchmark tests Results are appended to a CSV file (supports cumulative results across multiple hardware).

cd tools/benchmark
python -m benchmark.cli

2. Test only CPU or GPU

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 the blog Publish benchmark results to the /benchmark/ path on the Hugo website.

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

View the report: Access 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 the blog (compression + build + deploy) This is the core command. Executes incremental compression (only processes 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 Start the Hugo development server locally to view drafts and latest changes.

cd tools/website
hugo server -D

Note: -D indicates the inclusion of drafts (Drafts).

3. Translation mechanism The Website tool has a built-in translation engine. During building, it automatically detects bilingual content and calls a local model (default tencent/Hy-MT2-1.8B) for translation.

  • Default backend: ollama
  • Alternative backend: vllm (Linux), transformers (Windows)
  • Models are automatically downloaded, no manual configuration required.

2.5 Translator: Local Document Translation

Provides a Web interface for translating local files (.md, .pdf, .docx, images, etc.), preserving Markdown format.

1. Start the translation service

# 确保已安装 translator 依赖: pip install -e ".[translator]"
python -m translator

After starting, it automatically opens the Gradio interface in the browser.

2. Usage

  1. Open the local address in a browser (usually http://127.0.0.1:7860).
  2. Upload files or enter text.
  3. Select source and target languages (auto automatically detects).
  4. Click translate.
  5. Copy the result or download the translated file.

Advanced Configuration:

  • Model switching: Uses tencent/Hy-MT2-1.8B by default. Can switch via the GUI model management interface or set environment variables GADGET_TRANSLATION_MODEL.
  • Backend switching: Priority to ollama by default. If Ollama is not installed, it automatically falls back to transformers (Windows) or vllm (Linux). Can also be forced via GADGET_TRANSLATION_BACKEND.

Phase 3: Operations and Data Sync

3.1 Data Sync (Rclone)

If developing across multiple devices, you can use the built-in sync script.

# 查看同步状态
python scripts/sync.py status

# 推送本地更改到云端
python scripts/sync.py push

# 从云端拉取最新数据
python scripts/sync.py pull

Configuration is in the config.json section of sync.

3.2 Smoke Test (Smoke Test)

Before running the full process, you can quickly check if the environment is configured correctly (read-only operation, does not consume LLM Token).```bash bash scripts/smoke.sh


### 3.3 Output Directory ManagementAll outputs (logs, reports, charts, caches) are stored in the `outputs/` directory.
*   This directory has been ignored by `.gitignore`.
*   If `outputs/` is removed, all reports can be rebuilt by running the corresponding tool's `generate` command again.

## Frequently Asked Questions (FAQ)

**Q: How to use different LLM backends?**
A: Most tools support the `--api` parameter.
*   `ollama` (default): Local operation, no Key required, recommended Qwen3.8-27B.
*   `claude_cli`: Reuse the login state of Claude Code, no additional API Key needed.
*   `anthropic`: Use Anthropic API Key.
*   `openai`: Use OpenAI API Key.
Global default values can be set via the environment variable `GADGET_LLM_BACKEND`.

**Q: Why is translation 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 not available, the program will fallback to `transformers` (high CPU/memory usage) or `vllm` (GPU).
3.  Check if the `GADGET_TRANSLATION_BACKEND` environment variable points correctly to the backend you installed.

**Q: Did the blog deployment fail?**
A:
1.  Check the Hugo path and Git configuration in `config.json`.
2.  Ensure the `tools/website/public/` directory is a separate Git repository (usually managed automatically by scripts; do not manually `git add` files from this directory into the main repository).
3.  Review the build logs in `outputs/logs/`.

**Q: How to back up?**
A: Your **source code** is in Git. Your **data** (dialog logs, CSV benchmarks, generated reports) are recommended to be outside the `outputs/` directory or synchronized to the cloud via `scripts/sync.py`. The `tokens/` directory contains sensitive information; please back it up by yourself and do not commit it to Git.

---
* Tutorial ends. Enjoy using it! If you have more questions, refer to `TUTORIAL.md` and the documents under each tool directory.*

</details>

<details>
<summary><b>Qwen3.6</b> — 7,847 characters · 28 code blocks · 15/16 facts in README</summary>

Below is the **project summary** and **detailed usage guide** organized based on the provided README content.

---

## Part 1: Project Summary

### 1. What is it?
**Gadget** is a practical toolset for developers, primarily serving daily development workflows. Its core functions include:
*   **AI report generation**: Automatically summarizing AI dialogue records and producing daily/weekly/monthly reports.
*   **Academic research assistance**: Paper discovery, researcher profiling, and citation graph construction.
*   **Performance benchmarking**: Cross-platform (CPU/GPU) performance testing tools.
*   **Blog automation**: Hugo-based blog setup and automatic publishing system, supporting media compression and local translation.
*   **Document translation**: Local document translation web application based on Gradio.

The project uses a modular design, with each tool running independently, sharing underlying infrastructure `common`, and relying on an independent external repository `ai-companion` to provide development workflow and code change tracking functions.

### 2. Repository Structure
```text
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 via hooks into this project.

3. What does each tool do?

Tool Directory Core Function Key Technologies/Stacks
tools/summarize/ AI dialogue report generation:
Reading AI dialogue logs from multiple devices, generating structured daily/weekly/monthly reports. Uses ccusage to count token usage. Supports local Ollama, Claude CLI, Anthropic, OpenAI backends.
Claude/OpenAI API, ccusage 20.x, matplotlib
tools/research/ Academic research assistant:
1. Paper discovery: Searching from arXiv/PubMed and generating weekly reports.
2. In-depth insights: Analyzing article structure, writing strategies, and core knowledge.
3. Researcher profiling: Analyzing researcher trajectories and teacher-student relationships.
4. Citation graph: Analyzing 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), Intel (XPU). Outputs CSV results and interactive HTML rankings, can be deployed to blogs.
PyTorch, NumPy, Plotly
tools/website/ Hugo blog automation:
Blog based on PaperMod theme. Automatically incremental compresses images/videos, local model translation, one-click build and publishing 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) translation. Uses local model inference, no reliance on cloud API.
Gradio, GGUF/transformers/vLLm/Ollama

Part 2: Detailed Chinese Usage Guide

This guide is for users who are encountering this project for the first time. Please follow the instructions in the README strictly.

1. Environment Preparation

Before installation, ensure the following basic environment requirements are met:

  • Python: Version 3.10+. Recommended to use a conda environment AI (conda activate AI).
  • Node.js: Version 18+ (only for the independent ai-companion repository; core tools in this repo mainly rely on Python).
  • Git: Used for cloning code.

Smoke Test: During configuration, you can run the following command for a read-only smoke test to ensure no errors:

bash scripts/smoke.sh

2. Installation and Initialization

Step 1: Clone repository and prepare dependencies

Assume 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 shared infrastructure package (common) and all core tool dependencies: The README indicates common is the foundation, while each tool is installed as extras. To cover summarize, research, benchmark, website, it is recommended to install the all extra package.

    Note: translator is not included in all; it needs to be installed separately.

    # Install common and summarize/research/benchmark/website dependencies
    pip install -e ".[all]"
    
    # If you need to use the Translator tool, extra install:
    pip install -e ".[translator]"
    
  3. Configure AI Companion (workflow engine): Gadget’s development workflow relies on the parent directory ../ai-companion/. Ensure this directory exists and is properly 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 the root directory’s config.json (this file is ignored by gitignore).

    # Copy example config and modify it
    cp config.example.json config.json
    
    • You can specify the configuration file path via the environment variable GADGET_CONFIG.
  2. Manage keys (Tokens): API keys and onboarding information are stored in tokens/ directory (ignored by gitignore, do not commit to Git).

    • API Keys: Place in tokens/ corresponding location.
    • Onboarding Sheet: Fill in tokens/onboard.yaml for one-click machine configuration.
  3. Set LLM backend: Default uses ollama (local, no Key required, uses Qwen3.8-27B). Global switching can be done via the environment variable GADGET_LLM_BACKEND or in config.json. Supported values: ollama, claude_cli, anthropic, openai.

3. Detailed usage of tools

A. Summarize: AI dialogue report generation

Scenario: Automatically summarize AI dialogue from multiple devices, generating daily/weekly/monthly reports. Architecture: Two-phase (export -> merge/generate).

  1. Phase 1: Export un-exported date data

    python -m summarize daily export
    
  2. Phase 2: Sync all dates and merge daily data

    python -m summarize daily merge --sync-all
    
  3. Generate weekly report

    • Specify a particular week (e.g., 2026-W12):
      python -m summarize weekly generate --week 2026-W12 --deploy
      
    • --deploy parameters will publish the report to the Hugo blog.
  4. Generate monthly report

    • Specify a particular month (e.g., 2026-02):
      python -m summarize monthly generate --month 2026-02 --deploy
      
5. **One-click full pipeline** Execute the entire pipeline: export -> merge -> generate weekly/monthly report -> deploy.
python -m summarize auto --deploy

Tip: Backend switching uses --api parameters (such as --api openai), specifically supporting ollama, claude_cli, anthropic, and openai.

B. Research: Academic research assistant

Entry command: python tools/research/research_scout.py

  1. Complete pipeline: paper search and report generation

    python tools/research/research_scout.py report --project my-project
    # Process: search -> three-stage evaluation (quick filter -> deep evaluation -> citation impact) -> generate report
    
  2. Search papers in natural language

    python tools/research/research_scout.py ask "Find the latest robot operation papers by Pieter Abbeel"
    # Automatically route to appropriate sources (arXiv/PubMed, etc.)
    
  3. Generate researcher profiles

    python tools/research/research_scout.py profile "Sergey Levine"
    # Includes research trajectory analysis and teacher-student relationship mining
    
  4. View citation graphs

    python tools/research/research_scout.py citations 2301.12597
    # Analyze forward/backward citations via arXiv ID or DOI
    
  5. Deploy report to blog

    python tools/research/research_scout.py deploy
    

Tip: Also supports --api for backend switching. For in-depth analysis of paper content, use --insight parameter (specific usage can be found in source documentation; README only lists the 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 CSV without overwriting old data.

    python -m benchmark.cli
    
  2. Only CPU tests

    python -m benchmark.cli --cpu-only
    
  3. Only GPU tests 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 /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 publish to GitHub Pages (macOS/Linux) This script performs incremental media compression, Hugo build, and push.

    bash update.sh
    
  3. Build and publish to GitHub Pages (Windows)

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

Important warning: tools/website/public/ is an independent deployment repository. Do not directly commit to this directory via git; it is automatically managed by scripts.

E. Translator: Document translator

Scenario: Translate Markdown, PDF, etc. files via Web UI while preserving formatting.

  1. Start the Gradio interface

    python -m translator
    # Browser will open automatically (or access localhost:7860)
    
  2. Configure default model Uses tencent/Hy-MT2-1.8B by default; automatically downloads on first run. Can be overridden via environment variable GADGET_TRANSLATION_MODEL.

  3. Backend switching Default priority is Ollama. On Windows, revert to transformers; on Linux, configure vLLm or GGUF.

4. Operations and maintenance (Scripts)

Sync

Used for syncing data generated by summarize/website/research across multiple devices.

# 推送数据
python scripts/sync.py push

# 拉取数据
python scripts/sync.py pull

# 查看状态
python scripts/sync.py status

*Configured in config.json section of sync. Requires rclone setup first. *

Onboarding for new machines

If using a new machine, run after filling in tokens/onboard.yaml:

python scripts/onboard.py

This will automatically complete SSH, CLI authentication, pip dependency installation, and rclone bootstrap.

Server-level one-click deployment

System installation for Ubuntu servers (Claude Code, Codex, etc.) is available in 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 notes

  • All generated files are located in outputs/ directory (logs, reports, cache, etc.). This directory is included in .gitignore.
  • Do not commit:
    • Anything under outputs/.
    • Keys under tokens/.
    • tools/website/public/ (it is an independent repository).
    • build/ and gadget.egg-info/.
    • Data synced via rclone.
  • LLM backend switching: Global switching is possible via GADGET_LLM_BACKEND environment variable, or using --api parameter in 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, more CLI parameters), please refer to TUTORIAL.md or README.md under each tool directory.

Claude Code · Haiku 4.5 — 11,235 characters · 27 code blocks · 15/16 facts in README

Complete Guide to Gadget Project

1. Project Summary

1.1 Project Overview

Gadget is an open-source toolset that gathers practical tools accumulated from daily development. It includes the following functions:

  • AI daily report generation — Automatically count AI conversation records across multiple devices and generate weekly/monthly reports.
  • Paper discovery — Search from academic databases, evaluate papers, and analyze researchers and citation networks.
  • Performance benchmarking — Cross-platform FLOPS tests for CPU/GPU.
  • Blog automation — Hugo static site with incremental media compression and automatic deployment.
  • Document translation — Local inference Gradio translator that supports text and 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 Functionality of each tool

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

1.4 Infrastructure

  • common/ — Shared capabilities for LLM calls, disk caching, translation engine, Hugo deployment, etc.
  • scripts/ — Data sync (sync.py), machine initialization (onboard.py), LLM services (serve_local_llm.sh), etc.
  • ai-companion/ — Separate Node.js repository (in ../ai-companion/), provides code change tracking and all Claude Code skills

2. Detailed usage guide

2.1 Environment preparation

System requirements

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

Create a Python environment

# 使用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 public 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 using a new machine, use automated scripts to complete all configurations:

# 编辑初始化配置表
# 打开 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 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

Translation for 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 of each tool

2.4.1 Summarize — AI conversation daily/weekly/monthly report

Function: Automatically extract token usage and conversation content from AI conversation records across multiple devices, generating structured daily, weekly, and monthly reports.Workflow:

  1. Export unexported conversation records on each device (Phase 1)
  2. Sync via cloud drive or manually copy the aggregation (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)
  • claude_cli (reuse Claude Code CLI)
  • anthropic (requires ANTHROPIC_API_KEY)
  • openai (requires OPENAI_API_KEY)

Detailed 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: 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 tutorial: See TUTORIAL.md — Research and tools/research/TUTORIAL.md


2.4.3 Benchmark — Performance benchmark testing

Function: Cross-platform CPU/GPU FLOPS benchmark testing, supporting various hardware and precision levels.

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 accumulated into CSV (append mode, never overwritten)
  • Supports generating interactive HTML reports (Plotly)
  • Supports publishing to Hugo website
  • Supports submitting to public leaderboards

Detailed step tutorial: See TUTORIAL.md — Benchmark and tools/benchmark/tutorial.md


2.4.4 Website — Hugo blog automation

Function: 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 compress files changed after .last_build)
  • Local bilingual translation (default Ollama, vLLM alternative for Linux, transformers alternative for Windows)
  • Automatic translation, compression, building, and pushing

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

Automatic content processing:

  • Daily/weekly/monthly reports, research papers, benchmark pages, charts, etc. are directly written into tools/website/content|static by the release processes of each tool
  • All automatically generated files are marked with gadget_generated
  • Handwritten files (without marks) will never be 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 submit directly to this directory

Detailed step tutorial: See TUTORIAL.md — Website and tools/website/CLAUDE.md


2.4.5 Translator — Gradio document translator

Function: Local inference document translator, supporting text and various file formats.

Features:

  • Local web pages with Google Translate-style translation
  • Supported formats: .md / .txt / .pdf / .docx / images
  • Preserves Markdown format (code blocks, URLs, Hugo shortcodes, etc. are protected)
  • Local inference, no cloud API calls

Prerequisite dependencies:

pip install -e ".[translator]"

Start 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

Function:

  • Source language can be set to auto (automatically detected via text’s CJK ratio)
  • Automatically switches between Chinese and English when target language is auto

Detailed 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.

# 查看帮助
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 in the repo root directory config.json
  • Overwrite configuration path: GADGET_CONFIG environment variable
  • Coverage: summarize / website / research / benchmark / backups / dag (DAG website generation + publishing)

2.6 Output directory structure

All generated files are stored in the outputs/ directory (gitignoreed, can be automatically rebuilt):

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

Hugo website content directly written into tools/website/content|static (no separate output hierarchy directory).


2.7 Common tips and considerations

Quick reference of environment variables

# 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

Checklist for first use

  • Environment preparation (Python 3.10+, conda/venv)
  • Install dependencies pip install -e ".[all]"
  • Create config.json (copied from config.example.json)
  • Prepare API key (placed in config.json or environment variable)
  • Run smoke test bash scripts/smoke.sh
  • Select a tool to start using

Handling 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 through the ai-companion repository ../ai-companion/:

  • Code change tracking
  • Claude Code planning/execution skills
  • All domain skills (summarize, optimize, etc.)

No additional configuration is needed; automatically integrated via hooks. For deeper understanding, see ../ai-companion/scripts/install.ts.


2.9 Quick start example

Scenario 1: Generate the AI conversation weekly report for this week

# 激活环境
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 for using Gadget from scratch. According to your specific needs, choose the appropriate tool and use it with the above commands. If you have any questions, refer to TUTORIAL.md and source documentation for each tool.

Codex · GPT-5.6-Sol — 11,731 characters · 61 code blocks · 16/16 facts in README

1. Project summary

1. What is Gadget

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

  • Generation of daily, weekly, and monthly AI conversation records
  • Paper discovery, in-depth 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 and can be used separately. They all rely on the common/ package in the repository root directory. common/ provides general capabilities such as LLM invocation, JSON repair, disk caching, atomic writing, local translation, and Hugo deployment.

The development workflow and Claude Code skills of the project are not in this repository but in a separate repository ../ai-companion/ in adjacent directories, accessed via hooks under .claude/ and .codex/.

The project uses 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:

Goal Location
Modify a tool tools/<tool>/
Modify common capabilities such as LLM, caching, translation, Hugo deployment common/
Modify data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Modify the development workflow or skills ../ai-companion/
View design and execution plans docs/, docs/ecl/

3. What each tool does

Summarize

Reads AI conversation records in Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON format, and generates structured daily, weekly, and monthly reports.

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

  1. Export conversation records on each device.
  2. Aggregate via cloud drive sync or manual copy, then generate reports daily.

When a certain number of reports accumulate, weekly and monthly trend summaries can also be generated further.

It uses ccusage 20.x command statistics for different agent CLI token usage and costs, such as ccusage claude, ccusage codex, ccusage gemini.

Four LLM backends are supported:

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

Research

A unified academic research toolkit, entry is:

tools/research/research_scout.py

It has four main capabilities:- Research report generation: Search for papers on arXiv, bioRxiv, and PubMed, and generate a research weekly report through the three-stage LLM process of “quick filtering → deep evaluation → citation impact”, which can be published on Hugo.

  • Deep paper insight: Download the full text of papers, analyze their writing structure, publication strategies, and reusable knowledge; match OpenReview comments, and analyze the consensus and disputes in reviews; finally, synthesize a cross-paper writing guide.
  • Researcher profile: Obtain paper and citation data from ArXiv and Semantic Scholar, generate analysis of research trajectories and hierarchical scoring, and infer the mentor–student relationship through personal profiles and co-author patterns.
  • Citation graph: Use the Semantic Scholar API to analyze forward citations and backward references, and then let the LLM interpret the impact of the papers.

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

Benchmark

A cross-platform CPU/GPU FLOPS floating-point performance testing tool that supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

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

Supported precision includes:

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

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

Results are written to CSV in append mode and do not overwrite existing results, allowing data from multiple hardware devices to be accumulated and a leaderboard to be formed. The tool can also generate interactive HTML reports using Plotly and publish them on Hugo websites 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:

  • Compressing only media files that change after .last_build
  • Compressing images with pngquant
  • Compressing videos with HandBrakeCLI
  • Generating bilingual content using local models
  • Automatically building the Hugo website
  • Automatically submitting and pushing to GitHub Pages deployment repositories

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

tools/website/content
tools/website/static

The automatically generated files carry the gadget_generated tag. Handwritten 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 submitted manually there.

Translator

A local document translation web application based on Gradio, with a interface similar to Google Translate.

Translation is supported for:

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

It will preserve the Markdown format as much as possible and protect fragments such as code blocks, URLs, and Hugo shortcodes.

Translation is completely done locally; no cloud LLM API is used. It automatically selects a backend through common.engine.create_engine():

  • Ollama is preferred when the corresponding model has been pulled
  • Windows falls back to transformers
  • vLLM is preferred on Linux
  • llama.cpp/GGUF can be used in low memory scenarios

The default model is:

tencent/Hy-MT2-1.8B

The GGUF version is:

tencent/Hy-MT2-1.8B-GGUF

The model will be automatically downloaded the first time it is used. After loading, the model remains in memory, and loading is delayed when switching models as needed.

When the source language is set to auto, it is automatically detected 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. Public modules and operation scripts

common/

A public Python package that provides:

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

scripts/

Main scripts include:

  • sync.py: Sync summarize, website, research, benchmark, and backups data using rclone, and also supports generating and deploying DAG sites.
  • onboard.py: One-time initialization for a new machine, 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 information, and import, without calling LLM, network, or performing writing.
  • serve_local_llm.sh: Create an Ollama model variant suitable for summarize and output environment variables.
  • language.py: Hugo bilingual content auditing and renaming of summarize reports.
  • profile_translation.py: Translation engine GPU profiler.

AI Companion

../ai-companion/ is an independent Node.js/TypeScript repository that provides:

  • Function-level code change records
  • Testing and HTML report generation
  • /idea/ccplan/ccedit planning and execution process
  • Claude Code and Codex integration
  • Skills such as optimization, debugging, auditing, cleaning, and paper writing

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


2. Tutorial for the first use of Gadget

The following tutorial is strictly limited to the information and commands given in the README. The more detailed configuration fields, data formats, and FAQ in the README are placed in TUTORIAL.md and the tutorials of each tool itself, so no ungiven 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 independent AI Companion repository:

../ai-companion/

There is no requirement to install Node.js in the README for running only the Python tools of Gadget.

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: Benchmarking
  • Gradio, GGUF/transformers: Translator

Specific tool dependencies can also be checked in the requirements.txt of each tool directory.

2. Installation

The following commands should be executed in the root directory of the Gadget repository, unless explicitly instructed to switch directories 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 root directory of the repository may generate:

build/
gadget.egg-info/

They are build artifacts and have been added to gitignore; they should not be committed.

Installing all extras for the 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 extra includes torch and transformers required for website translation.

3. Basic configuration

Root configuration file

The main settings of all tools are located in the root directory of the repository:

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 copying commands or content for each field, so config.json should be created manually referring to the example file.

If you need 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.

The backend can also be selected through 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 the specific variable names or configuration fields for Anthropic and OpenAI keys, so do not guess on your own; refer to the project tutorial or configuration example.

Translation configuration

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

GADGET_TRANSLATION_MODEL

The translation backend can be selected through the following variables:

GADGET_TRANSLATION_BACKEND

Default model:

tencent/Hy-MT2-1.8B

The model will be automatically downloaded the first time it is used.

Token and initialization configuration

API keys and new machine initialization tables are placed in:

tokens/

The initialization table is:

tokens/onboard.yaml

tokens/ has been added to gitignore; do not commit its content at all.

The README states: fill in tokens/onboard.yaml and run scripts/onboard.py to complete the one-time machine configuration at the repository level, including:

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

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

4. Tutorial for using Summarize

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 process, exporting all dates that have not been exported yet.

Each device with AI conversation records should execute this stage.

Step 2: Synchronization and daily merging

python -m summarize daily merge --sync-all

This command synchronizes data from all dates and merges them daily to generate a daily report.

Generating weekly reports for a specified week

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

Where:

  • 2026-W12 represents the 12th week of 2026.
  • --deploy represents deployment after generation.

Generating monthly reports for a specified month

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

Where:- 2026-02 indicates February 2026.

  • --deploy indicates generation followed by deployment.

One-click execution of the full process

python -m summarize auto --deploy

It will complete sequentially:

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 the specific parameters of the old entry point, so the parameters of the new entry point should not be assumed as those of the old entry point.

5. Research usage tutorial

The unified entry point for Research is:

python tools/research/research_scout.py

Full paper search and report process

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

This command executes:

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

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

Searching papers with natural language

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

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

Generating 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
  • mentor–student relationship discovery
  • name ambiguity resolution
  • reverse lookup

The specific output fields are not expanded in the README.

Analyzing paper citation graphs

Using arXiv ID:

python tools/research/research_scout.py citations 2301.12597

The README indicates that this location also supports DOI, but no example format for DOI is provided, so no examples are fabricated additionally.

The analysis includes:

  • Forward citations
  • Backward references
  • Influence interpretation driven by LLM

Deploying reports to Hugo

python tools/research/research_scout.py deploy

Deep paper insights

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

  • Download full paper texts
  • Analyze writing structures
  • Analyze publication strategies
  • Extract reusable core knowledge
  • Match OpenReview
  • Analyze review consensus and disputes
  • Generate a research writing guide comprehensively

But the README does not provide the complete --insight command combination, so it should not be guessed as which subcommand it should follow. When using it, refer to tools/research/TUTORIAL.md.

6. Benchmark usage tutorial

All Benchmark commands must first enter their directory:

cd tools/benchmark

Execute all benchmarks

python -m benchmark.cli

The results will be appended to CSV without overwriting existing results.

Only test CPU

python -m benchmark.cli --cpu-only

Only test GPU

python -m benchmark.cli --gpu-only

The tool will automatically detect:

  • CUDA
  • Apple MPS
  • Intel XPU

Execute testing and generate HTML report

python -m benchmark.cli --report

The report uses Plotly to generate interactive charts.

Execute testing, generate report, and deploy

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

The report will be published on the Hugo website:

/benchmark/

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

7. Website usage tutorial

Install website dependencies

Run in the root directory of the repository:

pip install -e ".[website]"

macOS/Linux: Build and publish

cd tools/website && bash update.sh

This process will execute:

  • Incremental compression of modified images and videos
  • Local bilingual translation of models
  • Hugo build
  • Submit and push to GitHub Pages deployment repository

Windows: Build and publish

Run in the root directory of the repository:

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

The Windows script will automatically switch to its own directory, and cd tools/website does not need to be executed in advance.

Local preview

cd tools/website && hugo server -D

-D will make the local development server contain draft content.

Notes on website files

Automatically generated content is written directly:

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 commit or directly modify the deployment repository:

tools/website/public/

It is automatically committed and pushed by the build script.

8. Translator usage tutorial

Install dependencies

pip install -e ".[translator]"

Start the translation interface

python -m translator

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

In the interface:

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

The default model will be automatically downloaded during the first run.

When setting the source language to auto, the tool will detect the language based on the CJK character ratio; when setting the target language to auto, it will automatically translate inversely between Chinese and English.

9. Data synchronization

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

View the synchronization tool entry point:

python scripts/sync.py

Push and pull across devices use respectively:

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

The README also states that sync.py supports:

status
bootstrap
config

as well as summarize, website, research, benchmark, backups, and special dag categories, but no complete command combinations for these operations are provided, so parameters are not expanded here.

10. Local Summarize Ollama environment

The startup and environment variable loading commands provided in the README are:

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

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

Long-term configuration items should be written in the summarize section of the root directory config.json, or can be pointed to other configurations using GADGET_CONFIG.

11. Running a read-only smoke test

bash scripts/smoke.sh

This check only executes:

  • --help
  • --info
  • Python import check

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

12. Where to place the output file

All reconstructable outputs are placed uniformly 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 temporarily stored via outputs/site, but written directly:

tools/website/content
tools/website/static

13. Things to note when using

  • Do not submit the API key or onboarding configuration in tokens/.
  • Do not submit the automatically generated files in outputs/.
  • Do not submit build/ and gadget.egg-info/.
  • Do not submit data synchronized by rclone.
  • Do not directly submit the deployment repository or theme repository under tools/website/.
  • config.json is the local configuration file, which should be created from config.example.json.
  • Translator is not included in .[all]; .[translator] must be installed separately.
  • Website and translation functions use local inference models; tencent/Hy-MT2-1.8B may need to be downloaded during the first run.
  • More detailed configuration fields, data formats, troubleshooting, and --insight usage are not fully demonstrated and should be checked in the repository TUTORIAL.md and tool tutorials; this README alone cannot provide reliable information.
Codex · GPT-5.6-Terra — 6,622 characters · 42 code blocks · 15/16 facts in the README

Project overview

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

  • Generation of daily, weekly, and monthly reports for AI conversation records
  • Searching academic papers, researcher analysis, and citation graphs
  • CPU/GPU performance benchmark tests
  • Automatic build, media compression, and publishing of Hugo blogs
  • Document translation driven by local models

Each directory under tools/ is a standalone tool; the common/ in the root directory provides shared capabilities, such as LLM invocation, caching, JSON parsing, atomic writing, translation engines, and Hugo deployment. Development processes and Claude Code skills are not in this repository but in independent repositories ../ai-companion/ in the same directory.

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 打包与依赖配置

Generation results are uniformly placed in outputs/:

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

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

Purpose of each tool

Tool Purpose
summarize Read conversation records from Claude Code, Codex, Cursor Agent, ChatGPT, or general JSON, generate daily, weekly, and monthly reports, and count token usage and costs for each Agent CLI.
research Find papers from sources such as arXiv, bioRxiv, PubMed; perform deep paper insights, researcher profiles, inference of mentor–student relationships, 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 incremental image/video compression, automatic translation, build, and push to GitHub Pages.
translator Local document translation web page based on Gradio, capable of translating text, Markdown, TXT, PDF, DOCX, and images, while trying to preserve Markdown format.

Usage tutorial

1. Environment preparation

The basic environment specified in the README is:

  • Python 3.10+
  • It is recommended to use a Conda environment AI
  • Node.js 18+: only when using the ../ai-companion/ repository of the same level is required
  • Website and translation functions require a local inference engine: Ollama is preferred; vLLM can be used on Linux, and transformers can be used on Windows
  • The translation model tencent/Hy-MT2-1.8B will be automatically downloaded during the first use

If using Conda:

conda activate AI

Tool settings are in the root directory config.json; the README states that they should be copied from config.example.json. This configuration file can be overridden by environment variables:

GADGET_CONFIG

Do not commit the following to Git:

- The API key and initialization table within `tokens/` - `outputs/` - `build/` - `gadget.egg-info/` - The deployment repository and theme repository under `tools/website/` - Automatically generated content and data synchronized via rclone

2. Installing Dependencies

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

pip install -e ".[all]"

Note: all does not include a translator. Install a translator separately if needed:

pip install -e ".[translator]"

If only using website features:

pip install -e ".[website]"

Each tool directory also contains the corresponding requirements.txt, which can be referred to when required.

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

Support switching via the --api parameters of each tool, or global settings:

GADGET_LLM_BACKEND

The translation function uses a local inference backend, and can be selected through the following environment variables:

GADGET_TRANSLATION_BACKEND

The default selection order given in the README is:

ollama → llamacpp / vllm / transformers

The default model is:

tencent/Hy-MT2-1.8B

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

GADGET_TRANSLATION_MODEL

4. Using the Dialogue Summary Tool: Summarize

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

  1. Export dialogue logs on each device.
  2. Sync or manually copy aggregated data via cloud storage, and merge by date.
  3. Generate a daily report, followed by weekly and monthly reports.

Export all dates that have not been exported yet:

python -m summarize daily export

Sync all dates and merge them daily:

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 a complete one-click process from export, merging, to weekly, monthly reports and deployment:

python -m summarize auto --deploy

The old entry 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 the token usage and costs of various Agent CLI through the ccusage 20.x source command. Optional LLM backends are ollama, claude_cli, anthropic, and openai.


5. Using the Research Paper Tool: Research

The unified entry is:

python tools/research/research_scout.py

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

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

Search papers in natural language; the tool automatically routes to appropriate data sources:

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

Generate an image of a researcher:

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 research reports into 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: download full texts via --insight and analyze writing structure, publishing strategies, and reusable knowledge, while matching OpenReview review comments.
  • Researcher profiles: generate research trajectories, ratings, and relationship inferences by combining ArXiv and Semantic Scholar paper and citation data.
  • Citation graphs: perform forward citation and reference analysis using Semantic Scholar API, interpreted by an LLM for impact assessment.

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 benchmark tests:

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

Generate a report and publish it to /benchmark/ in Hugo:

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

This tool supports actual GPU testing for NVIDIA CUDA, Apple Silicon MPS, and Intel XPU; OpenCL can only appear in --info detection. Results are written to CSV in append mode, without overwriting existing data, making it suitable for summarizing scores from multiple machines.


7. Using the Hugo 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 corresponding scripts on Windows:

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

Start the Hugo preview server locally and include draft content:

cd tools/website && hugo server -D

The website automatically handles the following tasks:

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

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


8. Using the Document Translator: Translator

Install the translator:

pip install -e ".[translator]"

Start the Gradio graphical interface:

python -m translator

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

Translation support includes:

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

The translator protects code blocks, URLs, Hugo shortcodes, and other segments 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 automatically switches between Chinese and English.


9. Operations and Synchronization Scripts

View or execute centralized rclone data synchronization:

python scripts/sync.py

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

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

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

One-time initialization process for a new machine:

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

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

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

bash scripts/smoke.sh

Create an Ollama variant for summarize and output environment configuration:

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

If you need to install SSH keys, Claude Code, Codex, Superpowers, Ponytail, and AI Companion on a Ubuntu 22.04/24.04 server at the system level, refer to the scripts in the same repository for help:

bash ../ai-companion/scripts/onboard-server.sh --help
Codex · GPT-5.6-Luna — 7,667 characters · 53 code blocks · 16/16 facts in README

1. Project Summary

1. What is Gadget

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

  • Generation of AI dialogue daily reports, weekly reports, and monthly reports
  • Research paper discovery and researcher analysis
  • CPU/GPU performance benchmark tests
  • Automatic build and publication of Hugo blogs
  • Local model-driven document translation

Each subdirectory tools/ is a standalone tool. The common/ in the repository root directory provides shared capabilities, including:

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

The development process, 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:

Goal Directory
Modify a 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. Features of Each Tool

summarize

Read AI dialogue records from sources such as Claude Code, Codex, Cursor Agent, and ChatGPT, and call an LLM to generate:

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

It uses a multi-device two-stage workflow:

  1. Each device exports dialogue records
  2. Aggregate data and generate reports by date

At the same time, ccusage statistics on the token usage and costs of different Agent CLI are performed.

Four LLM backends are supported:

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

research

Research tool, including four types of capabilities:

  • Paper discovery: search arXiv, bioRxiv, PubMed, and perform a three-stage LLM evaluation
  • Deep paper insights: analyze writing structure, publishing strategies, core knowledge, and OpenReview review comments
  • Researcher profiles: combine ArXiv and Semantic Scholar data to analyze research trajectories, citation patterns, and mentor-student relationships
  • Citation graphs: analyze forward citations and backward references in papers

benchmark

Cross-platform CPU/GPU floating-point performance testing tool.

Supported:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

Multiple precision levels are supported, including FP64, FP32, FP16, BF16, and experimental FP8.

Results are written to CSV in append mode, without overwriting historical data; interactive HTML reports and leaderboards can also be generated.

website

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

Main functions:- Incremental compression of images and videos

  • Automatic translation of bilingual content
  • Automatic building of Hugo websites
  • Automatic submission and push to deployment repository
  • Receiving automatically generated content such as daily reports, weekly reports, research reports, and benchmark pages

Website content is written into:

tools/website/content
tools/website/static

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

translator

A local document translator based on Gradio, supporting:

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

It will protect Markdown code blocks, URLs, and Hugo shortcodes. The local model tencent/Hy-MT2-1.8B is used by default, and the GGUF version is also supported.

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

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

4. common/, scripts/ and outputs/

common/

A shared Python package that is installed for all tools, including LLM, caching, IO, translation, and Hugo deployment functions.

scripts/

The main scripts include:

  • sync.py: Use rclone to sync data
  • onboard.py: Initialization of new machines
  • smoke.sh: Perform read-only smoke checks for all tools
  • serve_local_llm.sh: Create an Ollama model variant suitable for summarize
  • language.py: Check Hugo bilingual content
  • profile_translation.py: Analyze the GPU performance of the translation engine

outputs/

All generated outputs are centralized here:

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

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


2. Chinese Usage Tutorial

1. Environment Preparation

Project requirements:

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

The README recommends using a conda environment named AI:

conda activate AI

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

../ai-companion/

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

2. Install Basic Dependencies

Execute in the root directory of the repository:

pip install -e .

This will install the shared common/ package from the root directory in an editable mode.

If you want to install dependencies for summarize, research, benchmark, and website, you can execute:

pip install -e ".[all]"

Note: all does not include the translator.

Install translator dependencies:

pip install -e ".[translator]"

If you need website functionality, 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 indicates that this file is ignored by Git; you should copy it from:

config.example.json

Then configure it later.

You can also specify other configuration file paths through environment variables:

GADGET_CONFIG

API Key and initialization configuration are placed at:

tokens/

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

The LLM backend can be uniformly selected through --api:

  • ollama
  • claude_cli
  • anthropic
  • openai

It can also be set through global environment variables:

GADGET_LLM_BACKEND

The translation backend can be controlled through:

GADGET_TRANSLATION_BACKEND

The translation model can be overridden through:

GADGET_TRANSLATION_MODEL

4. Initialization of New Machines

The project provides a one-time initialization script. The README requires filling in:

tokens/onboard.yaml

Then run:

python scripts/onboard.py

This script will automatically handle:

  • SSH configuration
  • Claude/Codex CLI installation and authentication
  • pip extras installation
  • ai-companion installation
  • Tool configurations
  • 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 Sync and Basic Checks

The project uses rclone for cross-device data sync. Check the sync script for help:

python scripts/sync.py

Sync data:

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

Run read-only smoke checks:

bash scripts/smoke.sh

This check will verify help information, information detection, and import for each tool; it does not call the LLM, access the network, or write data.


3. Usage Methods of Each Tool

1. Summarize: Generate AI Dialogue Reports

Daily Report Process

First stage: Export all dates that have not been exported yet:

python -m summarize daily export

Second stage: Sync all dates and merge them day by day:

python -m summarize daily merge --sync-all

Generate weekly reports for a specified week and deploy them to Hugo:

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

Generate monthly reports for a specified month and deploy them to Hugo:

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

One-click execution of the full process

python -m summarize auto --deploy

This command executes:

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

The old 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 the local Ollama by default, and also supports:

ollama
claude_cli
anthropic
openai

The specific backend can be switched through the --api parameter.

2. Research: Paper Search and Researcher Analysis

Generate research project reports

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

This process will perform paper search, three-stage evaluation, and generate a report.

Use natural language to search for papers

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

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

Generate researcher profiles

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

It will obtain paper and citation data and generate research trajectory analysis.

Analyze paper citation graphs

python tools/research/research_scout.py citations 2301.12597

The parameter can be arXiv ID or DOI.

Deploy research reports

python tools/research/research_scout.py deploy

The LLM backend of Research also supports:

ollama
claude_cli
anthropic
openai

It can be uniformly switched through --api.

3. Benchmark: Run CPU/GPU Performance Tests

The README specifically states: All Benchmark commands need to enter the directory first:

cd tools/benchmark

Run all benchmark tests:

python -m benchmark.cli

The results will be appended to 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 a report, and deploy to Hugo:

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

The tools will automatically detect CUDA, Apple MPS, and Intel XPU. OpenCL may only appear in --info detection results, but it does not mean that an OpenCL benchmark test will be executed.

4. Website: Build and Preview Hugo Websites

Install website dependencies:

pip install -e ".[website]"

macOS/Linux: Build and publish

cd tools/website && bash update.sh

This process includes:

  1. Incremental compression of media files
  2. Execution of Hugo build
  3. Push 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 that the preview includes drafts.

Automatically generated content in the website is directly written into:

tools/website/content
tools/website/static

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

5. Translator: Start the Local Document Translator

Install translator dependencies:

pip install -e ".[translator]"

Start the Gradio graphical interface:

python -m translator

After starting, a browser will open.

The translator supports text and the following files:

.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 automatically downloaded when used for the first time. The translator defaults to using the local Ollama; on Linux, vLLM can be used, and on Windows, transformers can be used back, and it also supports paths for GGUF/llama.cpp with low memory.

The source language can be set to auto, and the target language can be set to auto, and an automatic switch between Chinese and English will occur.


4. Common Precautions

  • Files in outputs/ are automatically generated and should not be submitted.
  • tokens/ contains keys and initialization information and cannot be submitted.
  • build/ and gadget.egg-info/ are build files generated during installation.
  • Do not submit tools/website/public/ or website themes, deployment repository directly.
  • Cross-device sync requires configuring rclone first.
  • Website and translation functions rely on local inference engines and use Ollama by default.
  • ../ai-companion/ is an independent repository responsible for the development workflow and skills.
  • The project uses the GPL-3 license.
Codex · GPT-5.5 — 8,517 characters · 57 code blocks · 16/16 facts in README

The following content is based only on the README you provided; commands or parameters not mentioned in the tutorial will not be added.

1. Project Summary

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

Its core design is that each directory under tools/ is an independent tool; the common/ in the repository root directory is a shared infrastructure package installed via pip install -e ., providing general capabilities such as LLM invocation, JSON parsing, disk caching, atomic writing, translation, and Hugo deployment for all tools. The development workflow and Claude Code skills are not in this repository but provided by an independent repository in a neighboring directory ../ai-companion/ and accessed through 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 to store generated results collectively:

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

Hugo website content is not written into outputs/site initially but directly written into tools/website/content|static by the deployment process.

**Functions of Each Tool**

tools/summarize/: AI Dialogue Report Generation Tool.
It automatically reads AI dialogue records such as Claude Code, Codex, Cursor Agent, ChatGPT, and general JSON, and calls an LLM to generate daily reports, weekly reports, and monthly trend summaries. It supports multi-device workflows: each device exports dialogue logs, which are synchronized via cloud storage or manually copied and aggregated, before the final report is generated. Through ccusage, version 20.x, it counts the token usage and costs of each agent CLI. The LLM backend can be switched via --api, including ollama, claude_cli, anthropic, and openai.

tools/research/: Academic Research Tool.
The unified entry is tools/research/research_scout.py, providing four types of capabilities: paper discovery, deep paper insights, researcher profiles, and citation graph analysis. It supports arXiv, bioRxiv, PubMed, Semantic Scholar, and uses an LLM to perform screening, evaluation, impact analysis, writing structure analysis, and research trajectory analysis.

tools/benchmark/: CPU/GPU Performance Benchmarking Tool.
It measures floating-point performance across different hardware and precision levels, supporting actual GPU operations on NVIDIA CUDA, Apple Silicon MPS, and Intel XPU. Results are appended to a CSV file, and it can generate Plotly interactive HTML reports and leaderboards, as well as support deployment on Hugo websites.

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

tools/translator/: Gradio Document Translator.
Based on common translation engine, it provides local translation web pages similar to Google Translate. It supports text and .md, .txt, .pdf, .docx, and image file translations, trying to preserve Markdown format while protecting code blocks, URLs, and Hugo shortcodes. The default model is tencent/Hy-MT2-1.8B, with a GGUF variant tencent/Hy-MT2-1.8B-GGUF.

common/: Shared Infrastructure.
It provides unified LLM invocation, 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.
Including 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, and profile_translation.py translation engine GPU profiling.

../ai-companion/: Independent Repository.
It does not belong to the gadget repository本体. It is responsible for function-level code change records, test and HTML report generation, /idea/ccplan/ccedit planning and execution processes, as well as Claude Code skills.


2. Chinese Usage Guide

1. Environment Preparation

The basic requirements listed in the README are as follows:

# Python 版本要求
Python 3.10+

It is recommended to use a conda environment AI:

conda activate AI

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

Node.js 18+

Specific dependencies for each tool can be found in the corresponding directory under requirements.txt.

If you need to install all extras of common, summarize, research, benchmark, and website, you can run them in the root directory of the repository:

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 indicates that Ollama is used by default; vLLM is available on Linux, and transformers can be used as a fallback on Windows. The model tencent/Hy-MT2-1.8B will be automatically downloaded during the first run.

2. Configuration Preparation

Tool configurations are located in config.json in the root directory of the repository, and this file is gitignored. The README indicates 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 --api parameters of each tool. The optional backends mentioned in the README are:

ollama
claude_cli
anthropic
openai

You can also use global environment variables:

GADGET_LLM_BACKEND

The translation backend is controlled by the following environment variables:

GADGET_TRANSLATION_BACKEND

The README indicates that the translation path uses the local Ollama server by default, and later llamacpp / vllm / transformers can be used. The translation model can be overridden by the following environment variables:

GADGET_TRANSLATION_MODEL

The API key and onboarding table are located in tokens/ directory, which is gitignored. The README specifically reminds not to submit its content.

3. Installation

Install the shared packages and main tool dependencies in the root directory of the repository:

pip install -e ".[all]"

If you want to use the document translator, install the translator extras:

pip install -e ".[translator]"

If you only need the website function, the installation command given 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 is to fill in:

tokens/onboard.yaml

Then run:

python scripts/onboard.py

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

Server system-level 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, which requires rclone configuration.

The general operation method given 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

The configuration is located in config.json section of the root directory sync, and can also be overridden via GADGET_CONFIG for the configuration path.

If you only want to synchronize data, the README clearly states in the repository structure section:

python scripts/sync.py

6. Summarize: AI Dialogue Daily Reports, Weekly Reports, Monthly Reports

It is recommended to use the new module entry for this tool:

python -m summarize

The typical process is as follows.

Export all dates that have not been exported yet:

python -m summarize daily export

Sync all dates and merge them 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

Generate and deploy a monthly report for a specific month:

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

Execute the full process with one click: export, merge, weekly report, monthly report, and deployment:

python -m summarize auto --deploy

The old entry 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 via --api. The values listed in the README include:

ollama
claude_cli
anthropic
openai

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

The unified entry is:

python tools/research/research_scout.py

Run the full paper discovery process: 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 sources:

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 clearly states that all benchmark commands need to enter tools/benchmark/ first:

cd tools/benchmark

Run all benchmarks, and the results are appended to a CSV file:

python -m benchmark.cli

Run only CPU:

python -m benchmark.cli --cpu-only

Run only GPU:

python -m benchmark.cli --gpu-only

Run the benchmark and generate an HTML report:

python -m benchmark.cli --report

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

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

The README indicates that this tool will automatically detect 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 the website dependencies:

pip install -e ".[website]"

In macOS/Linux, incremental compression, Hugo build, and push to GitHub Pages:

cd tools/website && bash update.sh

In Windows, run PowerShell scripts; 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 states:

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

Automatically generated content is written to:

tools/website/content
tools/website/static

Files marked with gadget_generated can be managed by an automatic process; handwritten files without this mark will not be overwritten.

10. Translator: Gradio Document Translator

Install the translator dependencies:

pip install -e ".[translator]"

Start the Gradio GUI:

python -m translator

After starting, it opens an interface in the browser.

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

.md
.txt
.pdf
.docx
images

Default model:

tencent/Hy-MT2-1.8B

GGUF variant:

tencent/Hy-MT2-1.8B-GGUF

The model can be overridden by environment variables:

GADGET_TRANSLATION_MODEL
GADGET_TRANSLATION_MODEL

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

11. Smoke Check and Local LLM-assisted Script

Run the read-only smoke check:

bash scripts/smoke.sh

The README indicates that this script will check the --help, --info, and imports of each tool, without triggering LLM, network, or writing operations.

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

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

The persistent configuration is placed in the config.json section of the repository root directory summarize, and the path can also be overridden using GADGET_CONFIG.

12. Usage Notes

Do not submit the following content:

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

The README clearly states:

  • tokens/ Save API keys and onboarding sheet; gitignored, do not submit.
  • outputs/ Save all generated files; 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.
Codex · GPT-5.4-Mini — 6,730 characters · 22 code blocks · 15/16 facts in README

The following is organized solely based on README.md you posted, without additional commands, parameters, or behaviors beyond 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, each directory can be used separately, while common capabilities are encapsulated in the common/ package in the root directory.

Its coverage mainly includes:

  • Generation of AI dialogue daily/weekly/monthly reports
  • Paper discovery and researcher analysis
  • CPU/GPU performance benchmarking
  • Automated Hugo blog publishing
  • Document translation

There is also an important prerequisite: the development workflow and Claude Code skills are not in this repository, but in a separate repository ../ai-companion/ nearby, accessed 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 dialogue records and generates daily/weekly/monthly summaries.
  • tools/research/: Performs paper search, researcher profiling, and citation relationship analysis.
  • tools/benchmark/: Conducts cross-platform CPU/GPU performance testing and generates reports.
  • tools/website/: Automated Hugo blog building, compression, and publishing.
  • tools/translator/: Gradio document translator, supporting text and file translation.

common/ is a basic library shared by all tools, providing:

  • LLM invocation
  • JSON parsing and fixing
  • Disk caching
  • Atomic writing
  • Translation engine
  • Hugo deployment

scripts/ contains some ops scripts:

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

Newbie Usage Guide

The following is written according to “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 nearby ../ai-companion/ repository
  • ../ai-companion/ is an independent repository, not within the current repository
  • Specific dependencies needed are based on requirements.txt in each tool directory

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

2. Installation

The installation methods provided in the README have three levels:

pip install -e .

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

If you need to install additional dependencies for most tools, you can use:

pip install -e ".[all]"

The README indicates:

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

If you need a translator, install it separately:

pip install -e ".[translator]"

Both website translation function and 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
  • The model tencent/Hy-MT2-1.8B will be automatically downloaded during the first run

3. Configuration

The configuration points mentioned in the README are as follows:

  • There is config.json in the root directory
  • config.json is gitignored by default
  • Can be copied from config.example.json
  • The configuration file path can be overridden using GADGET_CONFIG

In terms of environment variables:

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

tokens/ directory:

  • Stores API keys and onboarding table
  • Also gitignored
  • Cannot be submitted

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 configuration, and rclone bootstrap

The README does not expand on the full command details here, so I only keep the explicitly written content without adding additional commands.


4. Typical Usage of Each Tool

4.1 summarize: AI Dialogue Daily/Weekly/Monthly Report

This tool will automatically read your daily AI dialogue records and support:

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

It will also combine ccusage 20.x multi-source commands to count tokens and costs.

The recommended commands given in the README are:

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, according to the README, it is export → merge → weekly → monthly + deploy

Swordable LLM backends:

  • ollama, default
  • claude_cli
  • anthropic
  • openai

The README also mentions that the old entry is 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 for this tool is:

python tools/research/research_scout.py

The typical commands given in the README are:

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 respectively:

  • report: Full process, search → three-stage evaluation → report
  • ask: Natural language search, automatic routing of data sources
  • profile: Researcher profiling
  • citations: Citation graph analysis, supporting arXiv ID / DOI
  • deploy: Deploy the report in Hugo

同样支持 switching LLM backends:

  • ollama
  • claude_cli
  • anthropic
  • openai

4.3 benchmark: Performance Benchmarking

The README emphasizes that 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 respectively:

  • Default: Run all benchmarks, results appended to CSV
  • Only CPU
  • Only GPU
  • Run benchmarks and generate HTML report
  • Generate report and publish in Hugo’s /benchmark/

The README also indicates that it supports:

  • NVIDIA CUDA
  • Apple Silicon MPS
  • Intel XPU

And some 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]"

Building and publishing:

  • 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 indicates:

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

4.5 translator: Gradio Document Translator

Install dependencies:

pip install -e ".[translator]"

Start the GUI:

python -m translator

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

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

The README specifically mentions:

  • It preserves Markdown format
  • Protects code blocks, URLs, Hugo shortcodes
  • It is local inference, not cloud API
  • The default model is tencent/Hy-MT2-1.8B
  • It can also be modified via GADGET_TRANSLATION_MODEL or model management inside 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 states that it is responsible for rclone synchronization, covering:

  • summarize
  • website
  • research
  • benchmark
  • backups
  • There is also a dag category

smoke.sh:

bash scripts/smoke.sh

This is a read-only smoke test, without LLM, network, or writing functionality.

serve_local_llm.sh:

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

The README indicates that it will create a Ollama variant optimized for summarize and output environment variables.

ai-companion-related server onboarding:

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

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


6. A Shortest Onboarding Process

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

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

If using a translator, add:

pip install -e ".[translator]"

Then select the 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 prefer, I can next organize this content into a “more formal document” style Chinese manual, in three versions:

  1. A long-form version suitable for beginners
  2. A concise version suitable for project documentation
  3. A reordered version by “Installation / Configuration / Usage / Common Issues”
Claude Code · Opus 5 — 12,340 characters · 24 code blocks · 16/16 README facts

1. Project Summary

What is it

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

The development workflow (planning/execution/changelog 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 same directory ../ai-companion/, and 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 . (already in gitignore, always located at the repository root).

Where to go for changes:

What you want to change Where to go
Change the logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / caching / translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
Configure a new machine once scripts/onboard.py
Change the development workflow / skills ai-companion repository (same level ../ai-companion/)
Read plans / design documents docs/ecl/, docs/

What each tool does

tools/summarize/ —— AI dialogue daily/weekly/monthly reports

Automatically reads daily AI dialogue records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls the LLM API to generate structured daily, weekly, and monthly reports. Multi-device workflow: each device exports dialogue logs → synchronized via cloud drive or manually copied summary → final daily report generated; after a certain amount of reports are accumulated, weekly and monthly trend summaries are generated. Using ccusage 20.x commands named by source namespace([ccusage claude, ccusage codex, ccusage gemini…) automatically discovers and counts the token usage and costs of all agent CLI commands. Four AI summarization backends, uniformly switched using --api. Key technologies: Claude/OpenAI API, ccusage 20.x (multi-source unification), matplotlib.

tools/research/ —— Paper discovery and researcher 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, follow a three-stage LLM pipeline (quick screening → deep evaluation → citation impact), generate weekly research reports and deploy them into Hugo. Supports search for conference papers and author searches.
  • Deep paper insights([--insight): Download full paper texts, let the LLM analyze their writing structure, publishing strategy, and reusable core knowledge; automatically match OpenReview to obtain review comments, analyze consensus and disputes; synthesize research writing guidelines across papers.
  • Researcher profiles: Fetch paper and citation data from ArXiv + Semantic Scholar, let the LLM generate research trajectory analysis, calculate tier scores, and automatically discover teacher-student relationships through主页 extraction + co-authorship patterns. Supports name-based disambiguation and reverse lookup.
  • Citation graph analysis: Forward citation / backward reference analysis based on Semantic Scholar API, combined with LLM-driven impact interpretation.

tools/benchmark/ —— Performance benchmarking suite

Cross-platform CPU/GPU FLOPS benchmarking tools, uniformly measure floating-point performance across different hardware vendors and precision levels. Supports actual GPU operations on NVIDIA(CUDA), Apple Silicon(MPS), Intel(XPU) (OpenCL may only appear in --info detection), covering FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Measurements use preheating + formal measurement + statistical analysis (median, IQR outlier removal), and explicit GPU synchronization to ensure accurate timing. Results are accumulated in append mode into CSV (never overwritten, naturally supports multi-hardware cumulative leaderboards), can generate interactive HTML reports with Plotly charts and leaderboards, 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 use pngquant, videos use HandBrakeCLI) and local model bilingual translation (default Ollama, vLLM on Linux / transformers on Windows as fallback; models tencent/Hy-MT2-1.8B automatically downloaded on first run, without relying on cloud LLM API). The automatically generated content (daily/weekly/monthly reports, research reports, benchmark pages, images) are directly written into tools/website/content|static(the only Hugo content root, files marked with gadget_generated; handwritten files without marks never overwrite), then translated, compressed, built, and pushed.

⚠️ tools/website/public/ is an independent deployment repository([tzj2006/tzj2006.github.io), automatically submitted + pushed by the build script — do not submit directly.

tools/translator/ —— Gradio document translator

Gradio document translator based on common translation engine: a local web page in Google Translate style for translating text and files([.md / .txt / .pdf / .docx / images), while preserving Markdown format (code blocks, URLs, Hugo shortcodes and other segments are protected). It runs local inference instead of cloud API: common.engine.create_engine() is reused to automatically select the backend (model tag pulled when ollama; transformers is Windows fallback, vllm, llamacpp is low memory GGUF option), model remains in memory (warm), and lazy loading occurs when switching models. Default model 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 model management within the GUI. Source language can be set to auto(detected by text CJK ratio); when target language is auto, it flips between zh↔en.

common/ —— Shared infrastructure package

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

  • LLM invocation (unified two-layer API, supports ollama(default)/ claude_cli / anthropic / openai four backends)
  • JSON parsing and repair
  • SHA-256 disk caching (namespace + TTL)
  • Atomic writing and content hash
  • 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); there is a special dag category for generating and deploying DAG sites). Configured as the config.json section at the repository root sync (the GADGET_CONFIG can be used for path overriding).

  • onboard.py —— Repository-level one-time machine initialization: fill a YAML table (tokens/onboard.yaml), run a script once, which 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 checks covering all tools (--help / --info / import); does not involve LLM, network, or writing.
  • serve_local_llm.sh —— Create an Ollama variant optimized for summarize and print environment variables. Persistent switches are placed in the config.json section of the repository root summarize.
  • Others: language.py(Hugo bilingual audit + renaming of summarize reports), profile_translation.py(translation engine GPU profiler).

../ai-companion/ —— Independent repository

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

It is packaged as both a standard Claude Code plugin and an equivalent Codex integration — installed immediately, no build required (the change-tracking hook is a pre-built single-file product submitted with the repository). All skills (methodologies: ccplan planning, optimize optimization, cchypothesis debugging, repo-audit, repo-tidy; domains: summarize code overview, slurm-gpu cluster detection, nature-benchmark / NIPS-2025-paper paper writing advisor) are in that repository; the skills/ directory is no longer present in this repository. Installation can be found at ../ai-companion/scripts/install.ts.

outputs/ —— Output directory

All generated outputs are placed uniformly in outputs/(gitignore, can be automatically rebuilt):

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

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


2. Usage Guide (for first-time users)

This guide covers only the content mentioned in the README. For step-by-step operations, configurations, data formats, and FAQs of each tool, please refer to TUTORIAL.md in the repository and the source documents of each tool.

Step 0: Environment Preparation

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

Activate the recommended environment:

conda activate AI

Step 1: Installation

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

pip install -e ".[all]"

⚠️ Note: all does not include translator; it needs to be installed separately:

pip install -e ".[translator]"

If you only want to use a specific tool, you can 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 at the repository root (gitignore, normal behavior).

Step 2: Configuration

Tool configuration file: The config.json section at the repository root (gitignore), copied from config.example.json:

cp config.example.json config.json

If you want a different path, set environment variables for overriding:

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

The sync section is the configuration for scripts/sync.py, and the summarize section is the persistent switch for scripts/serve_local_llm.sh.

API key: Place it in the tokens/ directory (gitignore, do not commit its content).

LLM backend selection: All LLM functions are switched using the --api parameters, with four values:

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

You can also set it globally using environment variables:

export GADGET_LLM_BACKEND=ollama

Translation backend: The translation uses a local inference engine, selected by GADGET_TRANSLATION_BACKEND: ollama (default when the model is downloaded, uses local Ollama server) → llamacpp / vllm / transformers (within the process), with the model being 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 on a new machine

After filling in the tokens/onboard.yaml YAML table, run it once:

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 install of SSH public key, Claude Code, Codex, Superpowers, Ponytail, and AI Companion) has been migrated to the ai-companion repository:

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

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

Step 4: Run a smoke check first

Read-only, does not involve LLM/network/writing, used to confirm installation:

bash scripts/smoke.sh

Tool 1: Summarize —— AI dialogue daily/weekly/monthly reports

It is recommended to use the python -m summarize format. The typical process is two-stage: first export on each device, 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, synchronize via cloud storage or manually copy logs together, then run daily merge --sync-all to generate the final daily report; after enough daily reports are collected, generate weekly reports and monthly trend summaries.

Switch the AI summary backend:

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

If you want to use the optimized variant of summarize from local Ollama:

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

The old entry points 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

A single CLI 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

For deep insights, use --insight; 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 benchmark testing

⚠️ All commands need to first go through 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/

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

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 audit and renaming of summarize reports:

python scripts/language.py

Two critical rules to remember:

  1. tools/website/public/ is an independent deployment repository, automatically pushed by the build script — do not submit directly.
  2. Automatically generated files are marked with gadget_generated; handwritten files without the mark will never be overwritten — so handwritten content is safe, but do not add that mark 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. Select auto for the source language, which will automatically detect the CJK proportion of the text; select auto for the target language, which will flip between Chinese and English. You can switch 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

The model is automatically downloaded during first use, and all operations are performed locally, without using cloud API.

--infoUI wiring can be found in tools/translator/app.py, translation and file logic in tools/translator/core.py, shared engine in common/engine.py and common/translation.py. For details, see TUTORIAL.md#translator.

Cross-device Data Synchronization

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

Sub-commands include push / pull / status / bootstrap / config. Categories cover summarize / website / research / benchmark / backups. There is also a special dag category used to generate and deploy DAG sites. rclone must be configured first; the configuration is in the sync section of config.json.

Common Precautions (Must Follow)

  • tokens/ stores API keys and onboarding tables, already in gitignore — never submit any content from it.
  • All generated files are output to outputs/, already in gitignore.
  • Never git add: automatically generated content, data synchronized by rclone, build artifacts (build/, gadget.egg-info/), and deployment and theme repositories under tools/website/.
  • Read AGENTS.md(the workflow protocol for all AI agents) before using them.
  • This project is licensed under GPL-3 (see LICENSE).
Claude Code · Sonnet 5 — 5,754 characters · 13 code blocks · 16/16 README facts

Project Summary

Gadget is a collection of practical tools accumulated during daily development, covering five categories: generating AI dialogue daily reports, paper discovery, performance testing, 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 as ../ai-companion/). They are accessed through hooks under .claude/ and .codex/.

What Each Tool Does

Tool Function Key Technologies
summarize Reads daily AI dialogue records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), calls LLM to generate structured daily/weekly/monthly reports; uses ccusage 20.x to count token usage and costs of each Agent CLI Claude/OpenAI API, ccusage 20.x, matplotlib
research Provides paper discovery (three-stage LLM pipelines for arXiv/bioRxiv/PubMed), in-depth paper analysis --insight (including OpenReview matching), researcher profiles (including relationship mining), and citation graph analysis through a unified CLI research_scout.py arXiv/bioRxiv/PubMed, Semantic Scholar, LLM
benchmark Cross-platform CPU/GPU FLOPS testing, supporting NVIDIA/Apple Silicon/Intel, multi-precision (FP64~FP8), results are accumulated into CSV, can generate HTML reports and be deployed 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 common translation engine, supports text and files (.md/.txt/.pdf/.docx/pictures), preserves Markdown format, local inference Gradio, GGUF/transformers

All LLM functions can switch the backend through --api: ollama (default, no key required locally), claude_cli (reuses Claude Code login state), anthropic, openai.


Usage Guide

1. Environment Preparation

  • Python 3.10+ (it is recommended to use a conda environment AI)
conda activate AI
  • Node.js 18+ (only when using the same repository ../ai-companion/)
  • GPU testing automatically detects CUDA / Apple MPS / Intel XPU
  • tokens/ directory stores API keys and onboarding configuration tables, already in gitignore, do not submit

2. Installation

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

pip install -e ".[all]"

If you need the translator, install it separately:

pip install -e ".[translator]"

If you need the website tools (including torch + transformers for translation):

pip install -e ".[website]"

3. Configuration

Tool configurations are stored in the root directory of the repository config.json (already in gitignore, copied from config.example.json), and can be overridden via environment variables GADGET_CONFIG.

One-time configuration for a new machine:

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

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

System-level installation on a server (Ubuntu 22.04/24.04), migrated to the ai-companion repository:

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

4. Typical Usage of Each Tool

1. Summarize —— AI Dialogue 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                                  # 一键全流程:导出→合并→周报→月报+部署

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

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 Testing

Note: All commands need to be cd tools/benchmark/ first.

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 on first use), and can be overridden via environment variables GADGET_TRANSLATION_MODEL or model management in the GUI.

5. Common Operations Scripts

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/ (subdirectory logs/reports/cache/data/images/backups), already in gitignore, can be automatically rebuilt.
  • The LLM backend can be switched via --api parameters or global environment variables GADGET_LLM_BACKEND: ollama (default), claude_cli, anthropic, openai
  • The translation backend is selected by GADGET_TRANSLATION_BACKEND: default ollama (when the model is downloaded) → llamacpp/vllm/transformers
  • Cross-device data synchronization: python scripts/sync.py push/pull (requires rclone configuration)
  • Never git add automatically generate content, data synchronized by rclone, build artifacts (build/, gadget.egg-info/) and deployment/theme repositories under tools/website/
  • License is GPL-3 (see LICENSE)
  • For more detailed step-by-step instructions, configuration items, data formats, and FAQs, refer to TUTORIAL.md and the documentation in each tool’s directory
Cursor · Composer 2.5 — 10,088 characters · 17 code blocks · 16/16 README facts

Gadget Project Summary and Usage Guide

The following content is based solely on the README you provided, without adding any commands or parameters not mentioned in the README.


1. Project Summary

1. What is this?

Gadgets is a collection of practical tools accumulated during daily development, covering:

  • Generating AI dialogue daily/weekly/monthly reports
  • Paper discovery and research analysis
  • Performance benchmarking
  • Blog automation
  • Document translation

Features:

  • Each directory under tools/ is a standalone tool
  • Shared capabilities are concentrated in the repository root directory’s common/ package (installed via pip install -e .), including LLM calls, JSON parsing, disk caching, atomic writing, translation, Hugo deployment, etc.
  • The development workflow (planning/execution/changelog tracking) and all Claude Code skills are provided by the independent repository ai-companion (located in the same directory ../ai-companion/), accessed through hooks

More detailed step-by-step instructions, configurations, data formats, and FAQs can be found in TUTORIAL.md and each tool’s own documentation.


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/ 与各工具的打包配置

Where to go for changes:

Goal Location
Change the logic of a specific tool tools/<tool>/
Change shared capabilities (LLM / caching / translation / Hugo deployment) common/
Change data synchronization scripts/sync.py
One-time configuration for a new machine scripts/onboard.py
Change the development workflow / skills ../ai-companion/
Read plans / design documents docs/ecl/, docs/

Other Notes:- build/, gadget.egg-info/ generated by pip install -e . and gitignoreed

  • Data synchronization: python scripts/sync.py
  • Chinese version documentation: docs/README.zh.md

3. Overview of Tools

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 benchmarks PyTorch, NumPy, Plotly
tools/website/ Hugo blog (incremental media compression + automatic build and publishing) Hugo, pngquant, HandBrakeCLI
tools/translator/ Gradio document translator Gradio, GUF/transformers
common/ Shared infrastructure package pip install -e .
scripts/ Ops scripts (sync, onboard, etc.) rclone, Python
../ai-companion/ AI change tracking + planning/execution skill pipeline Node.js, TypeScript

4. What Each Tool Does

Summarize — AI conversation daily/weekly/monthly reports

  • Automatically reads daily AI conversation records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON)
  • Calls LLM to generate structured daily, weekly, and monthly reports
  • Multi-device workflow: Each device exports conversations → synchronized to cloud disk or manual copy → merged to generate reports → accumulated to produce weekly/monthly reports
  • Automatically discovers and counts token usage and costs of each agent CLI via ccusage 20.x
  • LLM backend: --api, ollama (default), claude_cli, anthropic, openai

Research — Paper discovery and analysis

Unified entry tools/research/research_scout.py: Four major capabilities:

  1. Paper discovery: Search in arXiv / bioRxiv / PubMed, three-stage LLM pipeline (fast screening → deep evaluation → citation impact), generate research weekly reports and deploy them on Hugo; supports search for conference papers and author searches
  2. Deep paper insights --insight: Download full texts, analyze writing structure/ publication strategy/reusable knowledge; match with OpenReview to get review comments; synthesize cross-paper writing guides
  3. Researcher profiles: ArXiv + Semantic Scholar data, LLM generates research trajectory analysis and hierarchical scoring; extract relationships and co-authorship patterns via homepage; supports name disambiguation and reverse lookup
  4. Citation graph analysis: Based on Semantic Scholar forward/backward reference analysis + LLM impact interpretation

Benchmark — Performance benchmark suite

  • Cross-platform CPU/GPU FLOPS benchmarks
  • 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 on Hugo or submitted to public leaderboards

Website — Hugo blog

  • Static blog “TzJ’s Net” (PaperMod theme), deployed on GitHub Pages: https://tzj2006.github.io/
  • Incremental image/video compression (pngquant, HandBrakeCLI)
  • Local model bilingual translation (default Ollama; fallback to vLLM on Linux, transformers on Windows; model tencent/Hy-MT2-1.8B automatically downloaded on first run)
  • Automatically generates content written into tools/website/content|static (marked with gadget_generated, handwritten files not overwritten)
  • tools/website/public/ is an independent deployment repository tzj2006/tzj2006.github.io, automatically committed + pushed by build script, do not commit directly

Translator — Gradio document translator

  • Local inference web interface based on common translation engine
  • Supports text and files .md / .txt / .pdf / .docx / images, preserves Markdown format
  • Backend automatic selection:优先 ollama, fallback transformers on Windows, priority vllm on Linux, low memory option llamacpp
  • Default model tencent/Hy-MT2-1.8B; can be overridden by GADGET_TRANSLATION_MODEL or GUI
  • Source language auto detected by CJK ratio; target auto switches between zh↔en

5. common / scripts / ai-companion

common/: LLM invocation, JSON parsing and fixing, SHA-256 disk cache, atomic writing, local translation engine, Hugo cross-platform deployment.

scripts/ Main scripts:

Script Purpose
sync.py rclone data synchronization (push/pull/status/bootstrap/config)
onboard.py One-time configuration on new machine
smoke.sh Read-only smoke test (--help / --info / imports)
serve_local_llm.sh Create Ollama variant optimized for summarize and print environment variables
language.py Hugo bilingual audit + rename summarize report
profile_translation.py Translation engine GPU performance analysis

ai-companion: Independent Node.js repository, provides code change tracking, planning/execution pipeline, all Claude Code skills; installation see ../ai-companion/scripts/install.ts.


2. Detailed Chinese Usage Guide (First Time)

Step 0: Understand Output and Configuration Location

Output directory (gitignored, can be rebuilt):

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

Hugo site content directly written into tools/website/content|static (no separate outputs/site).

Configuration:

  • Tool settings: Repository root directory config.json (gitignored; copied from config.example.json)
  • Available environment variables GADGET_CONFIG override configuration path
  • API key and onboarding table: 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 by ../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 the same --api switch: ollama (default), claude_cli, anthropic, openai
  • Also available via environment variables GADGET_LLM_BACKEND

Translation backend:

  • Environment variable GADGET_TRANSLATION_BACKEND
  • Default ollama (when model is already pulled); also llamacpp / vllm / transformers
  • Default model tencent/Hy-MT2-1.8B, automatically downloaded on first run

Local LLM (related to summarize):

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

Persistent parameters written in the config.json section summarize (can be overridden by GADGET_CONFIG for path).


Method A — Configuration on this repository machine:

  1. Fill in tokens/onboard.yaml
  2. Run:
python scripts/onboard.py

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

Method B — System-level installation on Ubuntu 22.04/24.04 server:

Moved to ai-companion repository:

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

Requires input --companion-repo git@github.com:TzJ2006/ai-companion.git (no need for --companion-ref).

Smoke test (read-only, no disk writing, no LLM tuning, no internet):

bash scripts/smoke.sh

Step 3: Data synchronization (multi-device / multi-machines)

python scripts/sync.py
  • Configuration in repository root config.json section sync
  • Can be overridden by GADGET_CONFIG
  • Example of cross-device synchronization:
python scripts/sync.py push
python scripts/sync.py pull

(Requires rclone configuration.)


Step 4: Summarize — AI conversation daily/weekly/monthly 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 usable, compatible with shim):

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

Detailed steps see TUTORIAL.md#summarize and tools/summarize/tutorial.md.


Step 5: Research — Paper discovery and 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

LLM backend also uses --api: ollama (default), claude_cli, anthropic, openai.See TUTORIAL.md#research and tools/research/TUTORIAL.md for detailed steps.


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

See TUTORIAL.md#benchmark and tools/benchmark/tutorial.md for detailed steps.


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 (independent deployment repository, handled automatically by scripts).
  • Do not git add generate content automatically, use rclone to sync data, build/, gadget.egg-info/, and the deployment/theme repository under tools/website/.

See TUTORIAL.md#website and tools/website/CLAUDE.md for detailed steps.


Step 8: Translator — Gradio Documentation Translation

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

Open the Gradio GUI in the browser after starting. See TUTORIAL.md#translator for detailed instructions; implementation details are in tools/translator/app.py, tools/translator/core.py, common/engine.py, and common/translation.py.


Step 9: Other Common Ops 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 (Summary of README Notes)

Item Description
GPU Benchmarking Automatically detects CUDA / Apple MPS / Intel XPU
tokens/ Store API keys and onboarding tables, do not commit
outputs/ All generated files are git-ignored
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 Referenced in README)

  • General Tutorial: TUTORIAL.md
  • Chinese Version: docs/README.zh.md
  • Summary: 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 based solely on the README and the workflow. If you need detailed steps for a specific tool (e.g., multi-device process for Summarize or --insight for Research), you can switch to Agent mode, and I can write a more detailed tutorial using TUTORIAL.md from the repository.

Cursor · Grok 4.6 High — 11,015 characters · 14 code blocks · 16/16 README facts

All below are based solely on the README you provided; commands and parameters not mentioned are excluded.


1. Project Summary

What is it?

Gadgets is a collection of practical tools accumulated during daily development, covering five types of capabilities:

  • AI dialogue daily/weekly/monthly report generation
  • Paper discovery and researcher analysis
  • Performance benchmarking
  • Blog automation
  • Document translation

Each directory under tools/ contains independent-useable tools. Common capabilities are concentrated in the common/ package at the root of the repository (installed via pip install -e .), including LLM invocation, JSON parsing, disk caching, atomic writing, translation, and Hugo deployment.

Development workflows (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). They should be placed in the sibling directory ../ai-companion/ and accessed through hooks in this repository.

This README provides an overview; detailed operations, configurations, data formats, and FAQs can be found in TUTORIAL.md and the source documents of each tool. The Chinese README is available 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 .)

Additional notes (original README):

  • Workflow engine and skills are in ../ai-companion/, accessed through hooks under .claude/ and .codex/.
  • build/ and gadget.egg-info/ are generated by pip install -e . and are git-ignored, always located at the root of the repository.
  • Data sync: python scripts/sync.py.
What you want to change Where
Logic of a specific tool tools/<tool>/
Shared capabilities (LLM / cache / translation / Hugo deployment) common/
Data sync scripts/sync.py
One-time configuration for new machines scripts/onboard.py
Development workflow / skills ai-companion (../ai-companion/)
Reading plans / design documents docs/ecl/, docs/

What each tool does

tools/summarize/
Automatically reads daily AI dialogue records (Claude Code / Codex / Cursor Agent / ChatGPT / general JSON), and calls LLM to generate structured daily/weekly/monthly reports. Two-phase multi-device: each device exports first, then the reports are aggregated via cloud storage or manual copy before being generated; after enough reports are collected, weekly and monthly trends are produced. Through ccusage 20.x command by source (ccusage claude, ccusage codex, ccusage gemini…) automatically detect and count token usage and costs of each agent CLI. Four summary backends, unified with --api switching: ollama (default, local, no key, Qwen3.8-27B), claude_cli (reuses Claude Code CLI login state, no API key), anthropic, openai.

tools/research/
Unified research toolkit, single entry tools/research/research_scout.py, four capabilities:

  1. Paper discovery: Search from arXiv / bioRxiv / PubMed, three-phase LLM pipeline (quick filtering → deep evaluation → citation impact), generate weekly research reports and deploy them to Hugo; supports conference paper search and author search.
  2. In-depth paper insights --insight: Download full text, analyze writing structure, publication strategy, reusable core knowledge; automatically match OpenReview reviews; combine cross-paper research writing guidelines.
  3. Researcher profiles: Pull papers and citations from ArXiv + Semantic Scholar, LLM generates research trajectory analysis and computational grading scores, extract relationships via homepage extraction + co-authorship mode; supports name ambiguity resolution and reverse search.
  4. Citation graph analysis: Forward citation/backward reference analysis based on Semantic Scholar API, combined with LLM for impact interpretation.

LLM also uses --api switching, four backends same as summarize.

tools/benchmark/
Cross-platform CPU/GPU FLOPS benchmarking, uniformly measures floating-point performance across different hardware vendors and precision levels. Actual GPU operation supports NVIDIA (CUDA), Apple Silicon (MPS), Intel (XPU) (OpenCL may only appear in --info detection). Precision covers FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Measurement process: preheating + formal measurement + statistical analysis (median, IQR to eliminate outliers), and explicit GPU synchronization to ensure accurate timing. Results are written in append mode to CSV (not overwritten, naturally supports multi-hardware cumulative rankings), can generate interactive HTML reports with Plotly charts and rankings, and can be deployed to Hugo or submitted to public rankings.

tools/website/
Hugo static blog site (“TzJ’s Net”, PaperMod theme), deployed to GitHub Pages https://tzj2006.github.io/. Built-in incremental image/video compression (only compressed media changed since .last_build): images use pngquant, videos use HandBrakeCLI), and local model bilingual translation (default Ollama; fallback to vLLM or transformers on Linux; model tencent/Hy-MT2-1.8B automatically downloads on first run, no cloud LLM API used). Each tool’s deployment pipeline directly writes the generated content into tools/website/content|static (only Hugo content root; marked with gadget_generated; handwritten files without this mark 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 submit directly.

**tools/translator/** A Gradio document translator based on the `common` translation engine: a local web page equivalent to Google Translate, translating text and files (`.md` / `.txt` / `.pdf` / `.docx` / images), while preserving Markdown format (code blocks, URLs, Hugo shortcodes, and other segments are protected). Local inference, no cloud API usage. The backend is automatically selected via `common.engine.create_engine()` (prioritize `ollama` when pulling model tags; fallback to `transformers` for Windows; prefer `vllm` for Linux; use `llamacpp` for low memory GGUF), and the model remains in memory (warm), with lazy loading only when switching models. The default model is `tencent/Hy-MT2-1.8B` (GGUF variant `tencent/Hy-MT2-1.8B-GGUF`), automatically downloaded for first use, and can be managed via `GADGET_TRANSLATION_MODEL` or the GUI model management. The source language can be set to `auto` (detected based on CJK text proportion); when the target is `auto`, it flips between zh↔en.

common/
A shared layer dependent on all tools: a unified two-layer LLM API (four backends), JSON parsing and repair, SHA-256 disk cache (namespace + TTL), atomic writing and content hash, local inference translation engine and bilingual content generation, cross-platform Hugo deployment.

scripts/
Operational scripts: rclone data synchronization, new machine onboarding, read-only smoke testing, local LLM environment, Hugo bilingual auditing, translation engine GPU profiler, etc.

../ai-companion/ (independent repository)
Records function-level code changes, generates tests and HTML reports, provides a planning-execution pipeline /idea/ccplan/ccedit, and hosts all Claude Code skills. It also packages as standard Claude Code plugins and equivalent Codex integrations for immediate use. This repository no longer includes the skills/ directory.

outputs/
All generated files are centralized here (already gitignore, can be automatically rebuilt): logs/, reports/, cache/, data/, images/, backups/. Hugo site content is written directly into tools/website/content|static, without a separate outputs/site staging tree.


2. Usage Guide for First-Time Users

2.1 Environment Preparation

Requirements given in the README:

  • Python 3.10+ (recommended conda environment AI)
  • Node.js 18+ (only required for the independent repository ../ai-companion/)
  • Specific dependencies of 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, transformers on Windows); the model tencent/Hy-MT2-1.8B is automatically downloaded for first run

Activate the recommended environment:

conda activate AI

Also read the AGENTS.md (workflow protocol for all AI agents before starting) and CLAUDE.md (Claude Code repository guide) in the root directory of the repository. More detailed step-by-step instructions are in TUTORIAL.md.

2.2 Installation

Install the shared package common/ and tool extras in the root directory of the repository.

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]"

Only install dependencies related to the website (including torch + transformers for translation):

pip install -e ".[website]"

pip install -e . will generate build/ and gadget.egg-info/ in the root directory of the repository (already gitignore).

Installation of ai-companion is shown in ../ai-companion/scripts/install.ts. It serves as both a Claude Code plugin and Codex integration; installation is ready for use without building.

2.3 Configuration

Repository-level configuration

  • Tool settings are in config.json of the root directory of the repository (already gitignore).
  • Copy from config.example.json and modify.
  • Paths can be overridden using the environment variable GADGET_CONFIG.

Keys and onboarding table

  • tokens/ stores API keys and the onboarding table, already gitignore — never commit its contents.

One-time configuration for new machines (this repository)

  1. Fill in 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 moved to ai-companion: ../ai-companion/scripts/onboard-server.sh. After repository splitting, --companion-repo is directly transferred to the ai-companion repository (git@github.com:TzJ2006/ai-companion.git), no need for --companion-ref. Usage:

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

LLM backend (global)

Use --api to switch: ollama (default), claude_cli, anthropic, openai. Can also be globally specified via the environment variable GADGET_LLM_BACKEND.

Translation backend / models

  • Backend selected by GADGET_TRANSLATION_BACKEND: ollama (default when models are pulled, uses local Ollama service) → llamacpp / vllm / transformers (within process).
  • Model: tencent/Hy-MT2-1.8B; translator can also use GADGET_TRANSLATION_MODEL or manage the model within the GUI.

Cross-device data synchronization

需要先 configure rclone. Configuration is in config.json of the root repository sync section (paths can also be overridden using GADGET_CONFIG).

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

The README indicates that sync.py overrides categories such as summarize / website / research / benchmark / backups, and there is a special dag category (generating and deploying DAG sites); sub-commands include status / bootstrap / config.

Contents not to be committed

Do not commit: git add: automatically generated content, rclone data synchronization, build artifacts (build/, gadget.egg-info/), deployment/theme repositories under tools/website/. All generated files are in outputs/ (already gitignore). License is GPL-3 (see LICENSE).

Read-only smoke check after installation (no LLM call, no internet, no file writing):

bash scripts/smoke.sh

Local Ollama variant used by summarize (print environment variables for eval):

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

Permanence knob is written in config.json of the root repository summarize section (paths can also be overridden using GADGET_CONFIG).

Other operational scripts: language.py (Hugo bilingual auditing + summarize report renaming), profile_translation.py (translation engine GPU profiler).


2.4 Typical Usage of Tools

Summarize: AI daily/weekly/monthly reports

Multi-device process: Each device exports unexported dates first → synchronize and merge by day → collect enough data before generating weekly/monthly reports. Recommended new entry point python -m summarize (old entries python tools/summarize/daily_summary.py ... / weekly_summary.py / monthly_summary.py are still available, but compatible with additional export layers).

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

LLM backend switched using --api (ollama / claude_cli / anthropic / openai). More detailed steps are in the Summarize section of 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 capability is marked in --insight in the README, but no complete copyable command line is provided. LLM also uses --api to switch among four backends. More detailed steps are in the Research section of TUTORIAL.md and tools/research/TUTORIAL.md.

Benchmark: Performance benchmark suite

Note: All commands must first enter cd via tools/benchmark/. GPU automatically detects CUDA / Apple MPS / Intel XPU. Results are written to CSV in append mode, without overwriting.

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). More detailed steps are in the Benchmark section of TUTORIAL.md and tools/benchmark/tutorial.md.

Website: Hugo blog

Content generation is written by the deploy pipelines of each tool into tools/website/content|static, then translated, compressed, built, and pushed. tools/website/public/ is a standalone deployment repository; builds are automatically committed and pushed by the build script, do not commit directly.

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                   # 本地预览(开发服务器,含草稿)

More detailed steps are in the Website section of TUTORIAL.md and tools/website/CLAUDE.md.

Translator: Gradio document translator

Local inference, default model automatically downloaded for first use. Source language can be set to auto; when the target is auto, it flips between zh↔en.

`cd````bash 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 are in `tools/translator/core.py`, and the shared engine is in `common/engine.py` and `common/translation.py`.

---

### 2.5 Recommended First-Time Setup Order

Strictly follow the path that can be traced in 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`; keep the key only in `tokens/` and do not submit it.
3. For new machines: fill in `tokens/onboard.yaml`, run `scripts/onboard.py`. New Ubuntu servers 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. Do a read-only smoke test with `bash scripts/smoke.sh`.
6. Use a single tool according to the commands in each section above; cross-device data use `python scripts/sync.py push` / `pull` (requires rclone).
7. Modify the tool logic to `tools/<tool>/`, modify shared capabilities to `common/`, and modify workflows/skills to `../ai-companion/`.

For more step-by-step operations, configurations, data formats, and FAQs, README clearly points to [TUTORIAL.md](TUTORIAL.md) as well as the source code documents of each tool. This tutorial does not use additional commands from those files.

</details>

<details>
<summary><b>Cursor · Gemini 3.7 Flash</b>  7,229 characters · 31 code blocks · 15/16 facts in README</summary>

The following is a summary of the project and a detailed usage tutorial organized based on the provided `README.md`. All content and commands are written strictly according to the original README.

---

# Part 1: Summary of the Open Source Project Gadgets

## 1. Project Introduction
**Gadgets** is a collection of practical tools accumulated in daily development, covering five core areas: **generation of AI dialogue daily/weekly/monthly reports**, **discovery of academic papers and analysis of scholars**, **hardware and software performance benchmarking**, **automated build and publishing of Hugo personal blogs**, and **local document translation**.

- **Architectural features**: Each tool in the `tools/` directory is independent and can be used separately; general infrastructure (such as LLM calls, JSON parsing, disk caching, atomic writing, translation engines, Hugo deployment, etc.) is unified and contained in the `common/` package in the root directory.
- **Expansion and workflows**: The development workflow engine and all skills are hosted in an independent repository of the same level `ai-companion` (`../ai-companion/`), and connected to this project through the Hook mechanism.

---

## 2. Repository Structure Explanation

```text
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 Functions of Each Tool and Module

Tool/Directory Core Function Key Technology/Backend Support
tools/summarize/ Generation of multi-period AI dialogue reports: Automatically read Claude Code / Codex / Cursor Agent / ChatGPT dialogue logs, combine with ccusage 20.x to count tokens and costs of each Agent, and generate 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 insights (--insight analysis of paper writing structure, review comments, and strategies); ③ Scholar profiles (research trajectories, hierarchical ratings, and teacher-student relationships exploration); ④ Citation graph analysis. arXiv / bioRxiv / PubMed / Semantic Scholar, OpenReview, LLM (4 backends)
tools/benchmark/ Cross-platform CPU/GPU performance benchmarking: Unified measurement of FLOPS floating-point performance for different hardware and precision (FP64/FP32/FP16/BF16/FP8), using preheating + formal measurement + statistical analysis, and results are appended to CSV. Supports generating 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: Automated processing of personal blogs (“TzJ’s Net”), with media incremental compression (pngquant for image compression, HandBrakeCLI for video compression) and automatic bilingual translation of local models, directly built and pushed 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 similar to Google Translate interface, supporting text and file (.md, .txt, .pdf, .docx, images) translation, fully preserving Markdown format (code blocks, URLs, Hugo shortcodes), without calling cloud APIs. Gradio, local translation engine (preferred Ollama, supports vLLM / transformers / llamacpp GGUF)
common/ Shared infrastructure package: Provides a unified double-layer LLM call 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/ Ops scripts set: Provide data cross-device synchronization (sync.py), new machine configuration (onboard.py), read-only smoke test (smoke.sh), local LLM environment tuning configuration (serve_local_llm.sh), bilingual auditing (language.py) etc. rclone, Python, Shell
../ai-companion/ Independent workflow repository: Records function-level code changes, provides /idea/ccplan/ccedit planning and execution flow as well as all Claude Code / Codex skills. Node.js, TypeScript

Part 2: Detailed Usage Tutorial for Gadgets

1. Environment Preparation

  • Python environment: Requires Python 3.10+, recommended to use a Conda environment named AI:
    conda activate AI
    
  • Node.js environment: Node.js 18+ (only required when using the independent repository of the same level ../ai-companion/).
  • Local translation/model environment: Translation and blog functions default to relying on the tencent/Hy-MT2-1.8B model running locally with Ollama (automatically downloaded on first use; vLLM is an alternative for Linux, transformers for Windows).

2. Installation and Initialization

The project installs basic packages and tool dependencies in editable mode:

2.1 Install public base packages and most tool dependencies

Install common/ and all tool dependencies except translator (summarize, research, benchmark, website):

pip install -e ".[all]"

2.2 Install specific tool dependencies

  • Install independent dependencies for Translator (Note: .[all] does not include translator, need to install separately):
    pip install -e ".[translator]"
    
  • Install Website dependencies separately (including torch + transformers required for local translation):
    pip install -e ".[website]"
    

2.3 Run read-only smoke test

Verify that the environment and imports of all tools are normal (no network requests, LLM calls, or writing operations):

bash scripts/smoke.sh

3. Configuration Instructions

  1. Global configuration file:
    • Copy the template file in the root directory to generate config.json (this file is gitignored):
      cp config.example.json config.json
      
    • It includes sync (rclone synchronization configuration) and summarize etc. running settings for each tool.
    • The configuration file path can be overridden via environment variables GADGET_CONFIG.
  2. API key and credential directory:
    • tokens/ directory is used to store API Key and the initialization list tokens/onboard.yaml for new machines (this directory is gitignored, do not submit it).
  3. Global environment variable adjustment:
    • GADGET_LLM_BACKEND: Global specify LLM backends ollama, claude_cli, anthropic, openai.
    • GADGET_TRANSLATION_BACKEND: Specify translation backends ollama, llamacpp, vllm, transformers.
    • GADGET_TRANSLATION_MODEL: Override the default translation model name.

4. Typical Usage Methods of Each Tool (Directly Runable Commands)

4.1 Summarize —— Generation of AI dialogue reports

Use the python -m summarize entry uniformly. 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 reports day by day
    python -m summarize daily merge --sync-all
    
  • Generate a specified weekly report and deploy it to the blog
    python -m summarize weekly generate --week 2026-W12 --deploy
    
  • Generate a specified monthly report and deploy it to the blog
    python -m summarize monthly generate --month 2026-02 --deploy
    
  • One-click full process execution (export → merge → weekly report → monthly report + deployment)
    python -m summarize auto --deploy
    

4.2 Research —— Academic papers and scholar research

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

  • Run the full paper research process (search → three-phase evaluation → generate report)
    python tools/research/research_scout.py report --project my-project
    
  • Search for papers using natural language (automatically route data sources)
    python tools/research/research_scout.py ask "Find the latest robot operation paper by Pieter Abbeel"
    
  • Analyze scholar academic profiles (input scholar’s name)
    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 the research report to the Hugo blog
    python tools/research/research_scout.py deploy
    

4.3 Benchmark —— Performance benchmark testing

Note: Before executing the benchmark command, you must first enter the tools/benchmark directory via cd.

cd tools/benchmark
  • Run full benchmark testing (CPU + GPU, results appended to CSV)
    python -m benchmark.cli
    
  • Run only CPU benchmark testing
    python -m benchmark.cli --cpu-only
    
  • Run only GPU benchmark testing
    python -m benchmark.cli --gpu-only
    
  • Run tests and generate an interactive HTML report
    python -m benchmark.cli --report
    
  • Generate a test report and publish it to the /benchmark/ path of the Hugo blog
    python -m benchmark.cli --report --deploy
    

4.4 Website —— Building and publishing the Hugo blog

  • Start the preview server locally (includes drafts)
    cd tools/website && hugo server -D
    
  • macOS / Linux environment: Incremental media compression + Hugo build + automatic push to GitHub Pages
    cd tools/website && bash update.sh
    
  • Windows environment: Update and build for publication
    powershell -ExecutionPolicy Bypass -File tools/website/update.ps1
    

4.5 Translator —— Translate local documents into the web interface

  • Start the Gradio Web GUI interface (automatically opens in browser after startup)
    python -m translator
    

4.6 Operations and script tools

  • Data synchronization across devices (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 a new machine (execute after filling in tokens/onboard.yaml):**
    python scripts/onboard.py
    
  • Create a local Ollama model optimized for Summarize and export environment variables:
    eval "$(bash scripts/serve_local_llm.sh env)"
    
  • View help for the server system-level initialization script (from the same level ai-companion repository):**
    bash ../ai-companion/scripts/onboard-server.sh --help
    

5. Product output and data flow

All generated files are stored in the outputs/ directory (added to .gitignore):

  • outputs/logs/: Intermediate export logs and running logs
  • outputs/reports/: Generated Markdown, JSON, and HTML final reports
  • outputs/cache/: LLM calls and search result cache
  • outputs/data/: Structured data (CSV performance data, scholar profile JSON)
  • outputs/images/: Charts and generated images
  • outputs/backups/: Backup files
Claude Code · Fable 5.1 · effort high — 8,091 characters · 15 code blocks · 16/16 facts in README

The following consists of two parts: a project summary and a beginner-friendly usage guide. All commands and parameters are taken directly from the README.

1. Project Summary

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

Repository structure.

Directory / File Function
tools/summarize/ AI conversation daily reports / weekly reports / monthly reports
tools/research/ Paper discovery + researcher analysis + citation graphs
tools/benchmark/ CPU/GPU performance benchmark testing
tools/website/ Hugo blog (incremental media compression + automatic build and publishing)
tools/translator/ Gradio document translator
common/ Shared infrastructure package dependent on all tools
scripts/ Operations 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 products (already gitignore, can be automatically rebuilt), divided into logs / reports / cache / data / images / backups
tokens/ API keys and onboarding forms, already gitignore, must not be submitted
AGENTS.md / CLAUDE.md AI agent working protocol and Claude Code repository guide
pyproject.toml Packaging configuration
config.json Tool settings (gitignore, copied from config.example.json), path can be overridden by GADGET_CONFIG

What each tool does.

- **Summarize**: Read the conversation records of Claude Code / Codex / Cursor Agent / ChatGPT / general JSON, and call an LLM to generate structured daily reports, weekly reports, and monthly reports. Adopt a multi-device two-stage architecture: each device first exports logs, which are synchronized via cloud disk or manually copied and summarized before being merged to produce the daily report. Through the source-separation commands of ccusage 20.x (`ccusage claude`, `ccusage codex`, `ccusage gemini`), the token usage and costs of each agent CLI are automatically counted. - **Research**: A unified entry point `tools/research/research_scout.py` provides four types of capabilities. Paper discovery: search from arXiv / bioRxiv / PubMed, and generate a research weekly report through a three-stage LLM pipeline of “quick screening → in-depth evaluation → citation impact”, which is deployed into Hugo, supporting conference papers and author search. Deep insights `--insight`: download the full text to analyze the writing structure and publication strategy, and automatically match OpenReview review comments. Researcher profiles: generate research trajectory analysis and tier scores by combining arXiv + Semantic Scholar data, automatically discover the mentor-student relationship, support name-based disambiguation and reverse search. Citation graph: perform forward citation / reverse reference analysis based on Semantic Scholar API. - **Benchmark**: Cross-platform CPU/GPU FLOPS testing, supporting NVIDIA CUDA, Apple MPS, Intel XPU (OpenCL only appears in `--info` detection), covering FP64 / FP32 / FP16 / BF16 / FP8 (experimental). Adopt a warm-up + formal measurement + statistical analysis (median, IQR to eliminate outliers) approach, and explicit GPU synchronization is used to ensure accurate timing. Results are written in append mode into CSV, and can generate Plotly interactive HTML reports and leaderboards, supporting deployment into Hugo and submission to public leaderboards. - **Website**: The Hugo static blog “TzJ’s Net” (PaperMod theme) is deployed on GitHub Pages. It includes incremental media compression (only processing files changed after `.last_build`, using pngquant for images, HandBrakeCLI for videos) and local model bilingual translation (default Ollama, vLLM fallback for Linux, transformers fallback for Windows, model `tencent/Hy-MT2-1.8B` automatically downloaded on first run). The automatically generated content is written directly into `tools/website/content|static` with `gadget_generated` tags, and handwritten files are not overwritten. `tools/website/public/` is an independent deployment repository that is automatically pushed by the build script; do not submit directly to it. - **Translator**: A Gradio web translator based on `common` translation engine, similar to Google Translate’s local interface, supporting text and `.md` / `.txt` / `.pdf` / `.docx` / image files. During translation, Markdown segments such as code blocks, URLs, and Hugo shortcodes are protected. All processing occurs locally, and the backend is automatically selected via `common.engine.create_engine()` (ollama / transformers / vllm / llamacpp), with the model always in memory and lazy loading when switching models. The source language can be set to `auto` (detected by CJK ratio), and the target `auto` flips between Chinese and English.

Four LLM backends. All LLM functions are switched via --api uniformly: ollama (default, local Ollama, no key required, Qwen3.8-27B), claude_cli (reuses Claude Code CLI login status, no API key required), anthropic, openai. Global setting via environment variable GADGET_LLM_BACKEND is also possible.

2. Usage Guide

1. Environment Preparation

  • Python 3.10 or higher, it is recommended to use a conda environment AI.
  • Node.js 18 or higher, only the ../ai-companion/ independent repository is required.
  • Specific dependencies of each tool can be found in the corresponding directory under requirements.txt.
  • Website building requires Hugo, pngquant, HandBrakeCLI.
  • Cross-device synchronization requires rclone configuration.
  • The default LLM backend is local Ollama. If Ollama is not desired, --api claude_cli can reuse Claude Code login status, or anthropic / openai and placing an API key in tokens/ directory.
conda activate AI

2. Installation

Execute it in the root directory of the repository. all includes 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 install only the basic package or a single extra:

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

Installation generates build/ and gadget.egg-info/ in the root directory of the repository, which are already in gitignore; do not commit them.

3. Configuration

  • Copy config.example.json to config.json and modify as needed. config.json is already in gitignore. Set the environment variable GADGET_CONFIG when a different path is required.
  • sync.py reads the config.json sync segment; persistent settings of serve_local_llm.sh are placed in summarize segment.
  • The API key is placed in tokens/ directory; never commit it.
  • Global environment variables: GADGET_LLM_BACKEND sets the LLM backend; GADGET_TRANSLATION_BACKEND sets the translation engine (ollamallamacpp / vllm / transformers); GADGET_TRANSLATION_MODEL overrides the translation model.

One-time configuration for a new machine can go through the onboarding process: fill in tokens/onboard.yaml, run scripts/onboard.py once, and the script will automatically complete SSH configuration, Claude/Codex CLI installation and authentication, pip extras and ai-companion installation, tool configuration, 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 normal, without triggering the LLM, network, or writing:

bash scripts/smoke.sh

4. Summarize: Daily Report / Weekly Report / Monthly Report

The typical process is divided into two stages. First, export the dates that have not been exported on each device, then sync them on the summary device and merge them daily. After enough daily reports are accumulated, generate weekly and monthly reports, which --deploy will be deployed into 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. Switch the LLM backend by adding --api, for example --api claude_cli. The old entries python tools/summarize/daily_summary.py ..., weekly_summary.py, monthly_summary.py are still available, but the new form is recommended.

If you want to create a customized 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, which runs in the root directory of the repository.

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: Complete pipeline, search → three-stage evaluation → report generation.
  • ask: Natural language search, automatically routing data sources.
  • profile: Researcher profiles.
  • citations: Create a citation graph based on arXiv ID or DOI.
  • deploy: Deploy the report into Hugo.
  • Deep paper insights add --insight parameters. All LLM functions support --api backend switching.

6. Benchmark: Performance benchmark testing

All commands must first enter the tools/benchmark/ directory. Results are appended into CSV, and old results are not overwritten; multiple runs on multiple hardware naturally accumulate into leaderboards.

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: Only test CPU or GPU.
  • --report: Run tests and generate an HTML report.
  • --report --deploy: Generate a report and publish it on Hugo’s /benchmark/ page.
  • --info: Check hardware information. GPU automatically identifies CUDA / Apple MPS / Intel XPU.

7. Website: Hugo blog

First install the website extra (including torch + transformers required for translation), then run the build script. The script will perform incremental compression, translation, Hugo building, and automatically push to tools/website/public/ deployment repository.

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

For Windows, use a PowerShell script; the script 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

Note: On first run, the translation model tencent/Hy-MT2-1.8B will be automatically downloaded. Handwritten articles are directly placed in tools/website/content; files without gadget_generated tags will not be automatically overwritten with content. Do not submit directly to tools/website/public/, nor git add the deployment repository and theme repository.

8. Translator: Document translator

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

After starting, a Gradio interface opens in the browser, allowing translation of text or uploading .md / .txt / .pdf / .docx / images. The default model tencent/Hy-MT2-1.8B (GGUF variant tencent/Hy-MT2-1.8B-GGUF) is automatically downloaded on first use. To switch models, set GADGET_TRANSLATION_MODEL or operate within the model management in the interface. Backend selection rule: if the model tag has been pulled, ollama is prioritized; transformers are used for Windows fallback; vllm is prioritized for Linux; llamacpp is used to load GGUF when memory is insufficient.

9. Cross-device data synchronization

conda activate AI

sync.py Uses rclone to centrally synchronize data categorized as summarize / website / research / benchmark / backups, supporting operations such as push / pull / status / bootstrap / config. 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: Rename Hugo bilingual audit and summarize reports.
  • scripts/profile_translation.py: GPU performance analysis of translation engines.
  • ai-companion is an independent Node.js repository that needs to be cloned into ../ai-companion/. It provides code change tracking, /idea/ccplan/ccedit planning and execution pipelines, and all skills. For installation methods, see ../ai-companion/scripts/install.ts.
  • A system-level one-click installation script for Ubuntu 22.04/24.04 servers is also available in this repository:
bash ../ai-companion/scripts/onboard-server.sh --help

Here, --companion-repo directly points to the ai-companion repository address git@github.com:TzJ2006/ai-companion.git, and --companion-ref is no longer required.

11. Output locations and submission guidelines

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

If you want to publish this tutorial as a shareable web page, just let me know.

Reproducibility

The two scripts used for testing and generating this document, along with the complete records of 16 runs (including full text, timing, usage, and statistics): docbench.py, gen_doc_post.py, docbench.json.

python docbench.py       # 全部跑一遍,结果写入 docbench.json,断点续跑
python gen_doc_post.py   # 从 docbench.json 重新生成本文