Run this model with HF Jobs
Run Xylolabs/Inkling-2-Mini-MLX 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/Xylolabs/Inkling-2-Mini-MLX. 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/Xylolabs/Inkling-2-Mini-MLX 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/Xylolabs/Inkling-2-Mini-MLX. 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 Xylolabs/Inkling-2-Mini-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/Inkling-2-Mini-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Xylolabs/Inkling-2-Mini-MLX") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use Xylolabs/Inkling-2-Mini-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "Xylolabs/Inkling-2-Mini-MLX" --prompt "Once upon a time"
- Atomic Chat
Add Inkling-2-Mini MLX native and q8 builds (part 1/3)
Browse filesFiles changed (15)
- LICENSEAdded+202
- NOTICEAdded+9
- README.mdAdded+66
- accuracy-by-size.csvAdded+3
- native/.doneAdded
- native/LICENSEAdded+202
- native/NOTICEAdded+9
- native/README.mdAdded+7
- native/chat_template.jinjaAdded+137
- native/config.jsonAdded+127
- native/generation_config.jsonAdded+6
- native/model-00001-of-00004.safetensorsAdded+3
- native/model-00002-of-00004.safetensorsAdded+3
- native/model-00003-of-00004.safetensorsAdded+3
- native/model-00004-of-00004.safetensorsAdded+3
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.123456789This repository holds modified versions of thinkingmachines/Inkling-2-Mini(https://huggingface.co/thinkingmachines/Inkling-2-Mini, Thinking Machines Lab, Inc.,Apache 2.0 and Model Acceptable Use Policy).
Modified by Xylolabs (2026-12-01):- native/: converted to MLX format keeping the upstream NVFP4 (layers 0-19) and MXFP8 (layers 20-23) routed expert weights and bf16 non-expert weights, without the MTP drafter.- q8/: converted to MLX format keeping the upstream NVFP4 (layers 0-19) and MXFP8 (layers 20-23) routed expert weights, with attention projections, embeddings, and the language model head quantized to 8-bit affine (group size 64) and vision weights kept in bf16, without the MTP drafter.
Configuration, tokenizer, and chat template files are derived from the base model.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566---license: apache-2.0license_link: LICENSEbase_model:- thinkingmachines/Inkling-2-Minibase_model_relation: quantizedpipeline_tag: text-generationlibrary_name: mlxtags:- mlx- inkling- inkling2-loop- moe- nvfp4- mxfp8language:- en---
<div align="center">
<img class="block dark:hidden mx-auto" src="https://raw.githubusercontent.com/XylolabsInc/tensix-bfp-gptq/main/assets/xylolabs-lockup.svg" alt="Xylolabs" width="256" height="40"><img class="hidden dark:block mx-auto" src="https://raw.githubusercontent.com/XylolabsInc/tensix-bfp-gptq/main/assets/xylolabs-lockup-dark.svg" alt="Xylolabs" width="256" height="40">
<h1>Inkling-2-Mini MLX</h1>
[](https://huggingface.co/thinkingmachines/Inkling-2-Mini)[](https://huggingface.co/Xylolabs/Inkling-2-Mini-MLX/blob/main/LICENSE)
</div>
MLX builds of [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), without the MTP drafter.
## Files
| Folder | Experts | Everything else | Size ||---|---|---|---:|| `native` | NVFP4 layers 0-19, MXFP8 layers 20-23 | bf16 | 19.59 GB || `q8` | NVFP4 layers 0-19, MXFP8 layers 20-23 | attention, embeddings and LM head 8-bit affine (group 64); vision bf16 | 18.12 GB |
## How to run
The `inkling2_loop` architecture is in [mlx-lm pull request 2086](https://github.com/ml-explore/mlx-lm/pull/2086), which is not merged yet. Install mlx-lm from that branch, then pick a folder.
```bashpip install "git+https://github.com/jundot/mlx-lm@inkling2-mini"hf download Xylolabs/Inkling-2-Mini-MLX --include "q8/*" --local-dir inkling-mlxmlx_lm.generate --model inkling-mlx/q8 --prompt "Why is the sky blue?"```
## Accuracy
Mean KL divergence and top-1 agreement against the F32 weights on MLX, 512-token chunks of WikiText-2 (80 chunks), chat (40 chunks) and held-out text (40 chunks). Raw values are in `accuracy-by-size.csv`.
| Build | Size | WikiText-2 KL | top-1 | Chat KL | top-1 | Held-out KL | top-1 ||---|---:|---:|---:|---:|---:|---:|---:|| `native` | 19.59 GB | 0.0025 | 97.86% | 0.0190 | 97.34% | 0.0022 | 98.08% || `q8` | 18.12 GB | 0.0028 | 97.69% | 0.0208 | 96.94% | 0.0027 | 98.05% |
## License
Apache 2.0, as the base model (`LICENSE`). Downstream use of models derived from `thinkingmachines/Inkling-2-Mini` is also subject to Thinking Machines Lab Model Acceptable Use Policy (https://thinkingmachines.ai/model-acceptable-use-policy/). Changes are listed in `NOTICE`.
## Updates
- 2026-12-01: First files: `native` and `q8`.123build,size_bytes,size_gb,wiki_kl,wiki_top1_pct,chat_kl,chat_top1_pct,held_kl,held_top1_pctnative,19594811444,19.595,0.002470,97.8578,0.019030,97.3431,0.002190,98.0784q8,18120895858,18.121,0.002837,97.6912,0.020849,96.9412,0.002722,98.0490123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
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.123456789This repository holds modified versions of thinkingmachines/Inkling-2-Mini(https://huggingface.co/thinkingmachines/Inkling-2-Mini, Thinking Machines Lab, Inc.,Apache 2.0 and Model Acceptable Use Policy).
Modified by Xylolabs (2026-12-01):- native/: converted to MLX format keeping the upstream NVFP4 (layers 0-19) and MXFP8 (layers 20-23) routed expert weights and bf16 non-expert weights, without the MTP drafter.- q8/: converted to MLX format keeping the upstream NVFP4 (layers 0-19) and MXFP8 (layers 20-23) routed expert weights, with attention projections, embeddings, and the language model head quantized to 8-bit affine (group size 64) and vision weights kept in bf16, without the MTP drafter.
Configuration, tokenizer, and chat template files are derived from the base model.1234567---language: enlibrary_name: mlxpipeline_tag: text-generationtags:- mlx---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137{%- set effort_map = {"none": 0.0, "minimal": 0.1, "low": 0.2, "medium": 0.7, "high": 0.9, "xhigh": 0.99, "max": 0.99} -%}{%- set role_token = {"user": "<|message_user|>", "assistant": "<|message_model|>", "system": "<|message_system|>", "tool": "<|message_tool|>"} -%}
{%- macro emit_thinking_effort() -%} {%- set eff = reasoning_effort if reasoning_effort is defined and reasoning_effort is not none else 0.9 -%} {%- if eff is string -%} {%- set key = eff | trim -%} {%- if key not in effort_map -%} {{- raise_exception("Unknown reasoning_effort: " ~ eff) -}} {%- endif -%} {%- set num = effort_map[key] -%} {%- else -%} {%- set num = eff | float -%} {%- endif -%} {%- if num < 0.0 or num > 0.99 -%} {{- raise_exception("reasoning_effort must be in [0.0, 0.99]") -}} {%- endif -%} {{- "<|message_system|><|content_text|>Thinking effort level: " -}} {%- if num == 0.0 -%}0{%- else -%}{{ num }}{%- endif -%} {{- "<|end_message|>" -}}{%- endmacro -%}
{%- if tools -%} {%- set tool_state = namespace(specs=[]) -%} {%- for tool in tools -%} {%- set fn = tool.function if tool.function is defined else tool -%} {%- set spec = { "description": (fn.description if fn.description is defined and fn.description else ""), "name": fn.name, "parameters": (fn.parameters if fn.parameters is defined and fn.parameters else {}), "type": (tool.type if tool.type is defined and tool.type else "function"), } -%} {%- set tool_state.specs = tool_state.specs + [spec] -%} {%- endfor -%} {{- "<|message_system|>tool_declare<|content_xml|>" -}} {{- tool_state.specs | tojson(sort_keys=true, separators=(",", ":")) -}} {{- "<|end_message|>" -}}{%- endif -%}
{%- set state = namespace(effort_emitted=false) -%}{%- for message in messages -%} {%- if message.role not in role_token -%} {{- raise_exception("Unknown message role: " ~ message.role) -}} {%- endif -%} {%- if not state.effort_emitted and message.role != "system" -%} {{- emit_thinking_effort() -}} {%- set state.effort_emitted = true -%} {%- endif -%}
{%- set header = namespace(text=role_token[message.role]) -%} {%- if message.role == "tool" -%} {%- if message.name is defined and message.name -%} {%- set header.text = header.text ~ message.name -%} {%- elif message.tool_call_id is defined and message.tool_call_id -%} {%- for prev in messages -%} {%- if prev.role == "assistant" and prev.tool_calls -%} {%- for tc in prev.tool_calls -%} {%- if tc.id is defined and tc.id == message.tool_call_id and tc.function.name is defined -%} {%- set header.text = header.text ~ tc.function.name -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- elif message.role == "assistant" and message.name is defined and message.name -%} {%- set header.text = header.text ~ message.name -%} {%- endif -%} {%- set rtok = header.text -%} {%- set rendered -%}
{%- if message.role == "assistant" and message.reasoning_content is defined and message.reasoning_content -%} {{- rtok ~ "<|content_thinking|>" ~ message.reasoning_content ~ "<|end_message|>" -}} {%- endif -%}
{%- if message.content is string and (message.content or not (message.role == "assistant" and (message.tool_calls or message.reasoning_content))) -%} {{- rtok ~ "<|content_text|>" ~ message.content ~ "<|end_message|>" -}} {%- elif message.content -%} {%- for part in message.content -%} {%- if part is string -%} {{- rtok ~ "<|content_text|>" ~ part ~ "<|end_message|>" -}} {%- elif part.type is not defined or part.type in ("text", "input_text") -%} {%- set text_part = (part.text if part.text is defined and part.text is string else "") -%} {{- rtok ~ "<|content_text|>" ~ text_part ~ "<|end_message|>" -}} {%- elif part.type in ("image", "input_image", "image_url") -%} {%- if message.role not in ("user", "tool") -%} {{- raise_exception("Image content is only supported for user and tool messages") -}} {%- endif -%} {{- rtok ~ "<|content_image|><|unused_200054|><|end_message|>" -}} {%- elif part.type in ("audio", "input_audio", "audio_url") -%} {{- raise_exception("Inkling 2 does not accept audio input") -}} {%- else -%} {{- raise_exception("Unsupported content part type: " ~ part.type) -}} {%- endif -%} {%- endfor -%} {%- endif -%}
{%- if message.role == "assistant" and message.tool_calls -%} {%- for tc in message.tool_calls -%} {%- set fn = tc.function -%} {%- if fn.name is not defined or fn.name is not string -%} {{- raise_exception("tool call function name must be a string") -}} {%- endif -%} {%- if message.name is defined and message.name and message.name != fn.name -%} {{- raise_exception("assistant name " ~ message.name ~ " does not match its tool call " ~ fn.name) -}} {%- endif -%} {%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%} {%- if args is string -%} {{- raise_exception("tool call arguments must be a parsed object, not a JSON string; canonicalize upstream") -}} {%- endif -%} {%- if args is not mapping -%} {{- raise_exception("tool call arguments must be an object") -}} {%- endif -%} {{- "<|message_model|>" ~ fn.name ~ "<|content_invoke_tool_json|>" -}} {{- '{"name":' ~ (fn.name | tojson(sort_keys=true, separators=(",", ":"))) ~ ',"args":' -}} {{- "{" -}} {%- for key, value in args | dictsort(case_sensitive=true) -%} {{- (key | tojson) ~ ":" ~ (value | tojson(separators=(",", ":"))) -}} {%- if not loop.last -%},{%- endif -%} {%- endfor -%} {{- "}}<|end_message|>" -}} {%- endfor -%} {%- endif -%}
{%- if message.role == "assistant" -%} {{- "<|content_model_end_sampling|>" -}} {%- endif -%} {%- endset -%} {%- if message.role == "assistant" -%} {%- generation -%}{{- rendered -}}{%- endgeneration -%} {%- else -%} {{- rendered -}} {%- endif -%}{%- endfor -%}
{%- if not state.effort_emitted -%} {{- emit_thinking_effort() -}}{%- endif -%}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127{ "architectures": [ "Inkling2LoopForConditionalGeneration" ], "eos_token_id": 200006, "model_type": "inkling2_loop", "mtp_config": { "hidden_size": 2304, "num_hidden_layers": 3, "num_attention_heads": 24, "num_key_value_heads": 8, "head_dim": 128, "intermediate_size": 9216, "max_position_embeddings": 1048576, "torch_dtype": "bfloat16", "q_bias": false, "o_bias": false, "rms_norm_eps": 1e-06, "rope_theta": 1000000.0, "local_layer_ids": [ 0, 2 ], "sliding_window_size": 1024, "block_size": 8, "markov_rank": 256, "markov_head_type": "rnn_hidden", "target_layer_ids": [ 5, 23, 41, 48 ] }, "quantization": { "group_size": 16, "bits": 4, "mode": "nvfp4" }, "quantization_config": { "group_size": 16, "bits": 4, "mode": "nvfp4" }, "text_config": { "model_type": "inkling2_loop_text", "model_max_length": 1048576, "torch_dtype": "bfloat16", "hidden_size": 2304, "num_hidden_layers": 24, "vocab_size": 201024, "num_attention_heads": 24, "num_key_value_heads": 8, "head_dim": 128, "d_rel": 16, "rel_extent": 1024, "q_bias": false, "o_bias": false, "log_scaling_n_floor": 8192, "log_scaling_alpha": 0.1, "rms_norm_eps": 1e-06, "use_value_norm_no_gamma": true, "qk_l2_clip_threshold": 22.627416997969522, "rel_l2_clip_threshold": 8.0, "local_layer_ids": [ 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22 ], "sconv_kernel_size": 4, "unpadded_vocab_size": 200058, "final_logit_softcapping": 30.0, "swa_head_dim": 128, "swa_num_attention_heads": 24, "swa_num_key_value_heads": 8, "sliding_window_size": 1024, "n_layers_per_attn_res_block": 6, "attn_res_normalize_values": true, "n_routed_experts": 128, "num_experts_per_tok": 8, "n_shared_experts": 0, "intermediate_size": 1152, "mlp_gate_softcap": 4.0, "mlp_up_softcap": 25.0, "route_scale": 8.0, "use_gate_bias": true, "loop_config": { "core_start": 6, "core_end": 18, "num_passes": 3, "gate_rank": 64, "is_varloop": false } }, "vision_config": { "model_type": "inkling2_vision", "text_hidden_size": 2304, "temporal_patch_size": 2, "native_patch_size": 20, "adapter_merge_size": 2, "projection_hidden_dim": 4096, "projector_bias": false, "hidden_size": 1024, "num_hidden_layers": 23, "num_attention_heads": 16, "mlp_ratio": 4.0, "posemb_grid_size": 32, "layer_norm_eps": 1e-05 }}123456{ "do_sample": true, "temperature": 1.0, "eos_token_id": 200006, "pad_token_id": 199999}123version https://git-lfs.github.com/spec/v1oid sha256:a7eca24bba853a772866bb1493a120a63114dee27648ae1860e49d0e57f8ed72size 5333707039123version https://git-lfs.github.com/spec/v1oid sha256:7177c8315918a99e1115d3cdb77804528682f274e124b3665c42d9a8c9c59b74size 5084149970123version https://git-lfs.github.com/spec/v1oid sha256:72e42698619e2391fe33592e53a0deca1b066e441d40215120d2141a791fe227size 5360338464123version https://git-lfs.github.com/spec/v1oid sha256:8bca8a60506811df452e985583b843da02235117052d9c63c1df874a18eca632size 3790299914LICENSEAdded+202
NOTICEAdded+9
README.mdAdded+66
accuracy-by-size.csvAdded+3
native/.doneAdded
native/LICENSEAdded+202
native/NOTICEAdded+9
native/README.mdAdded+7
native/chat_template.jinjaAdded+137
native/config.jsonAdded+127
native/generation_config.jsonAdded+6
native/model-00001-of-00004.safetensorsAdded+3
native/model-00002-of-00004.safetensorsAdded+3
native/model-00003-of-00004.safetensorsAdded+3
native/model-00004-of-00004.safetensorsAdded+3