I built mlx-onnx (as part of mlx-ruby), a standalone exporter that converts MLX graphs to ONNX.
Web Demo: https://skryl.github.io/mlx-ruby/demo
Repo: https://github.com/skryl/mlx-onnx
It provides:
- MLX callable -> ONNX export
- Python API + native C++ API
The goal is to make it easier to move MLX models into ONNX tooling (onnxruntime, validation, downstream deployment), while keeping
export behavior testable and explicit.
Quick example:
import mlx.core as mx
import mlx_onnx as mxonnx
def f(x):
return mx.exp(x + 1.0)
x = mx.array([[1.0, 2.0]], dtype=mx.float32)
mxonnx.export_onnx("model.onnx", f, x, model_name="demo", opset=18)
skryl•1h ago