Instructions to use Vontra/Ling-3.0-flash-oQ2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Vontra/Ling-3.0-flash-oQ2 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("Vontra/Ling-3.0-flash-oQ2") 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 Vontra/Ling-3.0-flash-oQ2 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Vontra/Ling-3.0-flash-oQ2"
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": "Vontra/Ling-3.0-flash-oQ2" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use Vontra/Ling-3.0-flash-oQ2 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Vontra/Ling-3.0-flash-oQ2"
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 "Vontra/Ling-3.0-flash-oQ2" \ --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 Vontra/Ling-3.0-flash-oQ2 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Vontra/Ling-3.0-flash-oQ2"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Vontra/Ling-3.0-flash-oQ2" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vontra/Ling-3.0-flash-oQ2", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Vontra/Ling-3.0-flash-oQ2 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 "Vontra/Ling-3.0-flash-oQ2"
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 Vontra/Ling-3.0-flash-oQ2
Run Hermes
hermes
- Atomic Chat
Ling 3.0 Flash — oQ2
A native Apple-silicon conversion of inclusionAI/Ling-3.0-flash, quantized with oMLX's optimized mixed-precision oQ2 recipe and packaged for oMLX and compatible MLX-LM runtimes.
Original model · InclusionAI on ModelScope · OpenRouter · MLX-LM
About this conversion
This repository contains an oMLX-optimized mixed-precision oQ2 conversion of Ling 3.0 Flash. Ling is a 124B-total / 5.1B-active hybrid-linear mixture-of-experts model. The conversion preserves the upstream tokenizer and chat template and includes the custom MLX architecture adapter required for Kimi Delta Attention, gated MLA, and sparse MoE layers.
| Item | Value |
|---|---|
| Base model | inclusionAI/Ling-3.0-flash |
| Format | MLX safetensors |
| Quantization | oQ2 affine mixed precision, group size 64 |
| Base precision | 2-bit |
| Protected modules | 455 at 8-bit |
| Conversion/runtime stack | oMLX with MLX-LM 0.31.3 / MLX 0.32.0 |
| Weight shards | 9 |
| Weight size | 41.59 GB (38.73 GiB) |
| Maximum configured context | 262,144 tokens |
| Architecture | bailing_hybrid |
This model uses the included
bailing_hybrid.pycustom MLX adapter. In oMLX, enable Trust Remote Code for this model before loading it. Standalone MLX-LM requires a build whosemlx_lm.loadsupports thetrust_remote_codeargument and repository-providedmodel_fileadapters; stock PyPImlx-lm 0.31.3does not provide that loader path.
Apple-silicon performance
This checkpoint was load-tested, generation-tested, and benchmarked on:
| Hardware | Configuration |
|---|---|
| Host | Mac Studio |
| Chip | Apple M3 Ultra |
| CPU | 32 cores (24 performance + 8 efficiency) |
| Unified memory | 256 GB |
| Runtime | oMLX-bundled MLX-LM 0.31.3 / MLX 0.32.0 |
A warmed local test produced:
| Measurement | Result |
|---|---|
| Decode (median) | 75.75 tokens/s |
| Individual decode runs | 75.75 / 75.72 / 75.76 tokens/s |
| Reported peak memory | 42.41 GB |
| Timed runs | 3 × 256 generated tokens |
| Warm-up | 256 generated tokens |
| Prompt | 39 tokens after chat templating |
The decode figure is the median of three greedy 256-token runs after a full 256-token Metal-kernel warm-up. It is a practical local reference, not a controlled cross-platform benchmark. Prompt length, context growth, sampler settings, memory pressure, thermal state, and runtime versions can materially change performance.
Recommended use with oMLX
- Download the model into the oMLX model directory:
hf download Vontra/Ling-3.0-flash-oQ2 \
--local-dir ~/.omlx/models/Vontra/Ling-3.0-flash-oQ2
- Refresh the oMLX model registry.
- Open the model settings and enable Trust Remote Code.
- Load
Ling-3.0-flash-oQ2and use the normal chat UI or OpenAI-compatible endpoint.
Example request:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OMLX_API_KEY" \
-d '{
"model": "Ling-3.0-flash-oQ2",
"messages": [{"role": "user", "content": "Explain why hybrid linear attention is useful."}],
"temperature": 0.6,
"top_p": 0.95,
"max_tokens": 512
}'
Thinking mode is enabled by the upstream chat template by default. Disable it with the model's chat-template configuration when a direct answer is preferred.
Compatible standalone MLX-LM builds
With an MLX-LM build that supports repository-provided model adapters:
mlx_lm.generate \
--model Vontra/Ling-3.0-flash-oQ2 \
--trust-remote-code \
--prompt "Explain why hybrid linear attention is useful." \
--max-tokens 512 \
--temp 0.6 \
--top-p 0.95 \
--top-k 20
Python usage with the same capability:
from mlx_lm import load, generate
model, tokenizer = load(
"Vontra/Ling-3.0-flash-oQ2",
trust_remote_code=True,
tokenizer_config={"trust_remote_code": True},
)
messages = [
{"role": "user", "content": "Explain sparse mixture-of-experts routing."}
]
prompt = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=False,
enable_thinking=False,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512))
Only enable remote code after reviewing the included adapter files.
Architecture
Ling 3.0 Flash alternates Kimi Delta Attention (KDA) and gated Multi-head Latent Attention (MLA) in a 5:1 ratio and uses highly sparse routed experts.
| Architecture detail | Upstream value |
|---|---|
| Total / active parameters | 124B / 5.1B |
| Transformer layers | 35 KDA + 7 gated MLA |
| Dense layers | 2 |
| Routed / shared experts | 512 / 1 |
| Active routed experts | 8 |
| Attention heads | 32 |
| Hidden size | 2,560 |
| Expert intermediate size | 768 |
| Dense intermediate size | 6,144 |
| Vocabulary size | 157,184 |
| Context training schedule | 8K → 32K → 256K |
The included MLX adapter uses MLX-LM primitives for delta attention, absorbed MLA projections, RoPE, and quantized SwitchGLU experts. The auxiliary MTP training head is excluded from ordinary causal generation; this release does not claim MTP or DSpark speculative-decoding support.
Upstream model highlights
InclusionAI describes Ling 3.0 Flash as a hybrid reasoning model for software-engineering agents, tool use, deep research, general knowledge, mathematical reasoning, instruction following, and long-context understanding.
The upstream defaults are:
thinking: enabled
temperature: 0.6
top_p: 0.95
top_k: 20
For benchmark methodology, scores, intended use, limitations, and framework-specific deployment instructions, see the original InclusionAI model card.
Conversion and validation notes
- Source weights: upstream BF16 checkpoint.
- Quantization mode: affine, group size 64.
- oQ2 uses a 2-bit base with 455 sensitive modules kept at higher precision.
- Both
quantizationandquantization_configpreserve the per-module recipe. - The upstream chat template is included unchanged.
- All 2,067 converted tensors and all 9 indexed shards were checked locally.
- The custom adapter was loaded with explicit trust and exercised through end-to-end generation.
- Quantization can reduce output quality relative to BF16; use a higher-precision variant when quality matters more than memory use.
This is a community conversion, not an official InclusionAI release. Validate quality and numerical behavior on representative workloads before production use.
License and attribution
The upstream model declares the MIT License in its Hugging Face metadata. A standard MIT licence copy is included in this repository.
All model design, training, benchmark, and upstream documentation credit belongs to InclusionAI and the original contributors. The mixed-precision conversion, Apple-silicon validation, compatibility packaging, and model card are provided by Vontra.
- Downloads last month
- 114
2-bit
Model tree for Vontra/Ling-3.0-flash-oQ2
Base model
inclusionAI/Ling-3.0-flash