tokenworm vs OpenAI Agents SDK
OpenAI-published agent SDK
OpenAI Agents SDK and tokenworm overlap on the agent-loop layer but diverge on deployment. OpenAI Agents SDK is a Node or Python package that targets OpenAI models, uses container-based sandboxing, and represents sessions as state objects. tokenworm is a native Zig binary that targets five providers, sandboxes at the OS layer, and uses a portable binary session blob.
All rows below come from the tokenworm README's "Why Tokenworm?", "Performance", and "Comparison with Other Agent SDKs" tables. The README marks several values "N/A" — we surface those verbatim rather than guess. We deliberately did not add rows the README does not document.
| Dimension | tokenworm | OpenAI Agents SDK | Advantage |
|---|---|---|---|
| Runtime dependency | None (native binary) | Node.js or Python | tokenworm |
| Binary size | 960KB (ReleaseSmall) | N/A (~200MB runtime) | tokenworm |
| Cold start | 8ms | ~500ms (520ms in the perf table) | tokenworm |
| Idle memory | 2.4MB | ~38MB | tokenworm |
| Sandbox | OS-native (bwrap, seatbelt) | Container-based | tokenworm |
| Language SDKs | 5+ (C ABI → any language) | 2 (Python, TS) | tokenworm |
| Multi-provider | Yes (5 providers) | OpenAI-only | tokenworm |
| Session format | Binary .tworm | State object | tokenworm |
| Deployment model | Embeddable library (libtokenworm.so) | Package dependency | tokenworm |
| Implementation language | Zig (native) | TypeScript, Python | Comparable |
| Install | Single binary / brew / npm / pip | npm install / pip install | Comparable |
| Built-in tools | 6 | Hosted + function tools | OpenAI Agents SDK |
| Subagents | Yes (AgentDefinition) | Yes (handoffs) | Comparable |
| Hooks | 18 shell-based | Guardrails | tokenworm |
| Skills | SKILL.md files | Via skills tool | Comparable |
| MCP | stdio + SSE | Config-based | Comparable |
| Streaming | SSE + callback | Async iterator | Comparable |
| Cancellation | SIGINT + API | runner.cancel() | Comparable |
| Embeddable | libtokenworm.so | No | tokenworm |
| Session save (100 msgs) | 0.4ms | 8ms | tokenworm |
| Session load (100 msgs) | 0.6ms | 10ms | tokenworm |
| Session size (100 msgs) | 24KB (.tworm) | 98KB (JSON) | tokenworm |
| Tool dispatch overhead | 0.01ms | ~2ms | tokenworm |
| Token overhead per task | 1.0x (minimal prompt) | 1.3x | tokenworm |
| License | MIT | Apache 2.0 | Comparable |
Pick tokenworm when
- ▸You need to drive multiple providers (OpenAI, Anthropic, Ollama, MiniMax, OpenCode Zen) from one agent core
- ▸You want a 960KB binary that ships without a 200MB language runtime alongside it
- ▸You want OS-native sandboxing — bwrap on Linux, sandbox-exec on macOS — rather than spinning up containers
- ▸You want a portable binary session format that resumes across the CLI, Python, TypeScript, and Go bindings
- ▸You want to embed the agent core in another binary via the C ABI rather than as a package dependency
- ▸A 0.01ms tool-dispatch overhead matters for tools that fire frequently in tight loops
Pick OpenAI Agents SDK when
- ▸You are committed to OpenAI as the model provider and want the vendor-published SDK
- ▸You prefer hosted tools that come pre-built into the SDK (the README notes OpenAI ships "Hosted + function tools")
- ▸You are happy with Node or Python as the runtime and the container-based sandbox model
- ▸You want the polish of an SDK maintained by the model vendor
Both choices are reasonable for different jobs.
OpenAI Agents SDK is the vendor-published path; tokenworm is the systems-language bet. The numbers above come from the README's own benchmarking on Linux x86_64 (Intel i7-13700K, 32GB RAM) — pull the repo and rerun them if you want to verify.