Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 4 min read Case study mediumAdept

Serverless Jupyter Notebooks at Meta

Meta's Bento notebook platform now runs "lite" workloads directly in the browser using Pyodide on WebAssembly, skipping the slow remote-compute reservation step. A kernel bridge lets the Pyodide kernel speak the Jupyter protocol like server kernels, a web worker keeps expensive kernel operations off the main thread, and middleware intercepts cell magics (%%sql, %%googlesheet, %%graphql, %%dataframe) in JavaScript and injects their results into the Python kernel. Uploads are handed off to async Tupperware jobs. The main limitation is that internal libraries not ported to Wasm are unavailable. Planned work includes auto-detecting lite workloads and falling back to server kernels when needed.

Assumes: Jupyter kernelsWebAssembly basicsWeb Workers

Related posts

  • How We Built the Turso Shell in the Browser

    Turso mediumAdept

    Turso's SQLite-compatible database can run entirely in the browser via WebAssembly, persisting data to OPFS with no backend. The walkthrough builds a SQL shell with Vite, React and TypeScript. It covers importing from the @tursodatabase/database-wasm/vite export to work around a Vite dev-server WASM issue, and setting COOP/COEP headers so SharedArrayBuffer is available. It then builds a query executor that maps prepared-statement results into a table, and upgrades the textarea to a CodeMirror editor with SQL highlighting, autocomplete and a Mod-Enter keybinding.

  • Gradio-Lite: Serverless Gradio Running Entirely in Your Browser

    Hugging Face mediumAdept

    Gradio-Lite (@gradio/lite) is a JavaScript library that runs Python Gradio apps entirely in the browser using Pyodide, the WebAssembly build of CPython, so no server is needed. Apps are written in Python inside a <gradio-lite> HTML tag. Multi-file apps use <gradio-file> tags with an entrypoint, and extra dependencies are installed via micropip from a <gradio-requirements> block, for example transformers_js_py for in-browser sentiment classification. The main costs are a 5–15 second initial load while Pyodide downloads and the fact that only Pyodide-compatible packages work.

  • Introducing Turso in the Browser

    Turso mediumAdept

    Turso, a from-scratch SQLite rewrite, now runs in the browser via WebAssembly as the npm package @tursodatabase/database-wasm, with a better-sqlite3-like API whose methods are all async because of OPFS. Query compute runs on the main UI thread, since benchmarks showed offloading to a worker cost too much in communication overhead. A Web Worker handles filesystem I/O through the synchronous OPFS interface and shares buffers with the main thread via SharedArrayBuffer, which requires COOP/COEP headers and locks a database to one tab. The code is compiled to wasm32-wasip1-threads with napi-rs v3, and there are dedicated Vite and Turbopack exports plus a CDN build that inlines the WASM as base64 at the cost of a larger bundle.

  • Bringing Goodnotes to the web with Swift and WebAssembly

    Swift.org mediumAdept

    Goodnotes runs the same Swift code behind its iPad app in browsers by compiling it to WebAssembly with SwiftWasm, sharing 1.47M lines (66% of the 2.2M-line web codebase) including a rendering engine that targets Metal on iOS and WebGL on the web. The port required replacing libdispatch with Swift Concurrency, fixing code that assumed a 64-bit Int on wasm32, and abstracting I/O through dependency injection. WASI threads with Web Workers and SharedArrayBuffer, plus custom actor executors (SE-0392) that pin actors to specific workers, more than doubled INP but require cross-origin isolation. The roughly 50 MB binary (12 MB with Brotli) is cached with Service Workers, and Chrome DevTools debugging and a custom wasm-memprof heap profiler make the tooling workable. The WebAssembly support is upstreamed as of Swift 6.2.

  • Pyodide Spin Out and 0.17 Release

    Mozilla Hacks mediumAdept

    Pyodide, CPython 3.8 compiled to WebAssembly for running Python in the browser, has spun out of Mozilla into an independent, community-governed project, and Mozilla is winding down Iodide. The 0.17 release redesigns Python/JavaScript type translation so round trips return identical objects: only primitives convert implicitly, other objects are shared as proxies with explicit to_py/toJs/to_js converters. It also adds an asyncio event loop on the browser event loop with mutual awaiting of Promises and coroutines, and bidirectional exception translation. Migrating to upstream-LLVM Emscripten shrank SciPy from 92 MB to 15 MB and the base environment from 8.1 MB to 6.4 MB, with 25–30% faster runtime.

The quest for software engineering knowledge.

Look:
Layout: