Text Generation
MLX
Safetensors
raon1_mini
raon
Mixture of Experts
reasoning
korean
dflash2
apple-silicon
conversational
6-bit
Run this model with HF Jobs
Run netprojects/Raon-1-mini-MLX-6bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/netprojects/Raon-1-mini-MLX-6bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/netprojects/Raon-1-mini-MLX-6bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/netprojects/Raon-1-mini-MLX-6bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use netprojects/Raon-1-mini-MLX-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use netprojects/Raon-1-mini-MLX-6bit 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("netprojects/Raon-1-mini-MLX-6bit") 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 netprojects/Raon-1-mini-MLX-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Raon-1-mini-MLX-6bit"
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": "netprojects/Raon-1-mini-MLX-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use netprojects/Raon-1-mini-MLX-6bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "netprojects/Raon-1-mini-MLX-6bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "netprojects/Raon-1-mini-MLX-6bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "netprojects/Raon-1-mini-MLX-6bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use netprojects/Raon-1-mini-MLX-6bit 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 "netprojects/Raon-1-mini-MLX-6bit"
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 netprojects/Raon-1-mini-MLX-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netprojects/Raon-1-mini-MLX-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Raon-1-mini-MLX-6bit"
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 "netprojects/Raon-1-mini-MLX-6bit" \ --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"
Raon-1-mini (aa14d29) MLX 6-bit: weights, KRAFTON's MLX model code, DFlash2 draft, card, Apache-2.0 LICENSE and NOTICE
Browse filesFiles changed (23)
- .gitattributes+1
- LICENSEAdded+202
- NOTICEAdded+46
- README.mdAdded+116
- chat_template.jinjaAdded+134
- config.jsonAdded+118
- dflash2/LICENSEAdded+202
- dflash2/config.jsonAdded+90
- dflash2/model.safetensorsAdded+3
- generation_config.jsonAdded+12
- head_stage1_a2g64gm.safetensorsAdded+3
- model-00001-of-00006.safetensorsAdded+3
- model-00002-of-00006.safetensorsAdded+3
- model-00003-of-00006.safetensorsAdded+3
- model-00004-of-00006.safetensorsAdded+3
- model-00005-of-00006.safetensorsAdded+3
- model-00006-of-00006.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- raon_mlx_model.pyAdded
- raon_serve.pyAdded+16
- requirements.txtAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+10
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.12345678910111213141516171819202122232425262728293031323334353637383940414243444546Raon-1-mini for Apple Silicon (MLX, 6-bit)
This repository contains a conversion of KRAFTON/Raon-1-mini (revision aa14d29897279c31c2f301377a9220e07350c745), made by KRAFTON AI and released under theApache License, Version 2.0 (see LICENSE).
Modified files (Apache License 2.0, section 4(b)): NetProjects (Internet Projects Ltd, https://netprojects.com) converted themodel weights to MLX format with mlx 0.32.4 and mlx-lm 0.32.2 (6-bit affine quantization, output head and embedding 8-bit). The model code(raon_mlx_model.py, raon_serve.py), tokenizer, chat template, DFlash2 draft model (dflash2/) and head_stage1_a2g64gm.safetensorsare KRAFTON's files from KRAFTON/Raon-1-mini-mlx (revision 78b7555b89023baa76da051b9b7c190545691038), unchanged. No weights were trained or otherwise changed.
Credits: Raon-1 mini by KRAFTON AI. Not affiliated with KRAFTON.
----- NOTICE of KRAFTON/Raon-1-mini-mlx (unchanged) -----
Raon-1 mini (MLX)Copyright 2026 KRAFTON Inc.
This repository is licensed under the Apache License, Version 2.0 (see the model card).
raon_mlx_model.py includes code from the following projects:
- MLX and MLX-LM (https://github.com/ml-explore/mlx, https://github.com/ml-explore/mlx-lm) Copyright 2023-2026 Apple Inc. Licensed under the MIT License; the full notice is at the top of raon_mlx_model.py. - Metal kernel source copied from MLX 0.32.4: fp4.h, fp8.h and the quantized matrix-vector implementations of fp_quantized.h (used by the DFlash2 verify kernels). - Metal kernels adapted from MLX 0.32.4: the fp4/fp8 decoders and the qdot / fp_qmv_impl / fp_qmv_quad_impl arithmetic of fp_quantized.h (multi-row DFlash2 verify kernels, routed expert down projection, RDA decode front end); the simdgroup fragment layout of steel/gemm/mma.h and the GEMM dispatch rules of backend/metal/matmul.cpp (MLA decode attention); the f32 gemv tiling of gemv.metal (router logits); sigmoid, log1p and softplus as MLX computes them (RDA and router kernels); the reduction orders of row_reduce / col_reduce, the batched matmul order and depthwise_conv_1d (prompt-processing kernels for mHC, RMS norms, RDA convolution and the MoE combine); the gather_qmm_rhs tiling (routed expert prompt kernel, which includes the steel GEMM loader and BlockMMA headers of the installed MLX package when it is built). - Model code adapted from MLX-LM 0.32, including the gated delta-rule kernels (mlx_lm/models/gated_delta.py; the packed vector-gate layout for prompt rows).
- vLLM (https://github.com/vllm-project/vllm) Copyright contributors to the vLLM project. Licensed under the Apache License, Version 2.0 (a copy of the license is in dflash2/LICENSE). The DFlash2 draft model code in raon_mlx_model.py is a reimplementation for MLX that follows vllm/model_executor/models/qwen3_dflash.py and the DFlash2 speculator (qwen3_dflash2.py, as in https://github.com/krafton-ai/vllm, branch raon). The DFlash method is described at https://github.com/z-lab/dflash; no code from that repository is included.
dflash2/ contains the DFlash2 draft model weights (from KRAFTON/Raon-1-mini-preview-dflash2, Apache License 2.0;see dflash2/LICENSE), converted to NVFP4, together with an NVFP4 copy of this model's output head.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116---library_name: mlxlicense: apache-2.0pipeline_tag: text-generationbase_model: KRAFTON/Raon-1-minibase_model_relation: quantizedlanguage: - ko - en - ja - zh - es - fr - thtags: - mlx - raon - moe - reasoning - korean - dflash2 - apple-silicon---
# Raon-1-mini MLX 6-bit
[Raon-1 mini](https://huggingface.co/KRAFTON/Raon-1-mini) is KRAFTON AI's open Mixture-of-Experts language model, **trained from scratch**: 28.8B parameters,4.3B active per token (6 of 128 routed experts plus 1 shared), 262,144 tokens of context, and a hybrid of 18 Raon DeltaAttention layers and 7 gated MLA layers. It is strong in Korean conversation and agentic tasks, with built-in thinking and sixreasoning effort levels.
This repository is a **6-bit MLX build for Apple Silicon** (24.0 GB), converted by [NetProjects](https://netprojects.com) fromKRAFTON's MXFP8 release. It runs with KRAFTON's own MLX model code (`raon_mlx_model.py`, included unchanged), so reasoning effort,the DFlash2 speculative draft model (`dflash2/`, included) and the optional two-stage output head all work as described inKRAFTON's MLX instructions.
## Builds
| Build | Size | Top-1 vs bf16 | Plain decode | DFlash2 decode | Note ||---|---|---|---|---|---|| [6-bit](https://huggingface.co/netprojects/Raon-1-mini-MLX-6bit) (recommended) | 24.0 GB | 97.8% | 121 tok/s | 22 tok/s | smallest, best speed for the quality || [8-bit](https://huggingface.co/netprojects/Raon-1-mini-MLX-8bit) | 30.1 GB | 97.4% | 106 tok/s | 95 tok/s | routed experts identical to KRAFTON MXFP8 |
Top-1: share of 311 teacher-forced positions (8 short English / Korean prompts, thinking on and off) where the build picks the samenext token as the bf16 weights. Speeds: one short greedy prompt each on a MacBook Pro M5 Max (128 GB) with KRAFTON's CLI, plaingeneration with effort `none` and DFlash2 with thinking on; indicative only, real speed depends on the prompt and on how many drafttokens are accepted. KRAFTON also publishes an NVFP4 MLX build at [KRAFTON/Raon-1-mini-mlx](https://huggingface.co/KRAFTON/Raon-1-mini-mlx).
## Highlights (from KRAFTON)
- **Reasoning:** six levels (`none`, `low`, `medium`, `high`, `xhigh`, `max`), selectable per request. 96.7 on AIME 2026, 87.1 on HMMT Feb 2026 and 86.0 on GPQA Diamond.- **Multi-turn conversation and search:** 64.9 on MultiChallenge and 55.9 on BrowseComp Plus, ahead of the MoE models KRAFTON compares.- **Multilingual:** trained on Korean, English, Japanese, Chinese, Spanish, French and Thai.- **Agents:** tool calling, with setups for Hermes Agent, Pi and OpenCode.
All benchmark numbers are KRAFTON's, measured on their release; see the [original model card](https://huggingface.co/KRAFTON/Raon-1-mini) for the full tables.
## Quickstart
Python 3.11+ with KRAFTON's pinned versions (DFlash2 needs exactly `mlx==0.32.4` and `mlx-lm` 0.32.x):
```bashuv venv --python 3.12 --seed && source .venv/bin/activatepython -m pip install "mlx==0.32.4" "mlx-lm==0.32.2" "transformers==5.20.1"hf download netprojects/Raon-1-mini-MLX-6bit --local-dir Raon-1-mini-MLX-6bitcd Raon-1-mini-MLX-6bit```
Generate with DFlash2 (default) and the recommended sampling:
```bashpython raon_mlx_model.py generate --prompt "Tell me about KRAFTON AI." \ --max-tokens 32768 --temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5```
Add `--no-dflash` for plain generation, `--reasoning-effort low` (or `none` … `max`) to set the effort, and use`python raon_mlx_model.py serve --host 127.0.0.1 --port 8000` for an OpenAI-compatible server that accepts `reasoning_effort`.
In Python with mlx-lm (the model code is loaded from this folder, so `trust_remote_code=True` is needed):
```pythonfrom mlx_lm import load, generatefrom mlx_lm.sample_utils import make_sampler, make_logits_processors
model, tokenizer = load("Raon-1-mini-MLX-6bit", trust_remote_code=True)prompt = tokenizer.apply_chat_template([{"role": "user", "content": "Tell me about KRAFTON AI."}], tokenize=False, add_generation_prompt=True, enable_thinking=True)print(generate(model, tokenizer, prompt=prompt, max_tokens=32768, sampler=make_sampler(temp=1.0, top_p=0.95, top_k=20), logits_processors=make_logits_processors(presence_penalty=1.5)))```
`python -m mlx_lm server --model Raon-1-mini-MLX-6bit --trust-remote-code` also works (it supports tool calling but ignores`reasoning_effort`). KRAFTON recommends `presence_penalty` 0 for coding and math and 1.5 for everything else, and effort `none`for chat and simple tool calls.
## How this build was made
- Source: [KRAFTON/Raon-1-mini](https://huggingface.co/KRAFTON/Raon-1-mini) at revision `aa14d2989727` (MXFP8: routed experts in fp8 with one power-of-two scale per 32 inputs, everything else in bf16).- Weights: 6-bit affine quantization (group size 64) of every linear layer, with the routed experts dequantized exactly from KRAFTON's MXFP8 weights first. The output head and the token embedding are 8-bit; the router, the MLA `kv_b_proj` and the small RDA gate projections stay in bf16. No weights were trained or otherwise changed.- Code and extras from [KRAFTON/Raon-1-mini-mlx](https://huggingface.co/KRAFTON/Raon-1-mini-mlx) at revision `78b7555b8902`, unchanged: `raon_mlx_model.py`, `raon_serve.py`, tokenizer and chat template, the DFlash2 draft model (`dflash2/`) and `head_stage1_a2g64gm.safetensors`.- Converted with mlx 0.32.4 and mlx-lm 0.32.2. Checks: top-1 97.8% and top-32 KL 0.0056 against the bf16 weights, plus English, Korean and thinking-mode smoke tests through KRAFTON's CLI.- The other build: [8-bit](https://huggingface.co/netprojects/Raon-1-mini-MLX-8bit).
## License
Apache License 2.0, as released by KRAFTON (see `LICENSE` and `NOTICE`). The license covers the model weights, configurationfiles and other components in this repository; it does not cover KRAFTON's hosted Raon service, which has its own terms.
Credits: Raon-1 mini, its MLX model code and the DFlash2 draft model by KRAFTON AI. MLX conversion by[NetProjects](https://netprojects.com). Not affiliated with KRAFTON.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134{#- Text-only ChatML SFT protocol for raon-1-mini. -#}{%- set truncate_history_thinking = truncate_history_thinking if truncate_history_thinking is defined else false %}{%- macro render_content(content, is_system_content=false) %} {%- if content is string %} {{- content }} {%- elif content is iterable and content is not mapping %} {%- for item in content %} {%- if 'text' in item %} {{- item.text }} {%- else %} {{- raise_exception('raon-1-mini supports text content only.') }} {%- endif %} {%- endfor %} {%- elif content is none or content is undefined %} {{- '' }} {%- else %} {{- raise_exception('Unexpected content type.') }} {%- endif %}{%- endmacro %}{%- macro render_assistant_body(message, content, reasoning_content, preserve_reasoning) %} {%- if preserve_reasoning and reasoning_content|trim %} {{- '<think>\n' + reasoning_content|trim + '\n</think>\n\n' }} {%- else %} {{- '<think></think>\n\n' }} {%- endif %} {{- content }} {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {%- if loop.first %} {%- if content|trim %} {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- else %} {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- endif %} {%- else %} {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- endif %} {%- if tool_call.arguments is defined %} {%- for args_name, args_value in tool_call.arguments|items %} {{- '<parameter=' + args_name + '>\n' }} {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %} {{- args_value }} {{- '\n</parameter>\n' }} {%- endfor %} {%- endif %} {{- '</function>\n</tool_call>' }} {%- endfor %} {%- endif %} {{- '<|im_end|>' }}{%- endmacro %}{%- if not messages %} {{- raise_exception('No messages provided.') }}{%- endif %}{%- if tools and tools is iterable and tools is not mapping %} {{- '<|im_start|>system\n' }} {{- '# Tools\n\nYou have access to the following functions:\n\n<tools>' }} {%- for tool in tools %} {{- '\n' }} {{- tool | tojson }} {%- endfor %} {{- '\n</tools>' }} {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }} {%- if messages[0].role == 'system' %} {%- set content = render_content(messages[0].content, true)|trim %} {%- if content %} {{- '\n\n' + content }} {%- endif %} {%- endif %} {{- '<|im_end|>\n' }}{%- elif messages[0].role == 'system' %} {%- set content = render_content(messages[0].content, true)|trim %} {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}{%- endif %}{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}{%- for message in messages[::-1] %} {%- set index = (messages|length - 1) - loop.index0 %} {%- if ns.multi_step_tool and message.role == 'user' %} {%- set content = render_content(message.content)|trim %} {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %} {%- set ns.multi_step_tool = false %} {%- set ns.last_query_index = index %} {%- endif %} {%- endif %}{%- endfor %}{%- for message in messages %} {%- set content = render_content(message.content)|trim %} {%- if message.role == 'system' %} {%- if not loop.first %} {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }} {%- endif %} {%- elif message.role == 'user' %} {{- '<|im_start|>user\n' + content + '<|im_end|>\n' }} {%- elif message.role == 'assistant' %} {%- set reasoning_content = '' %} {%- if message.reasoning_content is string %} {%- set reasoning_content = message.reasoning_content %} {%- elif content.startswith('<think>') and '</think>' in content %} {%- set thinking_parts = content.split('</think>', 1) %} {%- set reasoning_content = thinking_parts[0][7:].strip('\n') %} {%- set content = thinking_parts[1].lstrip('\n') %} {%- endif %} {{- '<|im_start|>assistant\n' }} {%- set preserve_reasoning = (not truncate_history_thinking) or (loop.index0 > ns.last_query_index) %} {%- if message.loss is defined and message.loss is false %} {{- render_assistant_body(message, content, reasoning_content, preserve_reasoning) }} {%- else %} {%- generation %} {{- render_assistant_body(message, content, reasoning_content, preserve_reasoning) }} {%- endgeneration %} {%- endif %} {{- '\n' }} {%- elif message.role == 'tool' %} {%- if loop.previtem and loop.previtem.role != 'tool' %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' + content + '\n</tool_response>' }} {%- if loop.last or loop.nextitem.role != 'tool' %} {{- '<|im_end|>\n' }} {%- endif %} {%- else %} {{- raise_exception('Unexpected message role.') }} {%- endif %}{%- endfor %}{%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- if enable_thinking is defined and enable_thinking is false %} {{- '<think></think>\n\n' }} {%- else %} {{- '<think>\n' }} {%- endif %}{%- endif %}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118{ "architectures": [ "Raon1MiniForCausalLM" ], "model_type": "raon1_mini", "dtype": "bfloat16", "hidden_size": 2560, "num_hidden_layers": 25, "num_attention_heads": 40, "head_dim": 128, "vocab_size": 259840, "tie_word_embeddings": false, "max_position_embeddings": 262144, "rms_norm_eps": 1e-05, "rope_parameters": null, "hidden_act": "situ", "activation_situ_beta": 4.0, "activation_situ_linear_beta": 25.0, "intermediate_size": 12032, "first_k_dense_replace": 1, "moe_layer_freq": 1, "num_experts": 128, "num_experts_per_token": 6, "moe_intermediate_size": 1088, "num_shared_experts": 1, "moe_router_activation_func": "sigmoid", "moe_renormalize": true, "use_grouped_topk": false, "num_expert_group": null, "topk_group": null, "routed_scaling_factor": 1.0, "routed_expert_hidden_size": null, "latent_moe_use_norm": false, "q_lora_rank": 576, "kv_lora_rank": 512, "qk_nope_head_dim": 128, "qk_rope_head_dim": 64, "v_head_dim": 128, "mla_use_nope": true, "mla_use_output_gate": true, "attn_res_block_size": null, "raon_mhc_streams": 4, "num_nextn_predict_layers": 0, "rda_config": { "num_heads": 40, "head_dim": 128, "conv_kernel_size": 4, "full_rank_gate": true, "gate_lower_bound": -5.0, "rda_layers": [ 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 23 ], "mla_layers": [ 4, 8, 12, 16, 20, 24, 25 ] }, "eos_token_id": [ 259200, 259202 ], "raon_fp32_export_head": false, "raon_global_scaled_linears": null, "raon_fused_mhc_decode": true, "raon_merged_gate_up": true, "model_file": "raon_mlx_model.py", "transformers_version": "5.20.1", "reasoning_effort_steering": { "alpha": { "none": 0, "low": 0.3, "medium": 0.1, "high": 0.05, "xhigh": 0.02, "max": 0 }, "default": "high", "layers": [ 12, 14, 16, 18, 20 ] }, "quantization": { "group_size": 64, "bits": 6, "mode": "affine" }, "quantization_config": { "group_size": 64, "bits": 6, "mode": "affine" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990{ "_name_or_path": "", "architectures": [ "DFlash2DraftModel" ], "attention_bias": false, "attention_dropout": 0.0, "block_size": 8, "bos_token_id": null, "chunk_size_feed_forward": 0, "dflash_config": { "block_size": 8, "causal": false, "conv_group_size": 16, "conv_kernel_size": 2, "mask_token_id": 259839, "selector_enabled": true, "selector_rank": 256, "selector_top_k": 16, "swa_window_size": 2048, "target_embedding_size": 2560, "target_feature_size": 51200, "target_layer_ids": [ 1, 6, 11, 16, 21 ], "target_streams_per_layer": 4, "use_aux_hidden_state": true, "use_swa": true }, "dtype": "bfloat16", "eagle_aux_hidden_state_layer_ids": [ 2, 7, 12, 17, 22 ], "eos_token_id": null, "head_dim": 128, "hidden_act": "silu", "hidden_size": 2560, "id2label": { "0": "LABEL_0", "1": "LABEL_1" }, "initializer_range": 0.02, "intermediate_size": 8192, "is_causal": false, "is_encoder_decoder": false, "label2id": { "LABEL_0": 0, "LABEL_1": 1 }, "layer_types": [ "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention" ], "max_position_embeddings": 262144, "max_window_layers": 5, "model_type": "qwen3", "num_attention_heads": 20, "num_hidden_layers": 5, "num_key_value_heads": 5, "num_target_layers": 25, "output_attentions": false, "output_hidden_states": false, "pad_token_id": null, "problem_type": null, "return_dict": true, "rms_norm_eps": 1e-05, "rope_parameters": { "rope_theta": 10000000.0, "rope_type": "default" }, "sliding_window": 2048, "target_hidden_size": 10240, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "5.3.0", "use_cache": true, "use_sliding_window": true, "vocab_size": 259840}123version https://git-lfs.github.com/spec/v1oid sha256:4006d6fbeafec835571d7e90c382508220c32667d1ee6c97efc5129c44eb9cb6size 971364975123456789101112{ "eos_token_id": [ 259202, 259200 ], "pad_token_id": 259200, "do_sample": true, "temperature": 1.0, "top_p": 0.95, "top_k": 20, "presence_penalty": 1.5}123version https://git-lfs.github.com/spec/v1oid sha256:af47cf838f27b110d5e6c0ca5f0480e6be6df0880ae1ba5f4ea019e7142854f7size 207872903123version https://git-lfs.github.com/spec/v1oid sha256:d4ed3d43413a5e7a4790472c24288d053399580b5154f29df87c34f485069951size 4658970986123version https://git-lfs.github.com/spec/v1oid sha256:79f97cf269f2eed13f70614decbe68e870fd68267b0c0bd57e2a05a64065f763size 4648431338123version https://git-lfs.github.com/spec/v1oid sha256:0638e504a738c5a734878263fb24fbe66fbd1a16437a0ba531c4d6daec6cba0asize 4648452312123version https://git-lfs.github.com/spec/v1oid sha256:8b6d11806492862754112c76e919b86dc66e7f578955dab218920bf7262207dbsize 4632212415123version https://git-lfs.github.com/spec/v1oid sha256:c7af4ace3668dfc714d2f9277f720e5afa2d65adf5cbd0a1b308b36b9ee9939dsize 4632202195123version https://git-lfs.github.com/spec/v1oid sha256:1e3f603897f7d3b6645f72768dfb150502b91d1a7f520e207dce3c7ac2970ca3size 60162151112345678910111213141516"""mlx_lm.server launcher. Same CLI as `python -m mlx_lm server`; only difference is the stream the batch generator runs on.Why: mlx-lm 0.32.2's server passes `mx.default_stream` to BatchGenerator, and its per-token `logprobs[token].item()` (default stream too)then queues behind the next decode step already in flight, which costs about 2.2 ms/token at C=1 (server.py line 991, found by sampling).With the library's own thread-local generation stream that op no longer waits for the in-flight step. Output tokens are unchanged.usage: python raon_serve.py --model DIR --port N ... (set RAON_SERVE_STOCK_STREAM=1 for the stock behavior)"""import importlib, os, sysG = importlib.import_module("mlx_lm.generate")if os.environ.get("RAON_SERVE_STOCK_STREAM") != "1": _init = G.BatchGenerator.__init__ def _patched(self, model, *a, **k): k["stream"] = None return _init(self, model, *a, **k) G.BatchGenerator.__init__ = _patchedfrom mlx_lm.server import mainsys.argv = ["mlx_lm.server"] + sys.argv[1:]main()123mlx==0.32.4mlx-lm==0.32.2transformers==5.20.1123version https://git-lfs.github.com/spec/v1oid sha256:47752d33008f5dd7cc91d875f1b798d1f1ad8f6a0e84aac9e67cbb49f9da16afsize 1221905412345678910{ "backend": "tokenizers", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "model_max_length": 1000000000, "pad_token": "<|endoftext|>", "tokenizer_class": "TokenizersBackend", "unk_token": null}.gitattributes+1
LICENSEAdded+202
NOTICEAdded+46
README.mdAdded+116
chat_template.jinjaAdded+134
config.jsonAdded+118
dflash2/LICENSEAdded+202
dflash2/config.jsonAdded+90
dflash2/model.safetensorsAdded+3
generation_config.jsonAdded+12
head_stage1_a2g64gm.safetensorsAdded+3
model-00001-of-00006.safetensorsAdded+3
model-00002-of-00006.safetensorsAdded+3
model-00003-of-00006.safetensorsAdded+3
model-00004-of-00006.safetensorsAdded+3
model-00005-of-00006.safetensorsAdded+3
model-00006-of-00006.safetensorsAdded+3
model.safetensors.index.jsonAdded
raon_mlx_model.pyAdded
raon_serve.pyAdded+16
requirements.txtAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+10