Instructions to use nace-ai/Hy4-flash-MLX-3.1bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nace-ai/Hy4-flash-MLX-3.1bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("nace-ai/Hy4-flash-MLX-3.1bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use nace-ai/Hy4-flash-MLX-3.1bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nace-ai/Hy4-flash-MLX-3.1bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nace-ai/Hy4-flash-MLX-3.1bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nace-ai/Hy4-flash-MLX-3.1bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "nace-ai/Hy4-flash-MLX-3.1bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nace-ai/Hy4-flash-MLX-3.1bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nace-ai/Hy4-flash-MLX-3.1bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use nace-ai/Hy4-flash-MLX-3.1bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nace-ai/Hy4-flash-MLX-3.1bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default nace-ai/Hy4-flash-MLX-3.1bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nace-ai/Hy4-flash-MLX-3.1bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nace-ai/Hy4-flash-MLX-3.1bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "nace-ai/Hy4-flash-MLX-3.1bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Hy4-flash MLX 2-bit
Our smallest Hy4-flash pack: 85.5 GB, 3.12 effective bits per weight.
A Nace quant of Tencent Hy4-flash, with 2-bit routed experts. The preserved model pack contains 85,458,831,601 bytes across 56 files.
The Engram tables retain IQ4_NL precision. Other weights retain their selected precision.
Results
37 measured Hy4-flash variants on the same 11 texts, 5,621 scored tokens. Chart sizes use text-weight payload, including required Engram tables, excluding vision/MTP. Complete weight-file sizes and exact scores are in the comparison data.
Run it
Use Python 3.11 or newer and the bundled MLX loader.
hf download nace-ai/Hy4-flash-MLX-3.1bit --local-dir Hy4-flash-MLX-3.1bit
cd Hy4-flash-MLX-3.1bit
python3 -m venv .venv
source .venv/bin/activate
Install dependencies on Apple silicon:
python3 -m pip install -r requirements-macos.txt
On Linux with a CUDA 13 GPU, use requirements-linux.txt instead.
python3 run_mlx.py --model . --prompt "What is the capital of France?" --max-tokens 64
License
- Downloads last month
- -
4-bit
Model tree for nace-ai/Hy4-flash-MLX-3.1bit
Base model
tencent/Hy4-flash