open-compute README

The project's README from github.com/elliothux/open-compute. As one markdown file: README.md.

open-compute

High-performance Cloudflare Workers–compatible infrastructure in a single binary, deployed in one step.
Millisecond cold starts. MB-scale memory. Zero extra dependencies.

CI Apache-2.0 stock workerd 2097 members Rust 1.98 macOS | Linux

Website · Docs · Operator site · Architecture

English · 简体中文


The Workers platform, running on your hardware

You already know how to write Cloudflare Workers. open-compute runs them unchanged — the same module workers, the same bindings, the same APIs — on a single machine you own.

One binary. One data directory. One object authority. Local filesystem is the default; S3-compatible storage is optional.

No Kubernetes. No Redis. No service mesh. No control plane to babysit. No vendor.

   Everyone else                        open-compute
   ─────────────                        ────────────
   gateway + router                     ┌──────────────┐
   control plane                        │              │
   scheduler service          ═══>      │  ocd (1 bin) │
   Redis / Valkey cluster               │              │
   Postgres                             └──────────────┘
   K8s + operators                       + SQLite + Local/S3 objects

Why open-compute

workerd is a runtime, not a platform. It executes isolated Workers brilliantly — and stops there. No multi-tenant routing, no durable state, no scheduling, no deployment lifecycle, no control API. Everyone who wants Workers on their own infrastructure has to build that layer.

open-compute is that layer — and it ships as one file.

Proof, not promises

Compatibility here is measured, not asserted. The same fixtures run against open-compute and real Cloudflare — and if the results differ, it does not ship.

2,097 stable API members implemented across the Workers runtime and every product binding — zero gaps
7 / 7 product surfaces verified byte-for-byte against real Cloudflare: Workers, Cache, KV, D1, R2, Durable Objects, Queues
1 : 1 a production Next.js 16 build runs identically on Cloudflare and on open-compute — same artifact, same behavior
90%+ enforced line coverage, with real processes, real SQLite, and real workerd in every acceptance run

Compatibility

Write standard module workers (export default { fetch }) with the bindings you already know.

Runtime & bindings

Module Status
Workers ██████████ 100% ✅
KV ██████████ 100% ✅
R2 ██████████ 100% ✅
D1 ██████████ 100% ✅
Durable Objects ██████████ 100% ✅
Queues ██████████ 100% ✅
Cron ██████████ 100% ✅
Workflows ██████████ 100% ✅
Static Assets ██████████ 100% ✅
Service Bindings ██████████ 100% ✅
Cache ██████████ 100% ✅
Images ██████████ 100% ✅
Version Metadata ██████████ 100% ✅
WebSocket Hibernation ██████████ 100% ✅

Management

Surface Status
Cloudflare v4 API █████████░ 90% — Local /client/v4 works with Wrangler and the official SDK. Matching every hosted Cloudflare response still needs a Cloudflare account token.
Wrangler █████████░ 95% — Pinned Wrangler 4.127.1: deploy and resource commands verified against a running ocd.
Dashboard ████████░░ 80% — Operator admin UI on the same /client/v4 APIs — not a clone of the Cloudflare dashboard.
Workers Logs / realtime tail █████████░ 90% — wrangler tail plus Workers Logs query and live tail on a single node. Tail Workers, distributed traces, and Logpush are separate.

Partial

Module Status
Vectorize ████████░░ 80% — Stable post-beta Vectorize binding and v2 control API. Beta VectorizeIndex is out of scope.
Markdown Conversion ████████░░ 80% — Available through standard env.AI (toMarkdown).
AI Search ████████░░ 80% — RAG namespaces, indexing, and retrieval with operator-configured OpenAI-compatible providers.

Planning

Design is underway; bindings and APIs are not available to deploy yet.

Module Status
Browser Run ██░░░░░░░░ 20% — Planning (formerly Browser Rendering).
Artifacts ██░░░░░░░░ 20% — Planning (Git-backed artifact repositories).

Not yet

Not started for Day 1. Upload or config that requires these fails closed.

Module Status
Workers AI ░░░░░░░░░░ 0% — Hosted model inference (AI.run, model catalog, AutoRAG) is not provided. Markdown Conversion and AI Search above use env.AI only for their own surfaces.
Containers ░░░░░░░░░░ 0% — Not yet.
Hyperdrive ░░░░░░░░░░ 0% — Not yet.
Analytics Engine ░░░░░░░░░░ 0% — Not yet.
Workers for Platforms ░░░░░░░░░░ 0% — Not yet.
Dynamic Workers ░░░░░░░░░░ 0% — Not yet.
Pipelines ░░░░░░░░░░ 0% — Not yet.
Rate Limiting ░░░░░░░░░░ 0% — Not yet.
mTLS certificates ░░░░░░░░░░ 0% — Not yet.
Tail Workers / traces / Logpush ░░░░░░░░░░ 0% — Not yet.

100% ✅ means the Worker or product API has no missing methods. Remaining differences are single-node topology (no global edge), documented in the compatibility matrix. Live surface: ocd capabilities --json.

Quick start

Bring up the platform locally (needs Rust 1.98, Bun 1.3.14, Node 26, and Git LFS — see docs):

git lfs pull --include="share/workerd/**"
./scripts/dev.sh

Ship your first Worker:

./target/debug/ocd wrangler --project examples/hello-worker deploy --env dev

Type-checked, bundled, deployed, and served — one command. In production it is even smaller: one executable, one config file, one data directory. No build tooling on the host, no runtime downloads, no network required at startup.

