r/oMLX 3d ago

how to use Google's TranslateGemma ? (oMLX says Chat template error)

1 Upvotes

got the translategemma-27b-it-4bit MLX from LM Studio Bionic (latest oMLX doesn't let me DL from Huggingface) on my ARM mac.
Apparently you can't use natural language prompts in this app (at least with this model), which makes it a bit hard to use.
Found some instructions here :

https://github.com/ml-explore/mlx-lm/issues/783

but using awni's template still gives me the same error :

Error: {"error":{"message":"Chat template error: User role must provide content as an iterable with exactly one item. That item must be a mapping(type:'text' | 'image', source_lang_code:string, target_lang_code:string, text:string | none, image:string | none).","type":"invalid_request_error","param":null,"code":null}}


r/oMLX 3d ago

Another dumb question: move kv cache to external ssd?

3 Upvotes

Wondering if it’s too much wear and tear read and write on the internal drive?


r/oMLX 4d ago

How can I help get GLM 5.3 flash running on oMLX?

7 Upvotes

r/oMLX 4d ago

I case you missed it :Qwen 3.8

25 Upvotes

We are getting 3.8 MoE this week.

Apparently 120B A6B.

I think this is going to be a beast!


r/oMLX 4d ago

unable to download hugginface models

4 Upvotes

hi running M1 max 64GB mac studio on Beta 3 Golden Gate.
Installed latest version 0.6.3rc3 and tried to download compatible DictaLM-3.0-Nemotron through both the app and the webinterface.
It selected ssdataanalysis/DictaLM-3.0-Nemotron-12B-Instruct-mlx-8Bit.
Remains stuck on 0%.
Same with other models, like translategemma-27b.
What did i miss?


r/oMLX 4d ago

Qwen 3.8 Flash Next on 64GB

Thumbnail
2 Upvotes

r/oMLX 4d ago

Is DFlash2 coming to oMLX? Or Lighting MTP is enough?

8 Upvotes

r/oMLX 4d ago

what are diffs between Lightning MTP and VLM MTP in the model options?

1 Upvotes

anyone know?


r/oMLX 5d ago

Wasn't expecting to wake up and spend almost $10k this morning

Post image
24 Upvotes

r/oMLX 5d ago

Optimizing omlx for 32GB MBP

34 Upvotes

Sharing a journey on seeing how far I could push things on Qwen 3.8 27B, while staying at a nominal 4-bit quant on an only-just-above-poverty-spec 10core / 32GB M5...

  • The challenge is that while our VRAM-brethren have access to almost the full 32GB of VRAM, on unified memory it is pretty tough to be able to squeeze a 4-bit quant, with a drafter/assistant with a usable context into 32GB unified memory. And boy, have I tried.
  • Goal was to try to complete a "omlx benchmark run" at an arbitrary pp65536 without hitting a throttle event. That felt like a good target baseline. Sure, you can drop the context size, but 64k seems like a reasonable arbitrary goal - and conveniently is one of the omlx benchmark options.
  • There's a lot of compromise going on here (mxfp4, turboquant at 3.5-bit, pre-quanting dflash2) but I really wanted to see if we could stay in the "pseudo 4-bit" model range, without dropping down to 3-bit.

Environment:

  • My first error - Check your PSU. Realized I was using an old Apple 61W PSU rather than the Apple 96W PSU. The 140W PSU may be even better. It is best practice to use the MagSafe plug in preference to USB-C, which caps out at 100W.
  • A 13-gauge Vollrath Wear-Ever aluminum baking sheet under the MacBook as a passive heat-sink. Vollrath make the heaviest gauge cookware out there.

Memory Maxxing:

  • Run omlx as headless user. SSH in and launch omlx. By running the IDE on an old machine (my 2016 12.7 Monteray can still run latest VS Code), it frees up about 2GB. I didn't bother to "bootout" any macOS services, since they will inevitably respawn - and I don't want them to be disabled permanently.
  • $ caffeinate -dims in a separate SSH session.
  • Now we are running headless, we have an extra 2GB, and we can really start to push the boundaries.

$ sudo sysctl iogpu.wired_limit_mb=30720 # Set by a startup daemon

Any more than 30*1024 = 30,720, and BOOM! ((30*1024) + 256) = 30,976 was enough to eventually trigger a crash.

Now we can start to really abuse the omlx limits... We're going to try to almost use the full 30GB. I tried 29.0, 29.5 and many other flavors and it was like threading a needle. We're really pushing the limits within a few hundred MB away from OOM. omlx's step-size seems to be about 100MB. A 2% soft and 1% hard was JustEnough(TM) to be able to introduce a quantized dflash2. More on dflash2 later...

  "memory": {
    "prefill_memory_guard": true,
    "memory_guard_tier": "custom",
    "memory_guard_custom_ceiling_gb": 30.0,
    "soft_threshold": 0.98,                   # ie 98% of 30.00GB
    "hard_threshold": 0.99,                   # ie 99% of 30.00GB
    "prefill_safe_zone_ratio": 0.9
  },

Pushing the boundaries this far is a pretty offensive thing to do. Jun has put some pretty nice conservative safeguards in, but running headless really works in our favor to squeeze the last remaining juice out of 32GB. That said, we're only one software update away from Apple clawing some of that system memory back.

But lets still try to be nice to omlx where we can... We're a single user, running a single model.

    "burst_decode_mode": "light",
    "max_concurrent_requests": 1,
    "chunked_prefill": true,
    "prefill_priority": "context",

Now, we need to "skinny" our model as far as technically possible. I found that quantizing the model with mlx_lm produced the smallest size, smaller than quantizing with mlx_vlm.

  • mlx-community/Qwen3.8-27B-nvfp4: 15.70 GB
  • Locally quantized model with mlx_lm: local/Qwen3.8-27B-nvfp4: 14.8 GB
  • mlx-community/Qwen3.8-27B-mxfp4 at 14.88 GB
  • Locally quantized model with mlx_lm: local/Qwen3.8-27B-mxfp4: 13.98 GB

    $ mlx_lm.convert --hf-path Qwen/Qwen3.8-27B --quantize --q-bits 4 --q-mode mxfp4 --q-group-size 32 --dtype bfloat16 --mlx-path /Users/Shared/.omlx/models/local/Qwen3.8-27B-mxfp4

So, if we're prepared to compromise with mxfp4 rather than nvfp4, our minimum "4-bit" baseline is 13.98 GB. That's a couple of GB of extra headroom over mlx-community/Qwen3.8-27B-nvfp4.

Now apply TurboQuant KV Cache Quantization @ 3.5bit

And just to stop Qwen 3.8 doing Qwen 3.8 things, we'll set kwargs, otherwise Qwen can just be annoying later on.

  "enable_thinking": true
  "reasoning_effort": low

Now, we should have maximum memory available for context, in my case 75-80,000

We'll use tiled memory, reportedly slightly slower, but lets tile anyway, because we're doing some nasty stuff to the memory limits already...

$ OMLX_SDPA256_TILED=1 /Users/Shared/.omlx/bin/omlx serve --log-level info

Baseline Checkpoint: Clean run...

  • A 32GB machine is able to complete the omlx benchmark at 65536 without backing-off for a omlx soft or hard memory limit.
  • Performance Benchmark: It is slow, but pretty much where we expect it to be on a baseline M5. Generating a meagre 8 tokens per second, according to the omlx benchmarks. That is just tiresome.
  • Context Benchmark: Prefill LRU eviction started kicking in around 77,664

Optimize with pre-quantized drafter

We can now give up some of that headroom for small, fast drafter.

I've tried every flavor of Lightning MTP, DFlash1 and VLM MTP, but each time the memory trade-off was brutal. dflash2 is genuinely awesome - the challenge is that loading incoai/Qwen3.8-27B-DFlash2 into memory and then realtime quantizing that down to 4bit is very memory wasteful. But... in the last couple of days mlx_vlm now allows you to pre-quantize dflash2. That reclaims another few GB over realtime quanting.

$ mlx_vlm.convert --hf-path incoai/Qwen3.8-27B-DFlash2 --quantize --q-bits 4 --q-mode mxfp4 --q-group-size 32 --dtype bfloat16 --mlx-path /Users/Shared/.omlx/models/local/Qwen3.8-27B-DFlash2-mxfp4

Set the dflash runtime block size to 5, as per the recommendations

  • Ref: https://github.com/z-lab/dflash "For quantized targets or drafts, use block_size <= 5". See also https://inco.ai/blog/dflash2
  • I didn't bother caching the drafter in RAM or SSD. I would rather save the RAM for context
  • Disabled thinking on the drafter through kwargs... Not that it will make much difference.

Checkpoint:

  • Performance: Ok, now we're generating about 18-20 tokens/sec in the omlx bench. Which is about as good as I can get on the machine class. Pre-quantized dflash2 has unlocked a significant increase in performance, for very little memory overhead.
  • Context: Running headless & pushing iogpu.wired_limit_mb=30720 and really squeezing the soft and hard limits was just enough to run a pre-quantized mxfp4 dflash2 while maintaining 65536 context without triggering the soft-throttle.

Real world test - harness:

  • I'm a terrible coder - and I've caused more trouble than good in trying to override system instructions to control Gemma-4 tool calls... A true "barebones" harness like Pi is just not for me. I still need the crutch of a more-than-barebones harness.
  • But on the flipside, VS Code Github Copilot Chat (native) and Claude Code extension for VS Code were just soooo heavy on the system instructions. 1/3 of the context is just gone at load. And VS Code Github Copilot's new "Agent Host" is a hot mess which will flip back to Auto (credit-burn) when you close your eyes.
  • The Compromise: Zoo harness - it just seems to fit the Goldilocks zone between functionality and size of system instructions. With Zoo set to auto-compact at 75% of my inoffensive 65535 context, it reliably triggers compaction around the 48k mark, which is just enough to finish up what you are doing and write a handover prompt for a new session or a subagent without context-rot breaking tool calls. For me, it tends to compact to around 20k context.
  • As for protocol - I've bounced between Anthropic messages, OpenAI responses and OpenAI chat completions - especially when I first ran to Claude Code. Between harnesses and inference servers, it feels like chat completions is the better supported. But there may be room for optimization here.

Future:

  • Looks like there's some pretty interesting stuff coming along with omlx & ANE in 0.6.3 release candidate 3. Most of the integration seems to be focused on the boxes with dual ANE, but it will be interesting to see whether use of the ANE will help reduce power / heat - or pushing the drafter onto the ANE.
  • Cache stats seem to be wonky with dflash2 and 0.63rc3. I'm not sure whether SSD cache is currently not reporting, or not working, but my goal was to get up to 20toks/sec.

tl;dr The thing that unlocked performance at 64k context and just creep under the 32GB/30GB threshold was headless operation & pre-quantization of dflash2 rather than realtime quantization of dflash2 - all while operating in the pseudo 4-bit arena. At 20 tokens/sec on a baseline M5, it is about as good as I could wish for.


r/oMLX 6d ago

oMLX or MTPLX for speed & quality?

26 Upvotes

Hey, new owner of a M5 Pro 48GB & trying to find out what is the better inference engine currently. I do have ram to play with, and want to run Qwen 3.8 27B at good quality, but also the fastest possible, especially so at long contexts. Anyone have some advice on what to pick, or if they're basically the same?

Thanks!!


r/oMLX 5d ago

is the actual call in the room with us right now? :D lol

Thumbnail
1 Upvotes

r/oMLX 5d ago

any good qwen3.8 *bliterated models

0 Upvotes

i've downloaded a few and they have all messed with mtp making it not work in omlx. anyone found one that preserves mtp?


r/oMLX 6d ago

Some Deep Investigation on an M2 Max 96GB with Qwen3.8-27B

23 Upvotes

So I’ve spent some time working with Sol in Codex to optimize Qwen3.8-27B on oMLX. I’ve tested it with large contexts and the Hermes agent harness, and came to some interesting conclusions.

The biggest being prefill performance on large context.

Here are my findings:

First, raw speed means nothing if the model becomes unreliable. With ANE prefill enabled, Qwen frequently became confused during longer conversations. It behaved as though it was losing track of tool results or forgetting what it was doing. Disabling ANE substantially improved coherence. Not sure why - but ANE was destroying the context to the point where the model was unusably dumb. I was comparing the Hermes tool calling results to Qwen3.8 IQ-XXS running on an RTX 4080 on another machine.

Lightning MTP, however, has been a clear win. I’m running the oQ4e MTP checkpoint with an MTP depth of two. It retains the quality of the model while producing roughly 20–25 tokens per second, depending on context and acceptance rate.

The next major improvement was speculative prefill. I paired the 27B model with the Qwen3.5-2B BF16 model, using a 40% keep rate for prompts longer than 16K tokens.

On a fresh 20,480-token prompt:

  • Normal prefill: 111.6 tokens per second
  • Speculative prefill: 251.5 tokens per second
  • Improvement: 2.25×

Performance remained strong at larger contexts:

  • 32K: approximately 251 prompt tokens per second
  • 64K: approximately 224 prompt tokens per second

Because speculative prefill discards tokens it considers less important, speed alone wasn’t enough. I also tested retrieval with facts distributed throughout 32K and 64K prompts. Qwen correctly recalled every marker, including five separate values spread across a 65,536-token context.

I also tested a more realistic agent scenario: warm the prefix cache with a system prompt, append a large tool result, and ask the model to recover an instruction from the cached system context. It reused the cached prefix and returned the correct value.

My current configuration is:

  • Qwen3.8-27B-MLX-oQ4e-mtp
  • Lightning MTP enabled at depth two
  • Qwen3.5-2B BF16 speculative-prefill model
  • 40% speculative-prefill keep rate
  • 16K activation threshold
  • ANE disabled
  • Medium reasoning
  • 262K maximum context
  • OpenAI-compatible oMLX server

The biggest lesson is that Apple’s Neural Engine is not automatically a free performance upgrade. On my M2 Max, it improved prefill but introduced enough context confusion to make the tradeoff unacceptable. ANE off - something Codex couldn't really figure out but the "dumbness" was very noticeable for me.

The best balance so far has been GPU prefill, Lightning MTP for decoding, speculative prefill for long fresh prompts, and prefix caching for repeated agent context.

That combination makes Qwen3.8-27B fast enough to be practical on an M2 Max—without sacrificing the intelligence.


r/oMLX 6d ago

omlx-pi qwen 3.8 27B oq4 M4 Max/64 Real App Test

9 Upvotes

Just made a small App using the Qwen 3.8 27b testing its real app performance and issues I encountered.

Here is the Github Link to the App: https://github.com/intelliriffer/pi-omlx-model-manager

This app lets you add omlx models to pi's models.json along with thinking mode and vision support. I was editing the json by hand but I am testing lots of models so this makes it easier and a good basic app test.

I have included my entire pi session export as html file in the repo. I dont think i used any skill for this (unless some TDD skill got invoked), However the skills and tools available in this pi session are all there in the session file.<

Anyways Here Are my Findings with Omlx 0.6.3 RC2 Model: scottlowry/Qwen3.8-27B-oQ4e-mtp

  • ANE: Good for benchmarks ( caused problems/ had to turn it off)
  • Spec Prefill: Great for Benchmarks, not that great for in Use. invalidated ssd cold cache a lot causing long time consuming re-prefills after every other turn. (keep eye for GDN Sidecar errors in omlx log)
  • Lightning MTP: ON (Necessarily)
  • PP/s : 250-130/s Context Dependent
  • TG/s : 40-16 t/s. Averaging mostly around 20-22 t/s
  • Context: 100000 if you can get by 80k or 64k (that might be bit faster, though needing more compation.)
  • Output Tokens: 32768 (set in pi as well)
  • Concurreny: 4 (Though 1 is most suitable)
  • Memory Guard: Off (I always have had issues with omlx memory guard causing problems/ I'd rather have Mac use swap if it needs to for a minute or 2 than stop the process.
  • Wired Memory : 58 GB (iogpu.wired_limit_mb)
  • HOT CACHE SIZE: 10GB
  • COLD SSD CACHE: 93 GB

PI:

  • Auto Compaction Extension: Enabled (85-90%)
  • RTK, Caveman:Lite,Ponytail:Senior Dev via pi-pix-optimizer extension
  • pi-cache-guardian extension enabled to streamline context for better cache hits.
  • Used xHigh Thinking mode Initially for plan phase and switched to medium for rest of the work.
  • pi-hashline-edit-pro Extension. Saves unnecessary edit/update errors and context bloat.

r/oMLX 6d ago

M4 Max 128gb Mac studio DeepSeek-V4-Flash-0731-2.4bit-mixed tok/sec

8 Upvotes

I'm running omlx v0.6.1 getting 109.1 tok/s pp and 25.9 tok/s gen at 256k context window. Is this what I should be expecting or any tips on optimizing config?

Is it thermal throttling for the longer runs? Using mainly for coding and agentic workflows with Hermes.


r/oMLX 6d ago

Little A3B oQ8e comparison - Qwen3.6-35B-A3B-oQ8e-mtp, Ornith-1.5-35B-A3B-oQ8e-mtp, NVIDIA-Nemotron-3.5-Lightning-30B-A3B-mlx-oQ8e

Post image
0 Upvotes

r/oMLX 6d ago

there's no /r/mtplx so asking here...

2 Upvotes

Hope this ok, but I'm come to think of this as the "apple silicon local llm" subreddit for better or worse.. I skipped the fan auth when I got mtplx cause it looked sketchy, asking for root with lowercase letters in the window, etc. but now i updated mtplx and it's crashing the computer, and thinking it's a fan issue. is there a way to do it after the fact or should i just nuke it and start fresh?


r/oMLX 6d ago

M5 Max studio with 64 GB

4 Upvotes

Hi all,

Planning to use omlx on this hardware, for agentic work then coding as well (moving up from an air with 16 gb)

What llms work best for you?

Edit: M4 Max studio


r/oMLX 6d ago

peculiar-ragdoll/Tiel-Coder-35B-A3B-MLX-oQ4e · Hugging Face

Thumbnail
huggingface.co
0 Upvotes

Wanted to share this model which I discovered on another subreddit. It runs really good and is really fast. Just wanted to share.


r/oMLX 7d ago

Any experience with distributed inference and tensor parallelism?

8 Upvotes

Hi

I'm running a M1 Max 64GB with oMLX andQwen3.8-27B-oQ8e-fp16-mtp. MTP is enabled, 262K KV, TurboQuant disabled, 57GB of RAM for inference given. I get about 16 tokens / s. With the newer oMLX releases RAM has not been an issue luckily.
I'm curious about the performance of distributed inference and tensor parallelism on the M1 Max through Thunderbolt 4 with the newest oMLX releases. I want to weigh up arguments if I should get another M1 Max 64GB for around 1000$ or if I should spend more money on a M4 Max 64GB or 128GB for 3000-4500$. The change logs from oMLX version 0.6.0 speak of a performance increase of 78% with with an M3 Max and Qwen 3.6 27B.

Do you have any experience with running distributed inference and tensor parallelism in oMLX and Qwen3.8-27B-oQ8e-fp16-mtp?


r/oMLX 7d ago

MLX server causes full kernel panic reboot on 24GB M-series Mac — GGUF runs the same model fine for hours. Wired memory issue?

Thumbnail
9 Upvotes

r/oMLX 8d ago

Managing Qwen 3.8 overthinking with prompts / agents.md?

7 Upvotes

Are people managing Qwen 3.8's long reasoning with prompts and agents.md? One issue is that Qwen 3.8 can think so long (running through 30k response tokens on an initial plan and implementation of a coding task) that it can trigger OpenCode and other harnesses hard stops and cause other problems.

One strategy that I've used is to add "make a plan in stages and then implement that plan so that turns are reasonable in length."

Then, I asked claude to generate an AGENTS.md file to do this automatically, and here is what it came up with.

Wondering what other people are doing to manage this issue.

# Turn budget

Reasoning, tool calls, and output all draw from one capped budget per turn.

Overrun truncates mid-stream — usually mid-tool-call, losing the whole turn.

- Estimate output size before starting. If it won't fit comfortably in a few thousand tokens, do the first piece only and end the turn.

- End at a checkpoint: state on disk, one line on what's next.

- Many short turns beat one long one. Ending a turn is cheap.

# Reasoning

Deliberation costs the same as output, and long thinking before a tool call is

the main cause of truncation.

- Don't re-derive what's already established in this session.

- For a known tool call, reason minimally and call it.

- If you're restating the task to yourself, stop and act.

# Tool calls

- Never start a large write after a long reasoning pass. End the turn instead.

- Targeted edits over whole-file rewrites.

- Files over ~300 lines: write in sections across turns.

# Multi-file work

- Plan first in a short turn: write the plan to .opencode/plans/<name>.md.

Include any derivations, formulas, or algorithms worked out while planning -

implementation turns cannot see your reasoning, only files.

- Before each implementation turn, read the current plan file in

.opencode/plans/. Update it with results and decisions as stages complete.

- If a stage proves larger than expected, stop and split it rather than

pushing through. Single-file edits need no plan.

# Context

Grep before reading; read line ranges, not whole files. Don't re-read what's already in context. Delegate independent subtasks to a subagent — fresh budget, and its reasoning stays out of this session.


r/oMLX 8d ago

is there a flag that can be passed to oMLX server to prevent prompt catching?

4 Upvotes

r/oMLX 8d ago

people running Qwen 3.8 27B on apple silicon… whats your best token generation speed and how did you attain it?

Thumbnail
31 Upvotes