Hacker News new | ask | show | jobs
Mlx-ONNX: Run your MLX models in the browser using WebGPU (github.com)
3 points by skryl 115 days ago
1 comments

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)

If you try it and hit an issue, I’d love a repro.