828 Commits

Author SHA1 Message Date
Awni Hannun 1bdc8afca3 Bump mlx version and version (#816)
* bump mlx version and version

* add cli for mlx_lm -h
2026-01-28 17:10:49 -08:00
Tarjei Mandt 96699e6dad Add Kimi-K2.5 (#813)
* Add Kimi-K2.5

* Fix pipeline generation

* Sanitize config

* Remove workaround

* Address feedback
2026-01-27 10:23:39 -08:00
Tarjei Mandt b012e1a1e9 Add LongCat Flash tool parser (#810)
* Add LongCat Flash tool parser

* Add unit tests for both xml and json formats
2026-01-26 11:51:44 -08:00
Awni Hannun f53a9b0689 Transformers v5 (#811)
* transformers 5

* Add back tokenization space cleaning
2026-01-26 11:51:30 -08:00
lpalbou beceb5c16d Fix ArraysCache.from_state not initializing left_padding and lengths (#807)
* Fix ArraysCache.from_state not initializing left_padding and lengths

The base class from_state uses __new__ to bypass __init__, but
ArraysCache.state.setter only sets self.cache, not left_padding
or lengths. This causes AttributeError when using loaded caches
with models that use MambaCache (e.g., Qwen3-Next).

The fix overrides from_state in ArraysCache to properly initialize
these attributes before setting state.

* Add test

---------

Co-authored-by: Awni Hannun <awni@apple.com>
v0.30.5
2026-01-25 06:46:35 -08:00
Tarjei Mandt 12073b1db4 Sync random seed across ranks in distributed chat (#801)
* Sync random seed across ranks in distributed chat

* Use seed if provided

* Set default seed
2026-01-23 07:56:20 -08:00
Luqman d9846d37cb fix: use correct variable for logprobs in batch generation (#800) 2026-01-23 07:24:39 -08:00
Awni Hannun 1b76e3d580 Allow qq ops with activation quantization (#749)
* Allow qq ops with activation quantization

* Allow qq ops with activation quantization
2026-01-22 08:59:58 -08:00
Evan Quiney e5ddaff99b add kimi tool parser (#791)
* add kimi parser

* fix + test

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-22 07:46:07 -08:00
Gökdeniz Gülmez 14b9faf1bc Adding TeleChat3 (#773)
* in. com.

* Add Telechat3 MLP and Decoder Layer implementations

* Implement Telechat3 model and decoder layer with attention mechanism

* Add support for 'telechat3-yarn' in initialize_rope function

* Update Acknowledgments and add Telechat3 model tests

* format

* fix test

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-22 07:35:58 -08:00
n8programs 1423702019 Update glm4_moe_lite To Store KV Latent in Cache (#780)
* update glm4_moe_lite

* Fix GLM4 MoE Lite RoPE and MoE layer selection

* Apply PR #780 MLA KV latent cache

* Use full KV for prefill with MLA cache

* Remove unused GLM4 MoE lite config fields

* simplify

* updates

* try and load already quantized models

---------

Co-authored-by: N8 <n8@n8programs.com>
Co-authored-by: ivanfioravanti <ivan.fioravanti@gmail.com>
Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-21 13:55:14 -08:00
Awni Hannun 5ed1e48a3c bump transformers (#746)
* bump transformers

* bump
2026-01-21 13:45:15 -08:00
Gökdeniz Gülmez 4100703f1a move Xielu Activation in Apertus to activations.py (#772)
* feat: implement XieLU activation function and integrate into Apertus model

* format
2026-01-20 06:51:16 -08:00
Ryan Goulden 8c08a46da4 server: use OpenAI compatible finish_reason (#782) 2026-01-20 06:50:37 -08:00
Maanas Verma bc891dca4c import logging as it throws no logging error in place of actual error (#778)
* import logging as it throws no logging error in place of actual error

* Update mlx_lm/utils.py

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2026-01-20 06:23:24 -08:00
Ivan Fioravanti 02228601cd Add glm4 moe lite model (#776)
* Add glm4 moe lite model

* Format glm4_moe_lite with black

* version

---------

Co-authored-by: Awni Hannun <awni@apple.com>
v0.30.4
2026-01-19 08:13:13 -08:00
Tarjei Mandt 8daabcc7c1 Shard LongCat Flash (#771) 2026-01-18 07:21:36 -08:00
Evan Quiney cd7d9a536e Add minimax tensor sharding (#760)
* add minimax sharding

* fix

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-17 08:45:42 -08:00
Tarjei Mandt 25246632cf Fix Longcat Flash extended context support (#768) 2026-01-17 07:42:22 -08:00
Evan Quiney 6651d2e0bf Add gpt-oss sharding (#761)
* add gpt-oss sharding

* fixes

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-17 07:42:11 -08:00
AndrewTan517 43dcf2f0c0 fix: unused batch_size parameter for mlx_lm.evaluate (#762) 2026-01-17 07:29:32 -08:00
Tarjei Mandt 769069d66b Fix CacheList batching (#769)
* Fix CacheList batching

* Simplify fix

* empty as method + change len to size

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2026-01-17 07:29:21 -08:00
Tarjei Mandt 5261ab85ee Fix swiglu parameter order (#767) 2026-01-17 06:13:23 -08:00
gaurav c27c94a0ff fix(falcon_h1): support tied embeddings and correct muP scaling (#764)
* fix: handle tied embeddings and muP scaling mismatch

Support models with "tie_word_embeddings": true by conditionally initializing the lm_head and reusing embed_tokens weights.

Since falcon_h1 applies disparate muP multipliers to embeddings and the language head during sanitization, a scaling correction factor (lm_head_mult / embedding_mult) is applied in the forward pass when weights are tied. This ensures mathematical correctness without duplicating weights in memory. 

Fixes ValueError: Missing 1 parameters: lm_head.weight

* simplify sanitize logic

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2026-01-16 07:11:18 -08:00
Thomas Lazarus fd80ac89fb Adds support for Nemotron Super 49b v1.5 (#756)
* Adds make_cache to nemotron-nas

* Fixes from PR to not use _BaseCache

* Updates __call__
2026-01-16 07:03:05 -08:00
Awni Hannun edbf61dd8b Use compiled Swiglu (#753)
* swiglu

* swiglu

* rest of files, thx codexx

* nit

* Format
2026-01-14 11:58:41 -08:00
Awni Hannun c2a716c871 Update for latest mlx (#759) 2026-01-14 11:57:44 -08:00
Ivan Fioravanti 63c9873617 Handle empty caches during batch merge (#755)
* Handle empty caches during batch merge

* add test

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-14 08:47:47 -08:00
Julian Tibble 7585c142a6 fix: Fix type hint and pydoc for batch_generate (#745)
The 'prompts' argument to batch_generate has type List[List[int]].

However, previously the type hint was wrong, and the pydoc had the
correct type but the wrong argument name.
2026-01-12 07:36:48 -08:00
Tarjei Mandt 44d12e5d6f Fix batch generation for IQuestLoopCoder model (#748)
* Fix batch generation

* fix

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-09 16:50:51 -08:00
Awni Hannun 7a86c1289e Make cache list batchable (#743)
* Make cache list batchable

* comment
2026-01-09 10:47:05 -08:00
Gia Huy Vuong a20eefd7c2 Refactor tokenizer error handling to use warnings instead of exceptio… (#744)
* Refactor tokenizer error handling to use warnings instead of exceptions for missing tool call tokens

* disable tool calling if not in vocab

* add tool call warning

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-09 07:19:33 -08:00
Tarjei Mandt 3eb6ecf2b6 Fix tools parameter in apply_chat_template call (#747) 2026-01-09 07:08:01 -08:00
Awni Hannun 39a96ab18b Add a server benchmark for continuous batching (#728) 2026-01-08 14:35:40 -08:00
Nikhil Mitra 43082feafa Make MambaCache compatible with batch generation for nemotron-h (#690)
* Make MambaCache compatible with batch generation

* fix: Support right-padding masking in ArraysCache, add tests

* almost working

* test pass

* update models + gated delta

* rebase + fix

* fix

* allow batching in server

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-08 13:42:36 -08:00
Gökdeniz Gülmez 5cce1495e0 Add extract method to ArraysCache for item retrieval (#740) 2026-01-08 06:30:20 -08:00
Awni Hannun 509f5aef89 Fix sliding window batching (#738) 2026-01-07 10:07:56 -08:00
Tarjei Mandt 0f76343ea4 Add IQuest Coder V1 Loop variant (#716)
* Add IQuest Coder V1 Loop variant

* Minor tweaks

* Fix cache population

* Clean up nested for loop

* Simplify

* Bug fix in prefill

* Address feedback

* nits

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-07 07:39:24 -08:00
Eric Curtin 298b67c755 Add AWQ/GPTQ weight transformation utilities (#730)
* Add AWQ/GPTQ weight transformation utilities

Add functions to transform AutoAWQ and GPTQ packed weights to MLX
quantization format. This includes an unpacking function for AWQ/GPTQ
weights and a transformation function that converts the quantization
format from AutoAWQ/GPTQ to MLX. The transformation handles both
symmetric and asymmetric quantization by computing biases from zero
points. Also add a test case to verify the transformation works
correctly.

Signed-off-by: Eric Curtin <eric.curtin@docker.com>

* nits

* nits

---------

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-06 08:50:58 -08:00
Awni Hannun 94497d5255 fix release (#733) v0.30.2 2026-01-05 18:31:29 -08:00
Awni Hannun 4c80c68ea6 patch (#731) v0.30.1 2026-01-05 16:54:13 -08:00
Awni Hannun ac8ae2c05a Improve reasoning and tool call parsing in server (#711)
* Parse reasoning in server

* redesign and start to fix tool parsing

* add function gemma

* fix

* fix

* glm47 tools

* add minimax m2 tool parser

* tool_call finish reason

* Keep model wired in the server to reduce ttft

* infer tool parser
2026-01-05 14:18:52 -08:00
Tarjei Mandt 7a4d137df6 Add K-EXAONE MoE (#719)
* Add K-EXAONE MoE

* Shard model

* Cleanup

* Fix model test
2026-01-05 08:50:33 -08:00
Tarjei Mandt 90db1e6266 Add Solar Open (#721) 2026-01-05 08:38:53 -08:00
Thomas Lazarus d3dc2e3f33 Add logits_processors support to batch_generate (#635)
* Update generate.py

* add samplers and logits processors with per example option and server support

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-04 15:19:00 -08:00
John Mai 7423bf6752 Add YoutuLLM (#720)
* Add YoutuLLM

* nits + test

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2026-01-03 09:12:55 -08:00
Tarjei Mandt 5dec49a12f Add IQuest Coder V1 (#714)
* Add IQuest Coder V1

* Shard model

* Use remapping
2026-01-01 06:17:14 -08:00
cxl-git-hub 3727e01cd7 Fix empty /v1/models response for locally loaded models (#713)
* server: expose local --model in /v1/models.
use full local path as model id for /v1/models

在加载本地模型时,/v1/models返回空列表,导致 open webui获取不到模型,没办法使用。所以这里把本地模型的全路径作为 model_id返回。

* nits

* fix test

---------

Co-authored-by: chenxilong <cxl750529174@163.com>
Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-12-31 14:22:00 -08:00
Molly Sophia 09579644ac Add RWKV7 (#580)
* initial support for rwkv7

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* slight modification

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* fix batch inference

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* add metal wkv kernel and fix groupnorm calculation

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* quant_predicate

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* style and format changes

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* use pre-commit to format the code

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>

* nits

* add a test

---------

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
Co-authored-by: Awni Hannun <awni@apple.com>
2025-12-31 14:21:42 -08:00
jaycoolslm 0081085a91 chore: add model-path param flag for convert API for better clarity (#702)
* chore: add model-path param flag for convert API for better clarity

Signed-off-by: Jake Hall <jaycoolslm@gmail.com>

* chore: refactor argparse for multiple string options

Signed-off-by: Jake Hall <jaycoolslm@gmail.com>

* Update mlx_lm/convert.py

* Update README.md

---------

Signed-off-by: Jake Hall <jaycoolslm@gmail.com>
Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-12-31 12:30:38 -08:00