Instructions to use True2456/Ling-3.0-Flash-4.6bpw-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use True2456/Ling-3.0-Flash-4.6bpw-MLX 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("True2456/Ling-3.0-Flash-4.6bpw-MLX") 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 True2456/Ling-3.0-Flash-4.6bpw-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "True2456/Ling-3.0-Flash-4.6bpw-MLX"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "True2456/Ling-3.0-Flash-4.6bpw-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use True2456/Ling-3.0-Flash-4.6bpw-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "True2456/Ling-3.0-Flash-4.6bpw-MLX"
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 "True2456/Ling-3.0-Flash-4.6bpw-MLX" \ --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"
- MLX LM
How to use True2456/Ling-3.0-Flash-4.6bpw-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "True2456/Ling-3.0-Flash-4.6bpw-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "True2456/Ling-3.0-Flash-4.6bpw-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "True2456/Ling-3.0-Flash-4.6bpw-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use True2456/Ling-3.0-Flash-4.6bpw-MLX 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 "True2456/Ling-3.0-Flash-4.6bpw-MLX"
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 True2456/Ling-3.0-Flash-4.6bpw-MLX
Run Hermes
hermes
Ling-3.0-Flash-4.6bpw-MLX
A mixed-precision MLX quantization of inclusionAI/Ling-3.0-flash, sized for local inference on Apple Silicon. ~67GB, down from the ~237GB BF16 original, at an effective 4.616 bits/weight average.
Quantization scheme
Not a uniform bit-width — the name reflects the real average, not a round number:
| Component | Bits | Notes |
|---|---|---|
Routed MoE experts (switch_mlp) |
4-bit | ~97% of total parameters |
Attention (KDA + MLA), MoE router, shared experts, lm_head, embed_tokens |
8-bit | ~3% of total parameters |
Affine (round-to-nearest) quantization, group_size=64, no calibration data required. Built with a custom streaming pipeline (lazy-loads the BF16 teacher and quantizes shard-by-shard, so the full 237GB model is never resident) — tooling published at True2456/streaming-dwq-mlx.
Why 4-bit routed experts specifically
Tested routed-expert bit widths from 2 to 6-bit against the BF16 teacher, using realistic chunked prefill (not a single-mega-chunk test, which this specific model's hybrid KDA/MLA architecture is unusually sensitive to — see the linked repo's findings doc if you're building your own quantization of this model family). Results, teacher-vs-quantized KL divergence sampled at 64 positions across a 16K-token document:
| Routed bits | Size | Max bucket KL | Catastrophic positions |
|---|---|---|---|
| 5-bit | 81GB | 0.013 | 0 |
| 4-bit (this model) | 67GB | 0.054 | 0 |
| 3-bit | 53GB | 0.137 | 0 |
| 2-bit | 39GB | 0.521 | 2 (real degradation) |
4-bit was the chosen tradeoff: meaningfully smaller than a straightforward 5-bit or 8-bit quant, with no measured degradation.
Real benchmark validation
KL divergence against a teacher is a distributional proxy, not a task score — so this was also run through real accuracy benchmarks (mmlu, gsm8k, humaneval) against the original unquantized-routed 5-bit-average build:
| Benchmark | This model (4-bit routed) | 5-bit routed | Diff |
|---|---|---|---|
| MMLU | 83.0% (166/200) | 84.0% (168/200) | −1.0pp |
| GSM8K | 95.5% (191/200) | 93.5% (187/200) | +2.0pp |
| HumanEval | 89.0% (146/164) | 87.8% (144/164) | +1.2pp |
At these sample sizes, a 2-4 question swing is within normal binomial noise — statistically indistinguishable from parity.
Important: two upstream mlx-lm bugs this model needs patched
mlx-lm's bailing_hybrid implementation (the architecture family
Ling-3.0-flash belongs to) is missing two pieces of Ling-specific logic
that its own config.json specifies. Neither is optional — running
without them costs real accuracy, silently, with no error or crash to
signal it:
- SwiGLU clamp (
expert_swiglu_limit_list/share_expert_swiglu_limit_list, layers 34-41). Measured cost of running unclamped: 88.41% → 71.34% HumanEval (17 points). - KDA safe-gate clamp (
kda_safe_gate: true,kda_lower_bound: -5.0). Somemlx-lmbuilds never read these config fields; the HF reference implementation does. Same category as (1): silent, real accuracy cost.
Both patches: bailing_swiglu_clamp.py,
kda_safe_gate_patch.py.
If you're loading this model through a runtime that doesn't already apply
equivalent fixes, apply these first or expect degraded output.
Usage
Requires an mlx-lm build with bailing_hybrid support and the two
patches above applied (see the linked repo for details).
from mlx_lm import load, generate
model, tokenizer = load("True2456/Ling-3.0-Flash-4.6bpw-MLX")
# apply the SwiGLU clamp + KDA safe-gate patches before/at load time -- see
# https://github.com/True2456/streaming-dwq-mlx for the patch modules
response = generate(model, tokenizer, prompt="Hello!", max_tokens=256)
print(response)
License
MIT, inherited from the base model.
- Downloads last month
- -
8-bit
Model tree for True2456/Ling-3.0-Flash-4.6bpw-MLX
Base model
inclusionAI/Ling-3.0-flash