- 版本
- higgs-v1.9.0
- 发布日期
- 2026-11-15
- 平台
- macOS
- 安装包大小
- macOS 58.0 MB
- 发布者
- panbanda
higgs
One Rust binary that serves local models on Apple Silicon and routes to cloud providers, behind OpenAI and Anthropic compatible APIs.
README

One Rust binary that serves local models on Apple Silicon and routes to cloud providers, behind OpenAI and Anthropic compatible APIs.

Higgs is for developers who run models on a Mac. Use it behind coding agents, scripts and apps that already speak the OpenAI or Anthropic API. It runs MLX models from Hugging Face on the Mac. It sends other requests to cloud providers. It needs no Python environment.
Quick start
You need an Apple Silicon Mac.
- Install Higgs:
brew install panbanda/brews/higgs
- Start a model. Use a Hugging Face ID or a local path:
higgs serve --model mlx-community/Llama-3.2-1B-Instruct-4bit
If the model is not in your Hugging Face cache, Higgs asks before it downloads the model with the hf CLI. Answer y.
- In a second terminal, send a request:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"mlx-community/Llama-3.2-1B-Instruct-4bit","messages":[{"role":"user","content":"Write one sentence about Cape Town."}]}'
- To use the model from Claude Code, start Claude Code through Higgs in the second terminal:
ANTHROPIC_AUTH_TOKEN=higgs higgs exec -- claude
higgs exec finds the server on 127.0.0.1:8000, unless a config file sets another address or HIGGS_HOST and HIGGS_PORT are set. If the server uses another port, add --port <port>. The server answers every model name with its one model. This works only while the server has one local model and no routes or providers. For more than one model, use a config file with routes. See the Claude Code recipe.
This 1B model is small, so the first run is fast. It is too small for good agent work. Choose a larger model for daily use. See which model to start with.
Contents
- Install
- What you get
- Recipes
- Supported models
- Configuration
- API and CLI reference
- Desktop app
- Performance
- FAQ and troubleshooting
- Contributing
- License
Install
With Homebrew:
brew install panbanda/brews/higgs # CLI and server
brew install --cask panbanda/brews/higgs-desktop # desktop app; bundles the CLI
From the latest release:
higgs_<version>_aarch64-apple-darwin.tar.gzcontains thehiggsbinary andmlx.metallib. A.sha256file is included. Keep the binary and the library in the same directory.Higgs_<version>_aarch64.dmgandHiggs_<version>_aarch64.app.zipcontain the desktop app. The bundle is not notarized. On first launch, right-click the app and choose Open. You can also runxattr -dr com.apple.quarantine /Applications/Higgs.app.
The Homebrew formula also installs the hf CLI. Higgs uses it to download models. With any other install method, run brew install hf. In scripts and other non-interactive runs, download the model first with hf download <model-id>.
To build from source, use Rust 1.91 or newer and the Xcode Command Line Tools:
git clone https://github.com/panbanda/higgs && cd higgs
cargo build --release
./target/release/higgs --help
Higgs is not on crates.io, because it depends on a pinned git revision of mlx-rs. The release process produces Apple Silicon macOS builds only.
What you get
Many requests at once. Higgs decodes concurrent requests together with continuous batching. With 1, 2, 4 and 8 clients, Llama-3.2-1B-4bit gave 455, 775, 1105 and 1350 tok/s in total. Qwen3.6-35B-A3B-4bit gave 109, 178, 255 and 326 tok/s.
Fast follow-up turns. Higgs keeps prefix KV state in memory. A follow-up turn after about 3,000 tokens of history needed 32 ms to the first token on Llama-3.2-1B-4bit and 84 ms on Qwen3.6-35B-A3B-4bit. Hybrid Qwen3.5 and Qwen3.6 models cannot cut a cache back to a shorter prefix, so Higgs saves checkpoints of their recurrent state. A new question over a 3,850-token shared context took 3.7 s to the first token, not 20.1 s.
Many models in one server. Load a model on its first request, and unload it when it is idle. Limit how many models stay loaded, pin the important ones, and set a memory guard. Higgs evicts the least recently used idle model first.
Drop-in APIs. Higgs serves OpenAI chat completions, completions, Responses and embeddings. It also serves Anthropic messages. Higgs parses tool calls in the Qwen, Mistral, Llama, Gemma, GLM and MiniMax formats. Higgs can also constrain output to a JSON schema or a regex.
Built-in tools. Higgs is an MCP client for stdio and Streamable HTTP servers. It has web search and fetch endpoints. A server-side tool loop runs the tools and continues the generation, also when streaming.
Local and cloud in one endpoint. Define providers and regex routes. A request goes to a local model, to a provider, or to the default target. Higgs translates between the OpenAI and Anthropic formats.
A config that tells you what is wrong. An unknown key is an error with a suggestion. higgs config explain shows where each value comes from. higgs doctor checks models and providers. higgs selftest <model> checks that a model gives correct output. higgs bench <model> measures its speed.
One binary and low memory. There is no Python runtime. Peak memory of the server was 1.2 GB for Llama-3.2-1B-4bit, 1.3 GB for Qwen3-1.7B-4bit and 14.9 GB for Thinklite-27B-4bit.
The numbers come from an Apple M4 Max with 128 GB. The Performance section has the details.
Recipes
Each recipe is complete on its own. A recipe with a config file needs ~/.config/higgs/config.toml. Create it with higgs init and edit it, or pass your own file with --config.
Use it from Claude Code
Claude Code sends model names such as claude-sonnet-4-5. A server with one local model and no routes or providers answers every name with that model.
- Start the server in one terminal:
higgs serve --model mlx-community/Qwen3.6-35B-A3B-4bit
- In a second terminal, run Claude Code through Higgs:
ANTHROPIC_AUTH_TOKEN=higgs higgs exec -- claude
higgs exec finds the server and prints its address on stderr. It sets ANTHROPIC_BASE_URL and OPENAI_BASE_URL, then runs the command. eval "$(higgs shellenv)" exports the same variables into your shell. Both commands accept --port <port> or --url <url> for a server that is not on 127.0.0.1:8000. Both methods work with Aider and with any other tool that reads these variables. Choose a model that calls tools well. Small models often fail with agent prompts.
Several models
With a second model, a route, or a provider, the server returns model_not_found for an unknown name. Add a route that sends each claude-* name to a local model:
[[models]]
path = "mlx-community/Qwen3.6-35B-A3B-4bit"
name = "qwen"
[[models]]
path = "mlx-community/Llama-3.2-1B-Instruct-4bit"
name = "llama"
[[routes]]
match = "claude-.*"
provider = "higgs" # the local models
model = "qwen" # rewrite the requested name
Save the file as higgs.toml. Start the server with higgs --config higgs.toml serve. Then run higgs --config higgs.toml exec -- claude. Without --config, Higgs reads ~/.config/higgs/config.toml when that file exists.
Use it from the OpenAI SDK or any OpenAI client
Set the base URL of the client to the server. The API key can be any string, unless you set server.api_key.
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="unused")
reply = client.chat.completions.create(
model="mlx-community/Llama-3.2-1B-Instruct-4bit",
messages=[{"role": "user", "content": "Write one sentence about Cape Town."}],
)
print(reply.choices[0].message.content)
GET /v1/models lists the model names that the server accepts. The Anthropic SDK works the same way. Use http://localhost:8000 as the base URL.
Serve several models and load them on demand
[memory]
max_loaded_models = 2 # evict the least recently used beyond two
guard = "balanced" # keep about 8% of unified memory for the system
[defaults] # applies to every model; a [[models]] entry overrides it
load = "on_demand" # load on the first request
idle_ttl = "15m" # unload after 15 idle minutes
[[models]]
path = "mlx-community/Qwen3.6-35B-A3B-4bit"
name = "qwen"
pinned = true # never evicted or expired
[[models]]
path = "mlx-community/Llama-3.2-1B-Instruct-4bit"
name = "llama"
POST /v1/models/{id}/load and POST /v1/models/{id}/unload load and unload a model by hand. GET /v1/models/status shows the state and memory of each model. For details, see Model lifecycle.
Tool calling
Send tools as you would send them to OpenAI. Higgs reads the call from the output format of the model and returns structured tool_calls. To force a call, set tool_choice to "required" or to the name of a function:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "mlx-community/Llama-3.2-1B-Instruct-4bit",
"tool_choice": "required",
"messages": [{"role": "user", "content": "What is the weather in Paris?"}],
"tools": [{"type": "function", "function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
}'
A forced call works for the Qwen, Mistral and Llama formats. For the other formats, Higgs returns a 400 error. docs/tool-calling.md describes the format of each model family.
MCP tools
Higgs connects to MCP servers (stdio or Streamable HTTP). It can run their tools for the model. Add a server to the config:
[mcp.servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/Documents"]
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "qwen",
"messages": [{"role": "user", "content": "List the files in my Documents folder."}],
"mcp": {"enabled": true, "servers": ["filesystem"], "max_iterations": 5}}'
The request uses a model named qwen, as in the recipes above. Higgs names each tool server__tool. To load an existing {"mcpServers": {...}} file, use higgs serve --mcp-config mcp.json. The web search and fetch endpoints are optional and off by default. See docs/mcp.md.
Structured output
Constrain the response to a JSON schema:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "mlx-community/Llama-3.2-1B-Instruct-4bit",
"messages": [{"role": "user", "content": "Give me a person with a name and an age."}],
"response_format": {"type": "json_sch