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.0a10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlx_beam-0.1.0a10.tar.gz | 534.4 kB | With provenance | Details for mlx_beam-0.1.0a10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mlx_beam-0.1.0a10-py3-none-any.whl | Python 3 | none | any | Details for mlx_beam-0.1.0a10-py3-none-any.whl |
Total release size: 1.1 MB
Release files / mlx_beam-0.1.0a10.tar.gz
| Download URL | mlx_beam-0.1.0a10.tar.gz |
|---|---|
| Size | 534.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3dc75d51e88f08e57b6c749ea1b027f5d3cab26c0ec35afa0f9484d517cc8b1
|
|
BLAKE2b-256 checksum How to use checksums |
3e7a0bc6130e43d85eca9d5beab7f949173944a38496f86087c8f2f7934919bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 4, 2026.
Transparency logRelease files / mlx_beam-0.1.0a10-py3-none-any.whl
| Download URL | mlx_beam-0.1.0a10-py3-none-any.whl |
|---|---|
| Size | 582.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
735927468a2b8a365037d05df917118eea04c020fb466fc2aba29f33eefa6e49
|
|
BLAKE2b-256 checksum How to use checksums |
9811650b7f886b149139321be463e148cc5216c045f3d5a8edb7f570c142fcb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 4, 2026.
Transparency logSecurity for mlx-beam 0.1.0a10
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.
Attestation for mlx_beam-0.1.0a10.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 Oct 4, 2026.
Transparency logA 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.