经 AI Skill Hub 精选评估,Fork AI 工作流 获评「强烈推荐」。已获得 1.1k 颗 GitHub Star,这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
Fork AI 工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
Fork AI 工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:cargo install(推荐) cargo install forkd # 方式二:从源码编译 git clone https://github.com/deeplethe/forkd cd forkd cargo build --release # 二进制在 ./target/release/forkd
# 查看帮助 forkd --help # 基本运行 forkd [options] <input> # 详细使用说明请查阅文档 # https://github.com/deeplethe/forkd
# forkd 配置说明 # 查看配置选项 forkd --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export FORKD_CONFIG="/path/to/config.yml"
<br/>
<br/> <br/>
<p align="center"> <a href="https://github.com/deeplethe/forkd/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/deeplethe/forkd/ci.yml?branch=main&style=flat-square&label=ci"></a> <a href="https://github.com/deeplethe/forkd/releases"><img alt="Release" src="https://img.shields.io/github/v/release/deeplethe/forkd?style=flat-square&color=4c956c"></a> <a href="https://pypi.org/project/forkd/"><img alt="PyPI" src="https://img.shields.io/pypi/v/forkd?style=flat-square&color=3776ab&logo=pypi&logoColor=white"></a> <a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square"></a> <a href="./README-zh.md"><img alt="中文 README" src="https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87-red?style=flat-square"></a> <a href="https://github.com/deeplethe/forkd/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/deeplethe/forkd?style=flat-square&color=eab308&logo=github"></a> </p>
<br/>
forkd snapshot-diff --from py-base --tag py-numpy --exec "pip install numpy==2.0.2" forkd snapshot-diff --from py-numpy --tag py-pandas --exec "pip install pandas==2.2.3"
sudo bash scripts/netns-setup.sh 3 # per-child network namespaces
sudo -E forkd fork --tag py-numpy -n 5 --per-child-netns ```
```bash forkd bench --tag py-numpy --n 5
sudo bash scripts/setup-host.sh sudo bash scripts/host-tap.sh cargo build --release sudo install -m 0755 target/release/{forkd,forkd-controller} /usr/local/bin/
sudo bash scripts/build-rootfs.sh python:3.12-slim python-rootfs.ext4 1536 python3-numpy
Drop-in patterns for the four agent frameworks most often used with forkd. Each is ~150-250 lines of Python with a --dry-run mode that exercises the forkd plumbing without an LLM key:
| Recipe | Driver | Forkd-specific move |
|---|---|---|
[mcp-agent/](./recipes/mcp-agent/) | Claude Desktop / Cursor / Cline (MCP) | End-to-end MCP protocol verification |
[crewai-fanout/](./recipes/crewai-fanout/) | CrewAI | N agents on N microVMs from one parent — per-agent isolation, ~24ms per child |
[autogen-branch/](./recipes/autogen-branch/) | AutoGen | Forkd-backed CodeExecutor + mid-conversation BRANCH that fans out N alternatives |
[openai-swarm/](./recipes/openai-swarm/) | OpenAI Swarm / Agents SDK | Handoff = BRANCH: agent B inherits agent A's full VM state |
Once a parent snapshot is built (yours or someone else's), forkd pack ships it as a single .tar.zst file with a manifest + per-file sha256. Other hosts pull and resume forking in seconds, no Docker round-trip:
```bash
Requires: x86_64 Linux with KVM, Ubuntu 22.04 or newer.
A 24-second walkthrough of the LangGraph branch-and-fan-out demo — source agent runs a ReAct loop, gets BRANCHed mid-thought, three grandchildren each receive a different steering hint, all three produce divergent itineraries while inheriting the same prior reasoning state.

Headline divergence: the source (no hint) picks Nishiki Market for Day 1; all three hinted children independently substitute Arashiyama Bamboo Grove. The cost-focused child also adds "may be pricey" annotations the others don't. The model wasn't told to swap places — each hint perturbed the next LLM call, the rest of the prior reasoning came along unchanged.
Full mechanism + numbers + raw transcripts in recipes/langgraph-react/ and recipes/langgraph-react/DEMO.md.
pip install forkd # Python SDK — calls the daemon over HTTP npm install @deeplethe/forkd # TypeScript SDK ```
forkd doctor runs 17 checks (KVM, hardware virt, cgroup v2, IP forward, tap, netns, Firecracker binary + version, Docker daemon, snapshot dir + disk space, kernel image, controller reachability, platform, plus uffd_wp + memfd_create + hugepages for the v0.4 live-fork path) and emits specific fix hints for each non-pass. Run this first whenever something feels off.

sudo -E forkd fork --tag pyagent -n 1 --per-child-netns --live-fork sudo -E forkd snapshot --from-sandbox <sb-id> --live --no-wait ```
Requires Linux ≥ 5.7, vm.unprivileged_userfaultfd=1 (or CAP_SYS_PTRACE), and the vendored Firecracker fork from deeplethe/firecracker:forkd-v0.4-mem-backend-shared-v1.12 — forkd doctor probes both. Full design: DESIGN-v0.4.md. Empirical PoC data: experiments/v0.4-*-poc/. Tracking issue #101.
<br/>
curl -sSL https://github.com/deeplethe/forkd/releases/download/v0.5.3/forkd-v0.5.3-x86_64-linux.tar.gz \ | sudo tar -xz -C /usr/local/bin/
sudo -E forkd quickstart ```
quickstart preflights the host (KVM, Firecracker, kernel image), tells you what it wants to set up (guest kernel download, tap device, per-child netns — nothing happens without your consent or --yes), bakes a Python snapshot from python:3.12-slim with your local Firecracker (or pulls a prebaked one from the hub when Docker is absent), then forks 10 microVM children from it and prints per-child timings. Idempotent — re-running reuses the snapshot and skips completed setup.
The sections below are the same flow broken into individual verbs, for when you want control over each step.
curl -sSL https://github.com/deeplethe/forkd/releases/download/v0.5.3/forkd-v0.5.3-x86_64-linux.tar.gz \ | sudo tar -xz -C /usr/local/bin/
In-guest agent (E2B-compatible):
from forkd import Sandbox # drop-in for `from e2b import Sandbox`
with Sandbox() as sb:
print(sb.commands.run("uname -a").stdout)
print(sb.eval("numpy.zeros(5).tolist()")) # reuses warmed PID 1
Controller daemon (lifecycle + branching):
```python from forkd import Controller
c = Controller() # http://127.0.0.1:8889 children = c.spawn_sandboxes("pyagent", n=1, per_child_netns=True, live_fork=True) # v0.4: enables mode="live" later sb_id = children[0]["id"]
For Node.js 18+ agents (LangChain.js, agent-twins, anything JS-side):
npm install @deeplethe/forkd
import { Controller } from '@deeplethe/forkd';
const ctrl = new Controller(); // reads FORKD_URL, FORKD_TOKEN from env
const [parent] = await ctrl.spawnSandboxes({
snapshotTag: 'pyagent', n: 1, perChildNetns: true,
liveFork: true, // v0.4: enables { mode: 'live' } later
});
// ... drive parent via REST/HTTP ...
// `mode: 'live'` + `wait: false` = source pauses sub-50 ms and the
// caller returns after ~10 ms; the background memory copy completes
// asynchronously, snapshot reaches `status: 'ready'` afterward.
const branch = await ctrl.branchSandbox(parent.id, { mode: 'live', wait: false });
const kids = await ctrl.spawnSandboxes({ snapshotTag: branch.tag, n: 5, perChildNetns: true });
Surface parity with the Python SDK: spawnSandboxes / branchSandbox take the same prewarm / liveFork / mode / wait / measure_diff options. See sdk/typescript/.
The sandbox-runtime space has a wide spread of designs. The table below summarises positioning of forkd against the most-cited open-source projects. Numbers in quotes are as advertised by the upstream project unless they match a row in our benchmark chart above. forkd does not measure other projects on workloads they were not designed for.
| Project | Primitive | Cold-start (N=100) | Fork-from-warm | Quotas | Auth / TLS | License |
|---|---|---|---|---|---|---|
| **forkd** | Firecracker + snapshot CoW | **101 ms** | ✓ | cgroup memory.max | bearer + rustls | Apache 2.0 |
| [CubeSandbox][cs] | RustVMM + KVM microVM | 1.06 s¹ | "coming soon" | <5 MiB / instance | not in OSS | Apache 2.0 |
| [Daytona][dy] | OCI workspace | <90 ms² | ✗ | per workspace | API keys (platform) | **AGPL-3.0** |
| [OpenSandbox][os] | Docker / K8s + gVisor / Kata / FC | 122 s | ✗ | via runtime | gateway (k8s) | Apache 2.0 |
| [E2B][e2b] | Firecracker (in [infra][e2b-infra]) | not in OSS | ✗ | platform | API keys (cloud) | Apache 2.0 |
| [BoxLite][bl] | KVM / Hypervisor.framework + OCI | 113 s | ✗ stateful Box | KVM + seccomp | egress policy only | Apache 2.0 |
| Modal | proprietary snapshot fork | not public | ✓ | ✓ | ✓ | proprietary |
| Firecracker raw | microVM only | 759 ms | manual | n/a | n/a | Apache 2.0 |
| Docker (runc) | OCI container | 335 s | ✗ | cgroups | n/a | Apache 2.0 |
| gVisor (runsc) | userspace kernel | 289 s | ✗ | cgroups | n/a | Apache 2.0 |
¹ Wall-clock at N=100 concurrent on this bare-metal host (systemd-detect-virt: none, i7-12700, 20 vCPU, no nested virt). This is the fast-path number — pool_default_format_size_list was extended to include the template's writable-layer size, so each sandbox reuses a pre-formatted pool entry rather than going through a live mkfs.ext4 + reflink-copy. 1056 ± 14 ms over five runs, 100 % success every run, measured with a bench script that pre-warms Python's ThreadPoolExecutor to keep client-side lazy-init out of the timing. Host runs cube v0.2.0, which carries a ~50 ms latency regression that PR #234 fixes in v0.2.1 — the figure above is the v0.2.0 baseline. An earlier slow-path measurement on the same host (writable-layer size that didn't match the default pool) returned 20.3 s with 77/100 success — that mismatch was on our side and the maintainer corrected it at #235. Cube advertises <60 ms single-instance cold-start (P99 200 ms at N=100 concurrent) under the fast-path configuration on a 96 vCPU host — that figure isn't disputed and we did not retest it here. Note also that this row compares fork-from-warm (forkd) with cold-start (every other project); they're different operating points by design, not equivalent primitives. See bench/CUBESANDBOX.md for the full methodology, both rows, and the upstream cmdTimeout race we filed PRs #236 / #237 against. ² Daytona's advertised number; we did not measure it (workspace runtime, not a fan-out-comparable shape).
[cs]: https://github.com/TencentCloud/CubeSandbox [dy]: https://github.com/daytonaio/daytona [os]: https://github.com/alibaba/OpenSandbox [e2b]: https://github.com/e2b-dev/E2B [e2b-infra]: https://github.com/e2b-dev/infra [bl]: https://github.com/boxlite-ai/boxlite
Where forkd fits.
- Code interpreters and Jupyter-kernel sandboxes. Each conversation turn or tool call spawns a fresh kernel; the warmed parent carries the SciPy / ML runtime, so per-request import numpy / import torch collapses to zero. This is the design point — the workload shape Anthropic / OpenAI / Modal code-interpreter products are all on. - Evaluation harnesses. Hundreds of repository checkouts or test rollouts in parallel — SWE-bench-style — without paying Docker cold-start per task. - Per-user code execution at fan-out scale. Many short-lived sandboxes sharing one warmed parent, each child KVM-isolated by construction. - Untrusted-code execution in CI. git clone, pip install, pytest inside a real Linux VM, not a container namespace. - Self-hosted alternative to managed sandbox SaaS. One Linux box with KVM, single-binary daemon, Apache 2.0 — no per-second cloud fees, no vendor lock-in.
Where the others fit better. CubeSandbox: faster pure cold-start (<60 ms advertised). Daytona: workspace runtimes where each user owns one long-lived sandbox. OpenSandbox: one orchestration API across multiple isolation backends. BoxLite: embeddable, daemon-less, cross-platform (macOS via Hypervisor.framework). Modal: the closed- source managed system with the same primitive.
Where forkd is wrong. Function-level snapshot runtimes that give up real Linux (single-vCPU, serial I/O only) beat forkd's ~100 ms by an order of magnitude — at the cost of not running real Python servers, apt install, or outbound HTTPS.
<br/>
forkd from-image wraps Docker pull → ext4 → boot + warmup → pause → register tag into a single verb. Use this when you need a recipe that isn't on the Hub yet:
```bash sudo -E forkd from-image python:3.12-slim \ --tag py-numpy \ --extra python3-numpy
```bash
Skim answers for platform / procurement teams scoping forkd:
Can we deploy on Kubernetes? Yes — one forkd-controller Pod hosts N sandbox children; the K8s scheduler runs once at Pod creation regardless of fan-out (vs one Pod-per-sandbox in Kata / Firecracker-on-K8s designs). A starter manifest ships at packaging/k8s/. Requires nodes with /dev/kvm + cgroup v2; managed K8s (GKE / EKS / AKS) typically needs a metal SKU or explicit nested-virt to qualify.
How many sandboxes fit in one Pod? With a 512 MiB warmed Python+numpy parent, rough sizing:
Measured CoW overhead at N=100 is 0.12 MiB / child on top of the parent (bench/), so memory rarely caps fan-out — vCPU + process count dominate. Heavier parents (browser, ML inference) hit the ceiling sooner; measure with yours.
How do existing agents connect?
POST /v1/sandboxes n=100, language-agnostic, bearer-token authfrom forkd import Sandbox (drop-in for from e2b import Sandbox)pip install forkd-mcp ships an MCP server for Claude Desktop / Claude Code / Cursor / Cline. See sdk/mcp/Production case shapes (from production users + this repo's recipes):
e2b-codeinterpreter/pytest isolated. Recipe: coding-agent/git clone + pip install + pytest inside a real Linux VM, not a container namespacepostgres-fixture/ — ready-to-query postgres at ~10 ms per child instead of ~2 s of fresh initdbWhich kernels does forkd run on? Two kernels are in play, and only one is yours to worry about:
| Kernel | Who picks it | Version | Notes |
|---|---|---|---|
| **Guest** (boots inside each microVM) | forkd ships it | vmlinux-6.1.141 (fixed) | Firecracker's CI-blessed image; every snapshot is taken *and* restored against this same guest kernel, so the guest side is identical on every host. scripts/install-guest-kernel.sh installs it; forkd doctor verifies it. |
| **Host** (runs Firecracker + KVM) | your machine | **≥ 5.7 for live BRANCH**, any KVM-capable kernel otherwise | Live (--live) BRANCH needs UFFDIO_WRITEPROTECT on memfd (Linux 5.7+, forkd doctor probes it). Basic fork / Diff BRANCH work on older KVM kernels. Tested on 6.14 (CI + dev box); the K8s example targets 6.14. |
The host kernel is where Firecracker's own version sensitivity lives (KVM ABI, snapshot compatibility) — see Firecracker's kernel support policy for the authoritative host-kernel matrix rather than a copy that can drift. Snapshots are not portable across Firecracker versions or host CPU microarchitectures (a separate concern from kernel version); forkd doctor reports both your FC version and guest kernel so a fleet can assert they match.
<br/>
forkd 是一个高性能的沙盒环境管理工具,旨在为开发者提供极速、隔离且可扩展的运行环境。通过创新的技术架构,forkd 能够实现近乎瞬时的环境启动与分支(fork)能力,非常适合需要频繁创建隔离执行环境的 AI Agent 或自动化任务场景。
运行 forkd 需要 x86_64 架构的 Linux 系统(建议 Ubuntu 22.04 或更高版本),并必须启用 KVM 虚拟化支持。内核需满足 Linux ≥ 5.7 版本,且需配置 `vm.unprivileged_userfaultfd=1` 或具备 `CAP_SYS_PTRACE` 权限。此外,系统需支持 memfd-backed RAM 以实现 live_fork 模式。
安装过程分为两种方式:对于快速部署,可直接下载预编译的 CLI + daemon 二进制文件并解压至 /usr/local/bin;对于开发者,可以通过 pip 安装 Python SDK 或使用 npm 安装 TypeScript SDK。首次运行 Docker 相关操作时可能需要几分钟进行镜像拉取与预热,后续运行将直接使用缓存。
快速上手非常简单:首先通过提供的脚本完成一次性的 Host 环境设置,随后即可使用 `forkd pull` 获取镜像并进行 fork 操作,整个过程仅需约 30 秒。此外,您还可以通过 `forkd bench` 进行延迟测试,或使用 `forkd doctor` 进行 16 项系统环境健康检查。
forkd 支持通过编程方式进行集成。开发者可以利用 Python SDK 或 TypeScript SDK 调用 daemon 服务。对于 AI 辅助开发场景,您可以将 forkd 配置集成到 Claude Desktop 的 `claude_desktop_config.json` 中,实现与 Claude 的深度联动。系统还提供 `forkd doctor` 工具来确保 KVM、Docker daemon 及内核参数配置正确。
forkd 提供了丰富的 API 能力。Python SDK 设计为与 E2B 兼容,支持通过 `Sandbox()` 模式直接运行命令或执行代码(如 numpy 计算),并能复用已预热的 PID 1 进程。此外,您还可以通过 CLI 结合 `--live` 参数进行快照(snapshot)操作,实现从现有沙盒状态的快速分支。
针对企业级部署,forkd 提供了完善的 FAQ。例如,在 Kubernetes 环境中,forkd 支持以一个 forkd-controller Pod 托管多个沙盒子进程的模式运行,这与传统的 Kata 或 Firecracker-on-K8s 设计不同,极大地降低了 K8s 调度器的压力,提高了大规模扩展的效率。
高效的AI工作流解决方案
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:Fork AI 工作流 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | forkd |
| 原始描述 | 开源AI工作流:Fork() for AI agent microVMs. Spawn 100 children in ~100ms from a warm parent; B。⭐1.1k · Rust |
| Topics | ai-agentsmicrovmrust |
| GitHub | https://github.com/deeplethe/forkd |
| License | Apache-2.0 |
| 语言 | Rust |
收录时间:2026-05-31 · 更新时间:2026-05-31 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端