Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

mlx-beam

B.E.A.M. — Batched Engine for Apple Metal. Light and modular inference engine, built on MLX.

Work in progress. See the feature table below and the changelog.

Install

uv tool install mlx-beam
beam serve --model p4ik/Qwen3.8-27B-MLX-OptiQ-5bit --draft-model bundled

Inside a uv project: uv add mlx-beam, then uv run beam serve ....

beam doctor reports the Python, MLX, device and memory it sees (--json for scripts) and exits non-zero when MLX is missing or fails to load.

Serve

beam serve --model p4ik/Qwen3.8-27B-MLX-OptiQ-5bit --port 8000 \
  --max-completion-tokens 4096 --min-response-tokens 512 --max-reasoning-tokens 8192 \
  --kv-bits 8

An OpenAI-compatible server (/v1/chat/completions, /v1/completions, /v1/responses, /v1/models) with Anthropic's Messages API beside it (/v1/messages; point ANTHROPIC_BASE_URL at it), /health reporting what was actually built and /metrics as plain-text counters. Flags follow mlx-lm's names where mlx-lm has one; beam serve --help lists them, and the configuration page has the same tables next to the request fields and what a checkpoint brings along. Off loopback the server wants --api-key. --draft-model bundled turns on speculative decoding with the draft head a checkpoint ships.

Features

Everything the engine does, with where each piece stands.

Feature What it does State
OpenAI API Chat completions, completions, Responses and models, with streaming. built
Anthropic API Messages with thinking blocks and tool use, on the same token path. built
Health and metrics /health shows each capability with evidence; /metrics serves counters. built
Access control An API key is required off loopback; Host check and CORS allowlist. built
CLI beam serve takes mlx-lm's flag names; beam doctor checks the machine. built
Continuous batching Short requests are answered beside a long prefill, capped by a valve. built
Prefix cache The KV of a shared prefix is reused, for recurrent and window layers too. built
Prefix cache SSD tier A second tier on SSD lets entries outlive eviction from RAM and restarts. planned
Mixed-precision KV cache Bits per layer come from the conversion; quantized after or during prefill. built
Multi-token prediction An own draft head predicts ahead, verified exactly, one request at a time. built
Batched MTP Several requests speculate at once. planned
Expert streaming Models larger than memory run with experts streamed from SSD. planned
Reasoning control Thinking on or off, a budget per request, effort levels, marker families. built
Tool calling Parsers per model family and a repair ladder that reports every step. built
Sampling controls Temperature, top-p/k, min-p, penalties, logit bias, seeds and defaults. built

Extras are packages or optional installs beside the core; the core runs without any of them.

Extra What it does State
Vision Image input through the mlx-beam-vision package; families on the models page. built
Audio Audio input for models that take it, as its own package. planned
Convert Quantizes into the package layout: mixed-precision weights, KV profile, draft head and tower. planned
Structured JSON schema and grammar-constrained decoding. planned
GGUF GGUF checkpoints load behind a guard. planned
Images Image generation and editing through the Images API. planned

The engine reads standard MLX checkpoints. A checkpoint in the B.E.A.M. package layout (extras/manifest.json next to the shards; see the model cards under huggingface.co/p4ik) also tells it how its draft head was quantized and which KV prefill mode its profile was measured with. Which model families the engine handles with what - architecture, thinking, tool calls, vision, draft head - is on the models page.

Why it exists

Existing MLX servers either stop at the basics or grow things that have no place in an inference engine: a built-in game, a cloud path that arrives with an update. The ones we ran daily also had bugs where it matters most: prefix cache, batching under load, vision. B.E.A.M. keeps the core to the token path and fixes those paths at the source. Everything else is a package or an extra you choose to install; nothing ever ships in the core that you did not ask for.

Measured

Measured numbers are published as they are measured, with machine, model and date. Mac mini M4 Pro 64 GB, Qwen3.8-27B 5-bit with 8-bit KV, one request, 2026-09-26 (0.1.0a6): decode 11.4 tok/s at 12 000 generated tokens; prefill 115 tok/s over a 16 588-token prompt; a short request answered in 2.4 s while that prefill ran; 45 minutes under a steady stream, 5 057 requests, none failed. Speculative acceptance and batch numbers follow when they are measured the same way.

Contributing

See CONTRIBUTING.md. Rules for coding agents are in AGENTS.md.

License

Apache-2.0. Vendored components keep their own licenses; see NOTICE.

Metadata

Release files for mlx-beam 0.1.0a12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlx-beam 0.1.0a12
File Size Uploaded Provenance Actions
mlx_beam-0.1.0a12.tar.gz 593.2 kB With provenance Details for mlx_beam-0.1.0a12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlx-beam 0.1.0a12
File Interpreter ABI Platform Actions
mlx_beam-0.1.0a12-py3-none-any.whl Python 3 none any Details for mlx_beam-0.1.0a12-py3-none-any.whl

Total release size: 1.2 MB

Release files / mlx_beam-0.1.0a12.tar.gz

Download URL mlx_beam-0.1.0a12.tar.gz
Size 593.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a7ee66b4157cfc34d8fbaa98de74228b50867c2ecad394064e2ceae56a6c6cb0
BLAKE2b-256 checksum
How to use checksums
64df0c9679d4c09f2a22732cad01130c4b54e7227aae9d2c724f176ff228805e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / mlx_beam-0.1.0a12-py3-none-any.whl

Download URL mlx_beam-0.1.0a12-py3-none-any.whl
Size 598.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933138f8fd4c6a85b95c024bb804ee110c4d5681fc71e7c24e8a374d3310a5da
BLAKE2b-256 checksum
How to use checksums
e37f99b2eaae846ebf4a3ff015d42a27787f4c28799b02e9faafb3ae724f2963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for mlx-beam 0.1.0a12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mlx_beam-0.1.0a12.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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