Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a510953
Add resumable model download with retry, timeout, and offline mode
janhilgard Feb 12, 2026
c6cf218
fix: populate tokens field in BatchedEngine.generate()
mmcaulif Mar 28, 2026
59fb020
feat: add MiniMax tool call parsing support
sjswerdloff Mar 29, 2026
d34b758
perf(reasoning): replace O(N) text scanning with O(1) state machine i…
penumbraforge Mar 29, 2026
e8cb232
fix: normalize messages before chat template application
Thump604 Mar 31, 2026
af33ec9
fix: remove unused pytest import
Thump604 Mar 31, 2026
d19a8d3
style: format test file with black
Thump604 Apr 1, 2026
705586b
feat: add Gemma 4 multimodal model support
Apr 3, 2026
98c682d
fix: Gemma 4 BatchKVCache, reasoning parser, and MLLM stop tokens
janhilgard Apr 6, 2026
dc2279d
fix: RotatingKVCache support in MLLM batching and missing return in t…
Apr 9, 2026
0c47a67
Upgrade mlx-vlm and torchvision so Qwen3.5 multimodal will run
perry2of5 Apr 10, 2026
588d206
handle error finish_reason in mllm_scheduler, format batched.py
waybarrios Apr 10, 2026
a147fb5
feat: add Gemma 4 multimodal model support (#268)
waybarrios Apr 10, 2026
6f0efc2
fix: patch Gemma 4 attention and RotatingKVCache for BatchKVCache
janhilgard Apr 10, 2026
95fe84d
Merge pull request #256 from janhilgard/fix/gemma4-batched-rope
waybarrios Apr 10, 2026
01c2779
Merge branch 'main' into fix-qwen3.5-mllm-startup
perry2of5 Apr 10, 2026
c50d7db
feat: add Gemma 4 tool call parser (#269)
jackneil Apr 10, 2026
31017b0
feat: add full sampling params support for MLLM continuous batching (…
janhilgard Apr 10, 2026
5d93852
prefix_cache: preserve hybrid recurrent state across blocks (#217)
krystophny Apr 10, 2026
55cff4d
engine: keep SimpleEngine serialized across cancellation (#220)
krystophny Apr 10, 2026
8767fe6
scheduler: preserve prompt checkpoints in chunked prefill resume path…
krystophny Apr 10, 2026
fc25c8c
fix: include tokens in GenerationOutput for BatchedEngine when model …
mmcaulif Apr 10, 2026
b062186
Merge pull request #229 from mmcaulif/fix/batched-engine-tokens-field
Thump604 Apr 10, 2026
b274f27
fix(tests): apply black to batched engine generate test (#279)
Thump604 Apr 11, 2026
3110d1a
Merge pull request #276 from perry2of5/fix-qwen3.5-mllm-startup
waybarrios Apr 11, 2026
3c00c44
fix(reasoning): detect split think tags across deltas
Thump604 Apr 11, 2026
660552e
integrate tool call parser into reasoning parser streaming path (#253)
mxl Apr 11, 2026
7b1bfd4
honor tool_choice=none by stripping tools and suppressing parsing (#173)
Thump604 Apr 11, 2026
b9f2a5f
strip billing header from Anthropic system prompt for prefix cache (#…
janhilgard Apr 11, 2026
f61d34e
feat: backport production features — MTP, tool parsers, sampling, pre…
janhilgard Apr 11, 2026
99649d4
Merge pull request #278 from janhilgard/feat/production-backport
Thump604 Apr 11, 2026
6111dd5
chore: add Apache 2.0 license file
Thump604 Apr 11, 2026
9fe4d3f
Merge pull request #240 from Thump604/fix/normalize-messages
Thump604 Apr 11, 2026
eff899e
Merge pull request #77 from janhilgard/feat/resumable-download
Thump604 Apr 11, 2026
6e1dd00
Merge pull request #282 from Thump604/codex/license-file
janhilgard Apr 11, 2026
d67fec4
Add <function=name> format support to Qwen tool parser
janhilgard Apr 11, 2026
e65f0e0
fix: import Path in tokenizer utils
Thump604 Apr 11, 2026
8a0d993
Merge pull request #281 from janhilgard/fix/qwen-tool-parser-function…
Thump604 Apr 11, 2026
0b8a876
Merge pull request #283 from Thump604/codex/tokenizer-path-import
Thump604 Apr 11, 2026
78255e8
add Rapid-MLX to README acknowledgments
waybarrios Apr 11, 2026
380b12d
fix: skip optimistic mtp rnn snapshots
Thump604 Apr 11, 2026
575f58b
Merge pull request #196 from Thump604/fix/mtp-optimistic-rnn-snapshot…
Thump604 Apr 11, 2026
1ffc4cf
Merge pull request #234 from penumbraforge/perf/reasoning-parser-stat…
Thump604 Apr 11, 2026
fd34746
style: format MiniMax tool call tests
Thump604 Apr 11, 2026
cb9a9bd
Merge pull request #231 from sjswerdloff/feat/minimax-tool-call-parser
Thump604 Apr 11, 2026
89cfad4
feat: expose harmony tool parser in serve CLI
krystophny Mar 24, 2026
9fbdb7f
Merge pull request #284 from Thump604/codex/expose-harmony-tool-parse…
Thump604 Apr 11, 2026
f16f854
simple-engine: unify tool-enabled chat on streaming path (#10)
krystophny Mar 24, 2026
51b4f69
fix: preserve streamed tool-chat token ids
krystophny Mar 24, 2026
014edeb
remove dead token-encode block in tool-chat fallback
krystophny Mar 26, 2026
040a724
style: format simple engine tool-chat test
krystophny Apr 9, 2026
2990f7b
test: align tool-chat aggregation regression
Thump604 Apr 11, 2026
6bb4142
Merge pull request #285 from Thump604/codex/simpleengine-tool-chat-re…
Thump604 Apr 11, 2026
9d69467
fix(specprefill): avoid dense tail expansion within cache window (#291)
Thump604 Apr 12, 2026
4c79879
feat: full sampling parameter support (top_k, min_p, presence_penalty…
Thump604 Apr 12, 2026
d2e7f88
compatibility with mlx-lm 0.31.x (#294)
waybarrios Apr 12, 2026
7cfae14
feat: add --prefill-step-size CLI flag (#105)
kol22 Apr 12, 2026
ab68d94
refactor(simple): SimpleEngine.generate() becomes thin accumulator ov…
Thump604 Apr 12, 2026
0cafaab
feat(api): per-request SpecPrefill overrides on /v1/completions (#265)
Thump604 Apr 12, 2026
88b60b6
test: use anyio in async regression slice (#288)
Thump604 Apr 12, 2026
2cce3da
test: add tokenizer fallback regression coverage (#287)
Thump604 Apr 14, 2026
3f9cb1e
resolve merge conflicts with main (enable_thinking + run_blocking_ser…
waybarrios Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,5 @@ If you use vLLM-MLX in your research or project, please cite:
- [mlx-vlm](https://github.com/Blaizzy/mlx-vlm) - Vision-language models
- [mlx-audio](https://github.com/Blaizzy/mlx-audio) - Text-to-Speech and Speech-to-Text
- [mlx-embeddings](https://github.com/Blaizzy/mlx-embeddings) - Text embeddings
- [Rapid-MLX](https://github.com/raullenchai/Rapid-MLX) - Community fork of vllm-mlx
- [vLLM](https://github.com/vllm-project/vllm) - High-throughput LLM serving
55 changes: 55 additions & 0 deletions benchmarks/bench_reasoning_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""Benchmark: reasoning parser streaming performance.

Measures per-token overhead of extract_reasoning_streaming() at various
output lengths. Demonstrates the difference between O(N²) accumulated
text scanning and O(1) state-machine tracking.

Usage:
python benchmarks/bench_reasoning_parser.py
"""

import time

from vllm_mlx.reasoning.qwen3_parser import Qwen3ReasoningParser


def bench_streaming(parser, n_tokens: int, label: str) -> float:
"""Simulate n_tokens of streaming through the parser. Returns total ms."""
parser.reset_state()

# Simulate: <think> + N reasoning tokens + </think> + 10 content tokens
tokens = ["<think>"]
tokens += [f"word{i} " for i in range(n_tokens)]
tokens += ["</think>"]
tokens += [f"answer{i} " for i in range(10)]

accumulated = ""
start = time.perf_counter()
for tok in tokens:
prev = accumulated
accumulated += tok
parser.extract_reasoning_streaming(prev, accumulated, tok)
elapsed = (time.perf_counter() - start) * 1000

print(f" {label}: {n_tokens:>6} tokens -> {elapsed:>8.2f}ms "
f"({elapsed / (n_tokens + 11):.3f}ms/tok)")
return elapsed


def main():
parser = Qwen3ReasoningParser()

print("Reasoning parser streaming benchmark")
print("=" * 60)
print()

for n in [50, 100, 200, 500, 1000, 2000, 5000]:
bench_streaming(parser, n, f"{n} tokens")

print()
print("At 50 tok/s, per-token budget is 20ms.")
print("Parser overhead should be <0.1ms/tok to be negligible.")


if __name__ == "__main__":
main()
5 changes: 3 additions & 2 deletions docs/reference/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Browse thousands of pre-optimized models at: **https://huggingface.co/mlx-commun
| Mistral / Devstral | 7B, Mixtral 8x7B | 4-bit, 8-bit |
| Qwen2/Qwen3 | 0.5B to 72B | Various |
| DeepSeek V3, R1 | 7B, 33B, 67B | 4-bit |
| Gemma 2, 3 | 2B, 9B, 27B | 4-bit |
| Gemma 2, 3, 4 | 2B, 9B, 27B | 4-bit |
| GLM-4.7 | Flash, Base | 4-bit, 8-bit |
| Kimi K2 | Various | 4-bit |
| Phi-3 | 3.8B, 14B | 4-bit |
Expand All @@ -35,6 +35,7 @@ Browse thousands of pre-optimized models at: **https://huggingface.co/mlx-commun
| **Qwen-VL** | `Qwen3-VL-4B-Instruct-3bit`, `Qwen3-VL-8B-Instruct-4bit`, `Qwen2-VL-2B/7B-Instruct-4bit` |
| **LLaVA** | `llava-1.5-7b-4bit`, `llava-v1.6-mistral-7b-4bit`, `llava-llama-3-8b-v1_1-4bit` |
| **Idefics** | `Idefics3-8B-Llama3-4bit`, `idefics2-8b-4bit` |
| **Gemma 4** | `gemma-4-e2b-it-mxfp4` (vision + audio) |
| **PaliGemma** | `paligemma2-3b-mix-224-4bit`, `paligemma-3b-mix-224-8bit` |
| **Pixtral** | `pixtral-12b-4bit`, `pixtral-12b-8bit` |
| **Molmo** | `Molmo-7B-D-0924-4bit`, `Molmo-7B-D-0924-8bit` |
Expand Down Expand Up @@ -72,7 +73,7 @@ vllm-mlx auto-detects multimodal models by name patterns:
- Contains "VL", "Vision", "vision"
- Contains "llava", "idefics", "paligemma"
- Contains "pixtral", "molmo", "deepseek-vl"
- Contains "MedGemma", "Gemma-3" (vision variants)
- Contains "MedGemma", "Gemma-3", "Gemma-4" (multimodal variants)

## Using Models

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "vllm-mlx"
version = "0.2.7"
version = "0.2.8"
description = "vLLM-like inference for Apple Silicon - GPU-accelerated Text, Image, Video & Audio on Mac"
readme = "README.md"
license = {text = "Apache-2.0"}
Expand All @@ -30,7 +30,7 @@ classifiers = [
dependencies = [
"mlx>=0.29.0",
"mlx-lm>=0.31.0", # 0.31+ required for ArraysCache native batching (hybrid models)
"mlx-vlm>=0.1.0", # VLM support
"mlx-vlm>=0.4.3", # 0.4.3+ required for Gemma 4 support
"transformers>=5.0.0", # mlx-lm 0.30.5+ requires transformers 5.0 (rc3 bug fixed in stable)
"tokenizers>=0.19.0",
"huggingface-hub>=0.23.0",
Expand All @@ -44,7 +44,7 @@ dependencies = [
# Video processing for VLM
"opencv-python>=4.8.0",
# Vision processor (required for transformers AutoProcessor)
"torchvision>=0.18.0",
"torchvision>=0.21.0",
# Resource monitoring
"psutil>=5.9.0",
# Server
Expand Down Expand Up @@ -75,7 +75,7 @@ vllm = [
]
vision = [
"torch>=2.3.0",
"torchvision>=0.18.0",
"torchvision>=0.21.0",
]
# Audio dependencies for TTS/STT (mlx-audio)
audio = [
Expand Down
Loading