basalt

A pure Swift local LLM server for Apple silicon. It runs MLX models on Metal and serves OpenAI-compatible and Anthropic-compatible HTTP APIs plus MCP stdio, so Claude Code and other agents can use your Mac's GPU.

View on GitHub ↗
Stars
★ 9
Last commit
5 Dec 2026
Maintenance
Active
Licence
MIT
Category
On-device AI SDKs
GitHub
goodmai/basalt

Overview

basalt turns a Mac into a local language-model server. It loads open-weight MLX models on the Metal GPU and serves them through REST on port 8080 (OpenAI chat completions and Anthropic /v1/messages) and through MCP stdio for Claude Desktop and Cursor. It's a single Swift binary, with no Python at runtime.

basalt onboard picks a model that fits your Mac and downloads it. basalt fit ranks the catalogue against your hardware. You can also chat in the terminal, review diffs locally, and optionally fall back to a cloud OpenAI-compatible server for prompts that do not fit.

basalt is licensed under the MIT licence.

Features

  • One server, two transports: REST (OpenAI and Anthropic) and MCP stdio, sharing a single model actor.
  • Point Claude Code at it by setting ANTHROPIC_BASE_URL (and a local token); the README's basalt-claude launcher scopes those env vars to one session.
  • Chat, tool calls, JSON-schema output, /v1/embeddings and /v1/rerank from one server.
  • Model helpers: models list, download, info, cache, check and inspect.
  • Prompt-cache reuse, optional speculative decoding and other serve flags documented in the README.
  • Optional OpenRouter (or other /v1) cloud fallback with spend caps via basalt cloud configure.
  • Pure SwiftPM build; Metal kernels compiled once into mlx.metallib beside the binary.

Requirements

  • macOS 27 or later.
  • Xcode 27.0 or later, with Swift 6.4.
  • Metal toolchain installed (xcodebuild -downloadComponent MetalToolchain).
  • Apple silicon with unified memory.
  • Disk space for models (the README says 2–30 GB depending on the model).

Install

  1. Homebrew. Run brew tap goodmai/basalt https://github.com/goodmai/basalt, then on Homebrew 7+ brew trust goodmai/basalt, then brew install goodmai/basalt/basalt. There is no bottle; the formula builds from source, so Xcode and the Metal toolchain are required. Install the Metal toolchain first with:

    xcodebuild -downloadComponent MetalToolchain
  2. From source. Clone the repo, run swift build -c release, then ./scripts/build_metal.swift once so the metallib sits next to the binary.

Example

1. Run basalt onboard to pick and download a model that fits.

2. Run basalt serve --model mlx-community/Qwen3.5-4B-4bit --rest.

3. In another terminal, point Claude Code at it: set ANTHROPIC_BASE_URL to http://localhost:8080 and ANTHROPIC_AUTH_TOKEN to local, then run claude.

Or use the repo's ./basalt-claude launcher, which builds if needed, waits for readiness and opens Claude Code with local env vars scoped to that session.

Works with

Claude CodeAny MCP client

Listed in

Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.

Report a correction

More in this category