npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mlx-bun

v0.5.0

Published

Native MLX inference for Bun on Apple Silicon — local LLM server (OpenAI/Anthropic-compatible) and TypeScript library. No Python.

Readme

mlx-bun

MLX inference as a TypeScript/Bun library, with a signed executable serving OpenAI/Anthropic-compatible APIs on Apple Silicon. Embed generation in a Bun application or run the local server and browser chat app. The numerical tests compare logits bit-for-bit with mlx-lm for validated configurations.

Docs: mlx-bun.dev

Scope

The engine requires an Apple Silicon Mac running macOS 14 or later. The standalone executable includes its runtime; npm and source usage require Bun. Node.js, Linux, and Windows cannot run the native engine.

The server uses continuous batching by default. Eligible requests share the execution engine, including when only one request is active. Supported combinations and the explicit serial option are documented in server configuration.

Use the supported model roster to choose an artifact. Model architecture, weight format, and cache scheme determine compatibility. Arbitrary Hugging Face repositories and GGUF files are not automatically supported.

Install

Four ways in; all need an Apple Silicon Mac running macOS.

# Direct download — signed, notarized, no toolchain
curl -fsSL https://mlx-bun.dev/install.sh | sh

# Homebrew
brew install joshuarossi/tap/mlx-bun

# bunx — no install, needs Bun >= 1.4.0
bunx mlx-bun

# From source
git clone https://github.com/joshuarossi/mlx-bun.git && cd mlx-bun
bun install && bun run link-cli

Homebrew and direct download install the same self-contained bundle. npm ships a launcher and TypeScript source, then fetches the native runtime pack on first use. See distribution for details.

Quickstart

Start the server and open the chat UI. With no model selected, the first run downloads a starter model:

mlx-bun serve --port 8080

Use mlx-bun ls to see downloaded models. For example, after downloading a matching model, mlx-bun serve e4b selects it by name. Model selection and downloads are documented in the CLI reference.

Send a request from the terminal:

curl http://localhost:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 128}'
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "http://localhost:8080/v1", apiKey: "local" });
const res = await client.chat.completions.create({
  model: "local",
  messages: [{ role: "user", content: "Hello!" }],
});

Longer walkthroughs on the site: Installation and Quickstart.

Find your way around

Each reference topic has one home:

| Topic | Doc | |---|---| | Benchmark numbers (parity / performance / quality) | docs/reference/benchmarks.md | | Supported models roster | docs/reference/models.md | | Server start flags, MLX_BUN_* env, defaults | docs/reference/server-config.md | | HTTP API routes and request/response schemas | docs/reference/server-api.md | | CLI verbs | docs/reference/cli.md | | TypeScript library API | docs/reference/library-api.md | | LoRA fine-tuning (SFT / DPO / ORPO) | docs/reference/training.md | | Build, sign, notarize, publish | docs/reference/distribution.md | | Troubleshooting | docs/reference/troubleshooting.md | | Personal memory (local wiki) | docs/reference/memory.md | | Reference environment / oracle setup | docs/reference/environment.md | | Active engineering design docs | docs/design/ | | Contributing / repo rules | CONTRIBUTING.md |

The numerical contract distinguishes stock mlx-lm parity, mlx-optiq parity for supported extensions, and experimental methods. Tests compare logits against pinned oracles under matching conditions; batching and sampling can change generated trajectories. See the evidence and limits in benchmarks.md. Server policy defaults are documented separately in server configuration.

Why

mlx-bun brings MLX inference into a TypeScript application without a Python service. Bun's FFI calls mlx-c directly. Model implementations, scheduling, sampling, and reusable cache state live in the same process.

Performance depends on both native kernels and how the engine uses them. The project develops specialized kernels, avoids repeated computation, and measures complete requests as well as decode throughput. The benchmark ledger records the machines, settings, comparisons, and remaining regressions.

License

MIT. Third-party attributions: THIRD_PARTY_LICENSES.md.