Settings

Theme

Mlx-ONNX: Run your MLX models in the browser using WebGPU

github.com

3 points by skryl 7 days ago · 1 comment

Reader

skrylOP 7 days ago

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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection