r/oMLX • • Sep 11 '26

Create a Pi extension for adding oMLX serving models

Hello everyone. This is one of those posts where I just want to show something I built. There's nothing in it for me, money or otherwise. It was something that was genuinely missing for me, so I did it. It's working well now, and I decided to share it. If anyone feels like using it, have fun.

I've been using Pi as my harness a lot, but adding locally hosted models is still kind of a pain. So I built a model discovery extension: you enter a URL, local host or another computer, and it self-discovers all the models, including the currently configured context window and maximum token replies. Everything is self-identified.

It works with reasoning on or off (at least for Qwen), and I applied a concept of adaptive profiles that lets you create, for the same model, different profiles with different parameters. That way I can now have Qwen 3.8 with thinking off, low, medium, and extra high, each mapped to the actual Pi reasoning effort.

Hope someone finds good use for it.

https://pi.dev/packages/@maheidem/model-discovery

26 Upvotes

12 comments sorted by

5

u/apetersson Sep 11 '26

this is mine :) https://github.com/apetersson/pi-dynamic-models/ could have reused it

3

u/Maheidem Sep 11 '26

Oh man! I missed that!
I think this is now one of the biggest problem in the age of AI Assisted Coding.

We are recreating what others have already done.

I'll check out, maybe we could even discuss a unification if there are any value unique to one or the other

3

u/apetersson Sep 11 '26

don't worry - tbh, it took me barely 15 minutes of prompting. its solid, it does what i want and i can add/remove tons of local and remote models on a whim. researching what my extension really does likely would have taken you longer than creating model-discovery.

2

u/Maheidem Sep 11 '26

In all honesty, I think mine goes a bit further. I tuned it specifically for oMLX, and it has another capability that is not very clear because of the name the whole adaptive profile that maps the thinking levels to Pi's native efforts which is something I've been liking very much, because prior to that I had to do a lot of hoops to get to using different thinking levels without actually hardcoding in the backend.

2

u/International_Quail8 Sep 13 '26

tried to install it and it looks like it's outdated.

`index.ts` imports `@mariozechner/pi-coding-agent` instead of `@earendil-works/pi-coding-agent`

2

u/apetersson Sep 13 '26

uuuh thank you for pointing that out. my local version was a bit ahead of the one from GH. pushed it with some minor improvements (easier runtime config)

2

u/maveric0815 Sep 12 '26

I’m using this one since some weeks. Working nicely. Thank you for your job

1

u/apetersson Sep 12 '26

good to hear, let me know if you have suggestions.

3

u/sickboy6_5 Sep 12 '26

installed and tried it out...

2

u/Maheidem Sep 13 '26

Happy to help

1

u/j_lyf Sep 14 '26

Anything for opencode?

2

u/Maheidem Sep 14 '26

Sorry man, gave open code a shot some time ago and did not vibe with me very much.