经 AI Skill Hub 精选评估,开源AI工作流工具 获评「强烈推荐」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
一个自托管的AI助手,支持工具使用、多代理编排和代码生成,适合开发人员和AI爱好者使用
开源AI工作流工具 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
一个自托管的AI助手,支持工具使用、多代理编排和代码生成,适合开发人员和AI爱好者使用
开源AI工作流工具 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install tofu
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install tofu
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/NiuTrans/ToFu
cd ToFu
pip install -e .
# 验证安装
python -c "import tofu; print('安装成功')"
# 命令行使用
tofu --help
# 基本用法
tofu input_file -o output_file
# Python 代码中调用
import tofu
# 示例
result = tofu.process("input")
print(result)
# tofu 配置文件示例(config.yml) app: name: "tofu" debug: false log_level: "INFO" # 运行时指定配置文件 tofu --config config.yml # 或通过环境变量配置 export TOFU_API_KEY="your-key" export TOFU_OUTPUT_DIR="./output"
<p align="center"> <img src="static/icons/tofu-welcome.svg" width="140" height="160" alt="Tofu logo" /><br/> <img src="static/icons/tofu-brand-title.svg" width="280" height="78" alt="Tofu" /><br/> <sub>豆腐 — Self-Hosted AI Assistant</sub> </p>
<p align="center"> <a href="https://github.com/rangehow/ToFu/actions/workflows/ci.yml"><img src="https://github.com/rangehow/ToFu/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <img src="https://img.shields.io/badge/python-3.10+-3776ab?logo=python&logoColor=white" alt="Python" /> <img src="https://img.shields.io/badge/SQLite-3-003B57?logo=sqlite&logoColor=white" alt="SQLite" /> <img src="https://img.shields.io/badge/PostgreSQL-18+ (optional)-336791?logo=postgresql&logoColor=white" alt="PostgreSQL optional" /> <img src="https://img.shields.io/badge/license-MIT-green" alt="License" /> <img src="https://img.shields.io/badge/platform-Linux%20·%20macOS%20·%20Windows-lightgrey" alt="Platform" /> </p>
<p align="center"> <a href="README_CN.md">🇨🇳 中文文档</a> </p>
<p align="center"> <img src="propaganda/mainpage.jpg" width="800" alt="Main Interface" /> </p>
---
npm install -g @anthropic-ai/claude-code && claude auth login
npm install -g @openai/codex && codex auth login ```
Click the backend selector (🤖) in the top bar to switch. The UI automatically adapts — model selector and Tofu-specific features are hidden when using an external backend.
| Feature | Built-in (Tofu) | Claude Code | Codex |
|---|---|---|---|
| Chat & streaming | ✅ | ✅ | ✅ |
| Web search | ✅ | ✅ (CC's) | ✅ (Codex's) |
| File operations | ✅ | ✅ (CC's) | ✅ (Codex's) |
| Code execution | ✅ | ✅ (Bash) | ✅ (exec) |
| Model selection | ✅ | — | — |
| Image generation | ✅ | ❌ | ❌ |
| Browser extension | ✅ | ❌ | ❌ |
| Multi-agent swarm | ✅ | ❌ | ❌ |
The CLI must be installed on the same machine as the Tofu server. Each conversation remembers its backend.
---
Pick the row that matches your OS. Each one ends with a running server on http://localhost:15000.
| OS | What to do |
|---|---|
| **Windows** | Download **Tofu-Setup-x.y.z-win64.exe** from the [latest release](https://github.com/rangehow/ToFu/releases/latest) and double-click. |
| **Linux / macOS** | curl -fsSL https://raw.githubusercontent.com/rangehow/ToFu/main/install.sh \| bash |
| **Docker** | git clone https://github.com/rangehow/ToFu.git && cd ToFu && docker compose up -d |
That's it. Each path handles conda/runtime, dependencies, the database, the browser engine, and starts the server — no flags, no follow-up steps.
Need to pre-set an API key, change the port, or recover from a failed install? See docs/INSTALL.md for all flags and troubleshooting recipes.
---
All configuration is done through the ⚙️ Settings panel (top-right gear icon). Changes save instantly — no restart needed.
| Tab | What you configure |
|---|---|
| **⚙️ General** | Theme (Dark/Light/Tofu), temperature, max tokens, thinking depth, system prompt |
| **🔗 Providers** | API keys, endpoints, model lists, multi-key rotation, auto-discovery |
| **📦 Display** | Which models appear in dropdowns, default model, fallback model |
| **🔍 Search & Fetch** | Result count, timeouts, character limits, blocked domains, content filter |
| **🌐 Translation** | Machine translation provider (NiuTrans / Custom), API key, endpoint |
| **🌐 Network** | HTTP/HTTPS proxy, bypass domains |
| **🐦 Feishu** | App credentials, default project, allowed users |
**</> Advanced** | Price overrides, cache management, server info |
For headless/Docker setups, you can configure via environment variables instead of the Settings UI. Copy the template and edit:
cp .env.example .env
vim .env # fill in your values
The .env.example file documents all supported variables. Key ones:
| Variable | Description | Default |
|---|---|---|
LLM_API_KEYS | Comma-separated API keys | *(none)* |
LLM_BASE_URL | API endpoint | https://api.openai.com/v1 |
LLM_MODEL | Default model | gpt-4o |
PORT | Server port | 15000 |
BIND_HOST | Bind address | 127.0.0.1 (loopback) |
TOFU_AUTH_MODE | Force auth mode and lock the UI: open / private / multi-user | *(file-driven)* |
TOFU_AUTO_KEY | Set to 0 to skip first-boot admin-key bootstrap | 1 |
TUNNEL_TOKEN | **DEPRECATED** back-compat shim — use the API-keys system instead | *(disabled)* |
TRADING_ENABLED | Enable trading module (1/0) | 0 |
PDF_TEXT_MODE | Default PDF text-extract strategy: rich (pymupdf4llm, default), structured (Docling; requires pip install docling), fast | rich |
PDF_VLM_BATCH_PAGES | Pages per VLM call when VLM parsing is used (1–16) | 4 |
PDF_VLM_MAX_WORKERS | Cap on concurrent VLM calls (useful on shared keys to avoid 429 storms) | unlimited |
Priority: Settings UI >.envfile > system environment > defaults. You can alsoexportvariables directly —.envis just a convenience.
---
Everything you can do in the UI is also exposed as a documented HTTP API, so you can drive Tofu from scripts, agents, or your own apps without rendering the web UI.
Mounts:
| Prefix | Surface |
|---|---|
/api/v1/* | Tofu native — full feature parity with the UI (chat, conversations, tasks, agents, capabilities, keys, usage, billing, …) |
/v1/... | OpenAI compat — chat/completions, models, embeddings (drop-in for the OpenAI SDK) |
/v1/messages | Anthropic compat — Messages API (drop-in for the Anthropic SDK) |
/metrics | Prometheus exposition (admin-scoped) |
Self-description: /api/openapi.json and /api/openapi.yaml (OpenAPI 3.1), Swagger UI at /api/docs, ReDoc at /api/redoc.
Manage keys in Settings → 🔑 API Keys: mint, scope (chat/admin/etc.), set per-key RPM and TPD limits, revoke, view a 30-day usage chart per key. Idempotency-Key is supported on POSTs (24-hour cache, salted by principal). Standard rate-limit headers (X-RateLimit-*, Retry-After) are returned on every response.
Client SDKs ship in clients/:
```bash
Already using Claude Code or OpenAI Codex? Tofu can act as a pure web frontend for them — you get Tofu's UI, conversation management, and persistence, while the external CLI handles all LLM calls and tool execution with its own authentication.
Setup: ```bash
When you need the assistant to read pages that require login — internal dashboards, JIRA tickets, authenticated admin panels — the browser extension bridges your real browser session to Tofu.
Setup: 1. Go to chrome://extensions → Enable Developer Mode 2. Load unpacked → select the browser_extension/ folder 3. Click the extension icon → enter your Tofu server URL
What it can do:
| Tool | Use case |
|---|---|
browser_list_tabs | See all your open tabs |
browser_read_tab | Extract text content (with optional CSS selector) |
browser_screenshot | Capture a visual screenshot |
browser_navigate | Open a URL |
browser_click | Click elements by selector or text |
browser_type | Type into input fields |
browser_execute_js | Run custom JavaScript for data extraction |
browser_get_interactive_elements | Discover clickable/typeable elements |
browser_get_app_state | Access Vue/React internal state |
When the page uses Canvas/SVG rendering (charts, DAG diagrams) — DOM text extraction returns nothing. Use browser_screenshot for visual analysis, browser_get_app_state for data, or browser_execute_js for custom extraction.
Multiple browsers can connect simultaneously with independent command queues — useful if you have work and personal browser profiles.
---
ToFu是一个功能强大的AI工作流工具,支持多种AI模型和自定义开发
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
AI Skill Hub 点评:开源AI工作流工具 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | ToFu |
| Topics | AI工作流Python |
| GitHub | https://github.com/NiuTrans/ToFu |
| 语言 | Python |
收录时间:2026-06-03 · 更新时间:2026-06-03 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端