Skip to main content

m0serve

Realtime from a synchronous Python app, with no added infrastructure.

A WSGI/ASGI server written in Mojo. Point it at a Django, Flask, FastHTML or Starlette app and it serves it — no Mojo toolchain required, no compilation step, nothing to configure:

pip install m0serve
m0serve myproject.wsgi:application

What it adds over gunicorn or uvicorn is that a plain synchronous view can hold a Server-Sent Events stream or a WebSocket, by answering with two response headers — and reach every subscriber on every worker with one function call. No Channels, no Redis, no daphne, no Pushpin, no second process:

from m0serve import m0pub

def events(request):                    # an ordinary synchronous view
    r = HttpResponse(": connected\n\n", content_type="text/event-stream")
    r["M0-Hold"] = "stream"             # m0serve holds the connection open
    r["M0-Channel"] = "news"            # ...subscribed to this channel
    return r                            # Django's part in it ends here


def announce(request):                  # any view, command, or cron job
    m0pub.publish("news", "deploy finished")
    return HttpResponse("ok")

Run it with m0serve myproject.wsgi --realtime. The view runs first, with sessions and permissions in hand — which is where your auth belongs. Under gunicorn the two headers are ignored and the same view degrades to a short plain response, so adopting this is not a fork of your codebase.

The ten-minute quickstart goes from pip install to live multi-tab sync from one synchronous Django file: https://github.com/codetalcott/mojo-http/blob/main/QUICKSTART.md — every command in it is executed by CI on every pull request.

It also hosts several applications in one process, each in its native execution mode: m0serve --mount /=shop.wsgi --mount /app=live.asgi runs sync Django on handler threads and async FastHTML on an asyncio executor, behind one listener with one shutdown.

The protocol is detected from the object, so the same command serves WSGI and ASGI. m0serve --help lists the flags; --workers N, --threads N (on free-threaded CPython) and --blocking-threads N are the topology ones.

If something will not start, m0serve --doctor myproject.wsgi prints a JSON report — the interpreter it resolved and the virtualenv it came from, the spec it discovered, the topology it settled on, and every startup check with the fix for the ones that failed — and exits with the code the server itself would have used. It binds nothing and imports nothing twice.

What is in the wheel

One compiled binary and the Mojo runtime it loads. No CPython — m0serve resolves libpython at run time from the interpreter it is installed beside, which is why there is no ABI tag and one wheel per platform covers CPython 3.10 through 3.14, free-threaded builds included. It has no Python dependencies and fetches nothing at install time.

Install it into the same virtual environment as your application, the way you would gunicorn or uvicorn; the console script points the embedded interpreter at that environment.

Platforms

platform status
macOS arm64 (Apple Silicon) supported
Linux x86_64 (glibc) supported
Linux aarch64 (Graviton, Ampere, arm64 Docker) supported
macOS x86_64 (Intel) not possible — Modular ships no Intel Mac toolchain
musl / Alpine, Windows not supported

The wheel's filename carries the exact macOS and glibc floors it was built against. On an older system pip declines to install it rather than installing something that crashes.

Status

Pre-1.0 and deliberately small: HTTP/1.1 only, no TLS, no HTTP/2 — terminate at a proxy, which is gunicorn's answer too. The API will change before 1.0.

Source, documentation and issues: https://github.com/codetalcott/mojo-http

Licence

MIT, and the wheel redistributes third-party components under their own terms — the Mojo runtime (Apache-2.0 with LLVM Exceptions) and a fork of lightbug_http (MIT). Full text and attribution ship inside the wheel; see NOTICE.txt beside the installed package.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

m0serve-0.12.0-py3-none-manylinux_2_35_x86_64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

m0serve-0.12.0-py3-none-manylinux_2_35_aarch64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

m0serve-0.12.0-py3-none-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded Python 3macOS 13.0+ ARM64

File details

Details for the file m0serve-0.12.0-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for m0serve-0.12.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0c8028843187573de79f3a8b7f5c39ca19a09a8a385e0accc2385323b9c6ac9f
MD5 d621f5ccc8638d29f2493f4f67b8e7fe
BLAKE2b-256 500ecb3bdfc1f96dfac932681df49121454550af57019394bddcb722a6e9d62e

See more details on using hashes here.

Provenance

The following attestation bundles were made for m0serve-0.12.0-py3-none-manylinux_2_35_x86_64.whl:

Publisher: release.yml on codetalcott/mojo-http

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file m0serve-0.12.0-py3-none-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for m0serve-0.12.0-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 16d6739eba72fa09a5888c63f0899cd6a79b1cd2a6f3c3dc159dfe2bd38ec032
MD5 b8241fe01ed95860f5f4f944f8ded34a
BLAKE2b-256 7c75c68ce8c0e2fa1d3da0ae2c5fde1ca4b9b9926cdb48777b5aea4b1c5e4f47

See more details on using hashes here.

Provenance

The following attestation bundles were made for m0serve-0.12.0-py3-none-manylinux_2_35_aarch64.whl:

Publisher: release.yml on codetalcott/mojo-http

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file m0serve-0.12.0-py3-none-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for m0serve-0.12.0-py3-none-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 970d7f22d089e34773807209f11d37f9aae56cf1f6179deedb9301efb4b6c550
MD5 ff9bd7e59ddff1b045fa4a1c9d6356ed
BLAKE2b-256 752c1a37f1a42e771edc332e1e02270c113f79c56d28145f2ec5fd180d2efb25

See more details on using hashes here.

Provenance

The following attestation bundles were made for m0serve-0.12.0-py3-none-macosx_13_0_arm64.whl:

Publisher: release.yml on codetalcott/mojo-http

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.17.0

3 files

0.16.0

3 files

0.15.1

3 files

0.15.0

3 files

0.14.1

3 files

0.14.0

3 files

0.13.0

3 files

This release

0.12.0 This release

3 files

0.11.0

3 files

0.10.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page