Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

mojo-bento v0.1.2

Choose a tag to compare

@amarbarosys amarbarosys released this 04 Nov 19:33
· 11 commits to main since this release

mojo-bento v0.1.2

Released: 2026-11-04 · Commit: e50431c · Previous: v0.1.1

What it does

BentoML's serving core as a Mojo library: an epoll HTTP/1.1 server, typed JSON endpoints whose answers (success and
validation errors) are byte for byte BentoML 1.4.39's, health and Prometheus metrics, sd_notify and a graceful drain,
chunked and SSE streaming, an adaptive request batcher, a BentoML-layout model store, and bento build to package a
service into one directory. Linux x86-64, Mojo 1.2. It imports six libraries by the same author (aio, gguf-core, json,
posix, safetensors, systemd).

Highlights

  • One unauthenticated request could crash v0.1.1: a chunk size of 16 hex digits wrapped negative and passed the
    413 check. It is now refused like a declared Content-Length past max_body.
  • ModelStore.delete on an item whose weights directory is a symlink deleted the shared weights outside the store.
    It now removes the link only.
  • A list field of 100k elements validates in 21 ms instead of 8665 ms (it was quadratic).
  • The six libraries bento used to copy into src/ are now dependencies, each pinned to a commit.

Changes

Added

  • scripts/deps.sh: fetches the six libraries into lib/, each pinned to a commit; recipe.yaml (conda package
    mojo-bento, depending on the six mojo-* packages); docs/design.md.

Changed

  • The server runs on mojo-aio's epoll loop; bento's own TCP/epoll layer is gone (same design: worker threads on one
    epoll set, EPOLLONESHOT).
  • Builds take -I src -I lib (scripts/mojo.sh does it).
  • Builds on Mojo 1.3 nightly (1.3.0.dev2026110305) as well as 1.2.0.

Fixed

  • http: a chunk size past max_body is refused while its digits are read (was: signed overflow, server killed).
  • store: delete never follows a symlinked directory.
  • server: serve() closes every connection it accepted on return (idle keep-alive clients hung, a second Server
    in one process leaked fds).
  • endpoint: list fields coerce in one pass (Json.items()), O(n) instead of O(n^2).
  • pyproject.toml version matches the tag (it said 0.1.0 at v0.1.1).

Removed

  • src/aio, src/gguf, src/json, src/posix, src/safetensors, src/systemd and docs/vendored.md
    (2234 lines of copies).

Verified

Check Result
scripts/ci.sh on Mojo 1.2.0, lib/ built from git archive of each pinned commit PASS (b1-b6, batch-replay, batch-threads, serve_restart, list-field perf, quickstart)
scripts/deps.sh fetch, GitHub URLs rewritten to the local repos PASS (each fetched tree equal to the library's src/)
mojo precompile src/bento -I lib PASS (309 KB .mojoc)
One program importing bento, gguf-core, ggufx, safetensors and mojo-log, opening files through each PASS (links, runs)
mojo-lib-audit PASS
mojo-upgrade check on Mojo 1.3 nightly 1.3.0.dev2026110305 PASS 9/9

Known limits

  • scripts/deps.sh needs the pinned commits on GitHub; a clean-container CI run is UNVERIFIED until they are pushed.
  • The systemd and sandbox gates (b4systemd, b7) run locally only (scripts/local-gates.sh); not rerun for this release.
  • The conda package is not published yet.

Upgrade / run

uv sync
scripts/deps.sh                                   # new: the six libraries into lib/
mojo build -I src -I lib app.mojo -o app          # was: -I src

Commits

  • e50431c build: pin gguf-core v0.1.3
  • c5c3551 build: pin posix v0.1.3, safetensors v0.1.3, systemd v0.1.2
  • fe6edc5 build: conda recipe and docs/design.md
  • 15789a5 build: import the six sibling libraries instead of vendored copies
  • 35ff04c fix: pyproject version 0.1.1, as tagged and in CHANGELOG
  • c856051 fix: sync vendored gguf-core (reader allocations, nesting depth cap)
  • c52e13b fix: build on Mojo 1.3 nightly
  • 526da94 refactor(server): unsafe_offset instead of the deprecated pointer +
  • 392cbc5 fix(server): serve() closes the connections it accepted
  • b9c8dcb perf(endpoint): coerce list fields in one pass with Json.items()
  • 509643e fix: sync vendored gguf-core and safetensors with their bounds fixes
  • 9a5dbda docs: vendored versions match the synced tags (posix 0.1.2, json 0.1.1, systemd 0.1.1)
  • 38365e8 fix(store): delete removes a symlinked directory as a link, never follows it
  • 3b5b9e8 fix(http): refuse a chunk size past max_body while its digits are read
  • 40b843b refactor: run the server on mojo-aio, delete bento's own epoll/TCP layer
  • 5c12791 docs: CI, latest-release and license badges