The general-purpose runtime for AI.
A lightweight native runtime for AI apps, tools, and agents (under 10 MB). No Python environments, no background daemons, no Docker bloat — just fast, self-contained code that runs anywhere from cloud servers to smart devices.
v0.3.0-beta) and actively evolving. Certain features, modules, and runtime behaviors may not yet function properly or as expected across every environment. If you encounter any issues, bugs, or anomalies, please feel free to report them directly to hello@sofuu.xyz.Collapse the Frankenstein AI Stack: The In-Process Runtime for AI.
Building AI applications in Node.js, Bun, or Python today means stitching together 5 separate daemons, gigabytes of dependencies, and fragile localhost IPC. Sofuu provides a unified, in-process runtime for AI that executes local models, autonomous agents, and vector memory inside a single process.
5 Daemons, Memory Bloat & Fragile Abstractions
- ✕Runtime Bloat: Python 3.12 or Node/Bun, each with its own install and a large dependency tree.
- ✕One possible architecture: A separate model service such as Ollama, vLLM, or llama.cpp.
- ✕Optional vector service: Some applications choose an external vector database.
- ✕Libraries: Applications may choose orchestration libraries based on their needs.
- ✕Deployment: Multi-process stacks can require additional configuration and resources.
- ✕Mobile constraints: Runtime and background execution rules vary by platform.
Single Binary, In-Process Memory & Zero Daemons
- ✓Pure Native Binary: Under 10 MB single binary with bundled QTSQ cognitive memory across macOS and Linux. QuickJS ES2023 engine and libuv non-blocking event loop.
- ✓Standalone Agent Compiler:
sofuu compilepackages supported programs into single native executables. OS libraries and selected model or service dependencies may still be needed. - ✓Continuous Memory (CMA v2): Local vector memory encrypted by default, with an explicit plaintext mode. The first encrypted flush uses a 64 MiB Argon2 derivation; subsequent derivations can use the cache.
- ✓Native MCP Engine: Built-in Model Context Protocol client and server across stdio, SSE, and direct in-process transports.
- ✓In-Process Hardware Inference [Experimental - Preview]: Metal GPU shaders and ARM NEON / AVX2 kernels (early-stage engine; production inference routes via llamacpp plugin).
- ✓Deterministic R7 Security: One policy evaluator governing tools, shell, filesystem, network, and MCP when configured.
- ✓Universal Deployment: macOS, Linux, servers, edge IoT (Pi 5), and iOS/Android apps via
libsofuu.
Architecture Comparison: Sofuu vs. Node.js vs. Python & Ollama
How an in-process native AI runtime compares against traditional background daemon architectures.
| Architecture Feature | Sofuu general-purpose AI runtime | Node.js / Bun + LangChain | Python + Ollama / vLLM |
|---|---|---|---|
| Execution Model | Pure In-Process Native Engine | Web runtime + external daemons | Interpreted script + server daemon |
| Binary / Install Size | Under 10 MB (single binary) | Node runtime + large node_modules tree | Python + virtualenv |
| Architecture & Daemon Footprint | Single process (zero daemons; ~14.9 MB RSS in the HTTP harness below) | 2–3 daemons (Node + Chroma + Ollama) | Container stack (Python + Torch + Redis) |
| Standalone Binary Compiler | Built-in (sofuu compile) | Requires heavy pkg / ncc / electron | PyInstaller / PyOxidizer (100MB+) |
| Local LLM Inference | Built-in (Metal, NEON, AVX2) [Experimental - Preview] | Requires separate Ollama daemon | Separate background daemon |
| Vector Database & Memory | Built-in QTSQ (CMA v2); Qdrant/Pinecone/pgvector adapters opt-in | External Chroma / Pinecone / Qdrant | External vector database |
| Model Context Protocol (MCP) | First-class client & server native | Third-party npm packages | Third-party pip packages |
| Mobile & Edge (iOS/Android/RPi) | Fully supported (libsofuu zero-JIT C ABI) | Prohibited by iOS App Store (JIT policy) | Mobile OS kills background daemons |
| Cold Start (process → eval 1+1) | 22.5 ms median · macOS arm64 (wall clock incl. spawn, 31 runs) | Bun 12.4 ms · Node 31.8 ms (older BENCHMARKS.md rows) | CPython 28.5 ms (older row) |
| HTTP Process → First Response | 39.4 ms measured | 32.4 ms (same harness) | Seconds to minutes (daemon warm-up) |
Runtime primitives in one process.
Selected local workflows run in-process. External model providers, servers, and remote tools may require additional processes or network access.
Kaze Declarative Agent DSL
Write domain-specific routines in Kaze (.kaze) and compile supported code. Real Kaze model and tool integrations remain an open milestone; the current embedded host can return synthetic results.
Metal GPU & Local Inference [Experimental - Preview]
In-process GGUF/SafeTensors engine with Metal and NEON/AVX2 kernels. Maintained as an experimental research track; for production workloads, connect the llamacpp plugin provider or remote endpoints.
Standalone Agent Compiler (sofuu compile)
Turn any TypeScript/JavaScript agent into a single, self-contained native executable. Bundles QuickJS bytecode and optional .qtsq vector brains behind a 32-byte SOFUU_BIN_V1 trailer with automated Mach-O codesigning.
Autonomous Agent Runtime & Tool Belt
The native agent runtime for JavaScript and TypeScript with cooperative step scheduling (scheduler.yield()), single-instruction fuel sandboxing (code_eval), AST syntax dry-runs, and real-time QTSQ trace streaming.
Continuous Memory (CMA v2)
Local vector memory encrypted by default, with an explicit plaintext option. The first encrypted flush incurs a 64 MiB Argon2 derivation; the derived key can be cached in-process.
Native MCP Protocol Engine
Built-in Model Context Protocol client and server over stdio, SSE, and direct in-process transports. Connect external tools, IDEs, and local services via standard JSON-RPC without Python virtual environments.
Node.js & Web Standards Compatibility
Built-in compatibility shims for TextEncoder, URL, Web Crypto, Buffer, EventEmitter, synchronous filesystem primitives, and virtual resolution for node:path, fs, crypto, zod, and leading AI SDKs. See COMPAT.md.
Unified R7 Security Firewall
Deterministic security boundary strictly evaluating tool execution, shell access, filesystem read/write paths, network egress, and MCP invocations.
Embeddable C ABI & No-JIT
QuickJS pure interpreter with zero-JIT execution. Fully compliant with Apple iOS App Store executable-memory policies. Swift & Kotlin bindings for native mobile apps.
One runtime for AI. Five application surfaces.
Sofuu is the universal runtime for AI engineered for every JavaScript AI surface — from terminal developer assistants to embedded mobile apps.
Interactive Developer CLI & macOS IDE
Interactive terminal coding assistant (sofuu chat) and native macOS companion IDE. Real-time streaming diffs, 25 themes, session persistence, and full MCP connectivity.
Embedded SDK & Native Android App
Embed private offline LLM inference (experimental engine) and encrypted cognitive memory into iOS and Android apps — or install the native Sofuu Android APK (14.0 MiB, 16KB page-aligned) with on-device workspaces and local inference.
Android APK (14.0 MiB) · libsofuu C ABIStandalone AI Backend Microservices
Replace heavy Python FastAPI containers with single-file TypeScript scripts. Serve streaming endpoints, rate-limited APIs, and autonomous agents on a $5 VPS with a 22.5 ms median cold start (process → 1+1, wall clock incl. spawn).
Edge Automation, Wearables & Robotics
Run autonomous agent loops on memory-constrained hardware (Raspberry Pi 5, IoT gateways, smart devices) with small resident set (~12–15 MB) and fast ARM NEON vector execution. Note: MAVLink drone flight controls and hardware GPIO line timers are an [Experimental - Preview] track.
ARM NEON · Edge Hardware & IoTDistributed Agent Mesh & Swarms [Experimental - Preview]
Experimental peer-to-peer agent swarms and speculative lookahead decoding clusters coordinating tasks and pipeline layers over local LAN sockets.
P2P Sockets · Multi-Agent MeshUnified Entry Points.
Write standard JavaScript and TypeScript. Selected workflows run in-process; packages and external services depend on the application.
Verified Technical Receipts.
Measurements are specific to the artifact, workload, hardware, and date; see the benchmark notes for conditions and limitations.
Zero-Copy Memory-Mapped Weights
Supported models can use memory-mapped weights. Startup and memory usage depend on the model, operating system, and workload.
In-Process SIMD Operations
Vector similarity search, dot products, and Ebbinghaus decay compute directly in CPU SIMD registers without network or IPC serialization hops.
Deterministic R7 Sandbox
R7 checks are available on supported tool, shell, network and filesystem paths. Coverage and approval handling vary by surface; plugins run in-process and must be trusted as code. The threat model describes known boundaries.
Install Sofuu CLI & Android App.
One shell command verifies the SHA-256 checksum and adds sofuu to your PATH. No Sofuu account is required for local CLI use; OS libraries and workflow-specific resources may be needed.
# 1. Install globally$ curl -fsSL https://sofuu.xyz/install | sh# 2. Run the 10-second Hello World (0 keys, 0 model downloads)$ sofuu eval 'const b = sofuu.memory.open("./b.qtsq", 768); b.remember(sofuu.ai.embedLocal("runtime"), "One binary. Zero daemons."); console.log(b.recall(sofuu.ai.embedLocal("speed"), 1)[0].text);'One binary. Zero daemons.# 3. Launch the autonomous developer workspace$ sofuu chat# 4. Run any AI agent or microservice$ sofuu run quickstart.js
Direct Release Downloads
Self-contained static archives and native Android APKs with bundled QTSQ cognitive memory and SHA-256 integrity checksums:
Start from your problem.
Four focused guides: build AI features, understand the runtime, host or consume MCP servers, or check the honest trade-offs before choosing.
Frequently Asked Questions.
Key technical facts about Sofuu's in-process architecture, security boundaries, and runtime performance.
What makes Sofuu different from Node.js, Bun, and Deno?
What is Kaze and why would I use it instead of JavaScript or Python?
Does Sofuu require Python, Ollama, or CUDA?
What is QTSQ Cognitive Vector Memory?
embedLocal uses a 768-dimensional trigram hash rather than a trained semantic model. Remote adapters are opt-in; search performance varies by workload and device.Can Sofuu use an external vector database?
sofuu.memory.open() defaults to the embedded QTSQ engine; passing adapter: "qdrant", "pinecone", or "pgvector" (or a custom {remember, recall} object) routes the same API to that backend. Adapters are opt-in, gated by the R7 net policy, and never selected implicitly.Can I use cloud LLM providers (OpenAI, Anthropic, DeepSeek) with Sofuu?
sofuu.ai.stream() and sofuu.ai.complete() for OpenAI, Anthropic, DeepSeek, or any OpenAI-compatible endpoint with your own API keys. You can mix local edge inference and cloud streaming seamlessly.Which operating systems and architectures are officially supported?
libsofuu C ABI for iOS and Android.How fast does Sofuu start up?
1+1 measures 22.5 ms median wall clock including process spawn (31 runs, Apple M2 Pro / macOS 15.7.3, current tree — BENCHMARKS.md, 2026-10-31); the published 0.3.0-beta artifact measures 61.5 ms the same way and is scheduled for republish. sofuu version, which loads no engine, is a 5.0 ms process floor. The 3.8 ms / 4.2 ms / 38.2 ms rows still in BENCHMARKS.md predate the current engine, and BENCHMARKS.md marks them historical. A separate same-harness HTTP measurement, process spawn to first response, is 39.4 ms (Node 22: 32.4 ms, Bun 1.3: 25.8 ms). Because QuickJS has no JIT warmup and libuv provides immediate non-blocking event-loop execution, Sofuu is a good fit for serverless edge workers, CLI tools, robotics, and mobile embedded runtimes.