Using the libraries
Use the @mlx-bun/ TypeScript libraries to run inference inside your Bun app.
They require Bun 1.4.2 or later on an Apple Silicon Mac with macOS 14 or later;
native libraries ship inside the package archives.
bun add @mlx-bun/inferenceStart from the tested Qwen generation example and its setup instructions. The caller owns the model, inputs, and resource lifetime. Public component subpaths also expose kernels, layers, graphs, state, and generation independently.
Choose a package
Section titled “Choose a package”- MLX bindings: arrays, operations, native resource ownership.
- Inference: graphs, loading, preprocessing, generation, reusable execution, and memory fit estimates.
- Quantization: checkpoint conversion and allocation.
- Training: adapter training and production.
- Hub: model acquisition and discovery.
The array example introduces the MLX bindings. Package READMEs explain how to run the examples; the linked source is tested in CI.
For an application in another runtime, use the local HTTP APIs, including Jev and OpenAI Decisions.
The generated library API lists every public package subpath, resolved exports, signatures, and API comments. Start at a package root for high-level entry points, or choose a component subpath for lower-level composition. Source links lead to the owning implementation. Ownership and disposal obligations belong in those API comments; the reference includes only what the code documents.