For remote targets, CI, staging/production environments, tail, and rollback, see Wrangler projects and deployment targets.

Architecture

open-compute architecture

Component Role
ocd The whole control plane: ingress, control API, scheduler, supervisor, deployment authority
workerd The runtime — pinned, checksum-verified, unmodified upstream
SQLite Local, authoritative state — no external database, no eventual consistency
Local / S3 object authority Bundles, static assets, R2 bytes, snapshots, backups, cache bodies, and AI Search sources

Tenants get exactly what their deployment declares — and nothing else. No SQLite or Local object paths, no S3 credentials, no internal tokens, no sibling tenants. Enforced at the capability layer, not by convention.

Built in Rust, engineered for the hot path

The host is a single async Rust process — no GC pauses, no interpreter, no sidecar hops between the socket and your Worker.

Layered crates with enforced boundaries

Dependency direction is checked in CI — architecture that can't silently rot:

core ── storage ── artifacts ── runtime      (siblings, lower level)
                    └── workers              (may use core/storage/artifacts, never runtime)
                          └── service        (composition root: CLI, HTTP, workerd bridge)

ocd compiles a Cap'n Proto config with the verified binary, spawns workerd as a supervised child, and speaks to it over a loopback-only channel with per-generation tokens that never touch argv, env, or logs. It owns the full child lifecycle: readiness probes, process groups, bounded output capture, graceful and forced stop, reaping, restart backoff, and secret-free orphan recovery.

Deployments are immutable and content-addressed. workerLoader keys are deployment identities, so promotion and rollback move a pointer — they never mutate what is already running.

What it's not

Honest boundaries beat surprises in production:

Documentation

Goal Start here
Understand the design Architecture & design
Check API support Compatibility matrix
Track remaining qualification Acceptance plans
Build and deploy Workers Toolchain guide
Download and release GitHub Releases · Release process
Run in production Single-binary guide · Container / systemd / launchd
Operate and recover Runbooks · Operator site
Contribute AGENTS.md · Testing policy

Security

Sponsors

This project is sponsored by Lynx AI.

License

Apache-2.0. Packaged workerd remains under upstream Cloudflare workerd licensing.

open-compute (elliothux/open-compute)

Searching Database…

这是什么?open-compute 是一个自托管平台,可以在你自己控制的硬件上原样运行 Cloudflare Workers 代码,把 Workers、KV、D1、R2、Durable Objects、Queues、Workflows、Cron、Cache、Images、Vectorize 和 AI Search 重新实现为单个 Rust 二进制文件。
这只是 workerd 运行时,还是一个完整的平台?它是构建在 workerd 之上的完整平台。workerd 只在沙箱中执行隔离的 Workers;open-compute 补上了缺失的控制平面——路由、持久化状态、调度和部署生命周期——并将这一切打包为单个二进制文件(ocd)。
我怎么在上面部署我的第一个 Worker?先在本地把平台启动起来,然后使用你已有的、与 Cloudflare 相同的 Wrangler CLI 进行部署。一条命令即可完成类型检查、打包、部署并运行 Worker。在生产环境中,它以一个可执行文件、一个配置文件和一个数据目录的形式运行。
构建和运行它需要安装什么?构建它需要 Rust 1.98、Bun 1.3.14、Node 26 和 Git LFS。编译好的生产二进制文件则完全不需要这些——启动时宿主机上既无需构建工具,也无需网络访问。
还有哪些 Cloudflare 功能尚未实现?Workers AI、Containers、Hyperdrive、Analytics Engine、Workers for Platforms、Pipelines、Rate Limiting、mTLS 证书以及 Tail Workers/Logpush 都还处于 0%,尚未实现。Vectorize 和 AI Search 只完成了 80%。
它能像真正的 Cloudflare 那样跨多台机器扩展吗?不能,它从设计上就明确是单节点的:一个数据目录、一个进程、一台机器,没有 Cloudflare 真实边缘网络那样的 Anycast 路由或跨区域复制。
它会向 Cloudflare 回传信息或需要账户吗?不会——它完全离线运行,不需要 Cloudflare 账户,没有外呼请求,没有遥测,也没有账单。
它与真实 Cloudflare 行为的实际吻合度有多高?团队用相同的测试夹具对 open-compute 和真实 Cloudflare 进行验证,出现不一致就拒绝发布:实现了 2,097 个 API 成员且零缺口,7 个产品面全部逐一通过字节级验证,一个生产环境的 Next.js 16 构建在两者上的运行结果完全一致。
我的数据实际存放在哪里?平台元数据保存在本地 SQLite 数据库中,R2 数据、bundle 和缓存快照等对象字节默认存放在本地文件系统上,唯一的替代选项是可选的 S3 兼容存储——不需要 Redis 或外部数据库。
为什么要构建这个,而不直接使用 workerd?workerd 只运行隔离的 Workers——它本身没有路由、持久化状态、调度器或部署 API。open-compute 用完整的控制平面(ocd)包装原版 workerd,因此无需额外运行其他组件。
我还能使用 Cloudflare 控制台或 API 工具吗?Wrangler 几乎无需改动即可使用,锁定在 4.127.1 版本并经过 95% 验证,对接本地 /client/v4 API;同一 API 上还有一个单独的运维管理界面——不过它并不是 Cloudflare 自家控制台的克隆。
Creator
elliothux
Size
84.3 MB
Stars
2K
Age
1mo
Commits · 90 Days