Run this model with HF Jobs

Run MiniMaxAI/MiniMax-M2.5 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/MiniMaxAI/MiniMax-M2.5. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/MiniMaxAI/MiniMax-M2.5 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/MiniMaxAI/MiniMax-M2.5. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/MiniMaxAI/MiniMax-M2.5. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Recommended max_kv_size for MLX deployment to prevent OOM on Apple Silicon

#14
by Neo2025new - opened

Issue

When running MiniMax-M2.5 (4-bit MLX variant) on Apple Silicon via mlx_lm.server in long-running server deployments, the unbounded KV cache can cause out-of-memory kernel panics.

Environment

  • Mac Studio M3 Ultra, 512GB unified memory
  • Model: MiniMax-M2.5-MLX-4bit (~120GB on disk)
  • Runtime: mlx_lm.server v0.30.7
  • Use case: Backend for Claude Code via Claude Code Router, serving coding assistance

What happened

During long coding sessions, M2.5's 80 MoE layers accumulate substantial KV cache per request. With mlx_lm.server's default LRU cache of 10 entries and no size limit, total memory usage grew past 400GB, exhausting the 512GB unified memory pool. This triggered a SoC Watchdog kernel panic (hardware hard reboot), not just a standard OOM kill.

Suggestion

Could the model card include recommended deployment parameters for MLX users? For example:

mlx_lm.server --model MiniMax-M2.5-MLX-4bit --max-kv-size 65536

Note: --max-kv-size is not yet supported in mlx_lm.server v0.30.7 (requires PR #884), but once merged, this would be critical for safe deployment.

Recommended values

Variant Recommended max_kv_size Rationale
4-bit (512GB machine) 65536 ~15GB KV per request, 10 LRU ≈ 150GB headroom
8-bit (512GB machine) 32768 Higher per-layer memory, needs tighter limit

This would help Apple Silicon users avoid catastrophic OOM scenarios. Thank you for open-sourcing this incredible model!

Upvote !

Sign up or log in to comment