ml-explore / ml-explore/mlx-lm

[Enhancement] Native Node.js bindings for mlx-lm — eliminate Python subprocess dependency

Open
#1,237 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.1k
Forks
1.1k
Avg merge
3d 6h
Merged PRs (30d)
54

Description

The problem
mlx-lm is currently callable from non-Python environments only via subprocess — spawnSync into mlx_lm generate, lora, convert, fuse. This works but carries real costs: process spawn overhead on every call, a Python environment that must be version-pinned and validated, and an architectural seam that is foreign to otherwise Python-free systems.
The working case
I run a production CoffeeScript/Node.js ML pipeline on Apple Silicon that does fine-tuning, LoRA adapter training, quantization, and Keyword Augmented Generation. Every part of the system is Python-free except the four mlx_lm subprocess calls. The Python environment exists solely to service those four entry points.
A technical assessment of the pipeline: https://jahbini.org/writestory.html
The request
Native Node.js N-API bindings for the four core mlx-lm operations:

generate — inference with optional adapter
lora — fine-tuning
convert — model conversion
fuse — adapter fusion

The MLX C API is already stable. Community Ruby bindings (mlx-ruby) confirm the binding pattern works. Node.js is a natural next target given V8's performance and the size of the JavaScript developer community on Apple Silicon.
Offer
I am prepared to contribute to this effort. Guidance from the core team on the preferred binding approach would be welcome.
— James A. Hinds · https://jahbini.org/ and https://jahbini.org/writestory.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the MLX C API and the community mlx-ruby binding pattern, then determine how Node.js N-API should expose the four requested operations. There are no files or tests named in the issue; done means native bindings cover generate, lora, convert, and fuse without Python subprocess calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, node.js, python
Domain
machine-learning, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.