Show HN: MLX-Ruby – Ruby Bindings for Apple's MLX ML Framework (github.com)
GitHub: https://github.com/skryl/mlx-ruby
MLX-Ruby is a native C++ extension that wraps the upstream MLX runtime, giving Ruby full access to the array framework, neural network layers, optimizers, and Metal GPU acceleration on Apple silicon.
What’s included: ∙Lazy arrays with dynamic graph construction ∙Function transforms: grad, value_and_grad, vmap, jvp, vjp, compile ∙Full NN module system: Conv2d, Linear, Embedding, Transformer layers, RNNs, etc. ∙Optimizers: Adam, AdamW, SGD, and more ∙A Ruby DSL for declarative model definition, training loops, and checkpointing ∙CPU and Metal GPU support
Working examples (https://github.com/skryl/mlx-ruby-examples): ∙LLaMA inference ∙Stable Diffusion ∙Whisper ∙Transformer language model ∙LoRA fine-tuning
1 comment
[ 3.0 ms ] story [ 10.9 ms ] threadRuby deserves better ML tooling. The language is expressive enough that model definitions can actually be more readable than their Python equivalents. gem install mlx to try it out.