ashxhart commited on
Commit
9569ac3
·
verified ·
1 Parent(s): 704c80d

Add Mac memory chooser and reproducible demo prompt

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md CHANGED
@@ -26,18 +26,22 @@ tags:
26
  - 4-bit
27
  ---
28
 
 
29
  <p align="center">
30
  <img src="https://img.shields.io/badge/NVIDIA-Nemotron-76B900?style=for-the-badge&logo=nvidia&logoColor=white" alt="NVIDIA Nemotron">
31
  <img src="https://img.shields.io/badge/Apple_Silicon-MLX-000000?style=for-the-badge&logo=apple&logoColor=white" alt="Apple silicon MLX">
32
  <img src="https://img.shields.io/badge/Vontra-oMLX-6E56CF?style=for-the-badge&logo=huggingface&logoColor=white" alt="Vontra oMLX">
33
  </p>
34
 
 
35
  <h1 align="center">NVIDIA Nemotron 3.5 Lightning 30B-A3B — MLX 4-bit</h1>
36
 
 
37
  <p align="center">
38
  A native Apple-silicon conversion of <a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16</a>, quantized with stock 4-bit affine weights and packaged for MLX-LM and oMLX.
39
  </p>
40
 
 
41
  <p align="center">
42
  <a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">Original model</a> ·
43
  <a href="https://developer.nvidia.com/nemotron">NVIDIA Nemotron</a> ·
@@ -45,10 +49,13 @@ tags:
45
  <a href="https://openmdw.ai/license/1-1/">OpenMDW 1.1 license</a>
46
  </p>
47
 
 
48
  ## About this conversion
49
 
 
50
  This repository contains a stock 4-bit affine MLX conversion of NVIDIA Nemotron 3.5 Lightning. The source is a 30B-total / 3B-active hybrid mixture-of-experts model that interleaves Mamba-2, sparse MoE, and attention layers. The upstream tokenizer, chat template, and generation configuration are preserved.
51
 
 
52
  | Item | Value |
53
  | --- | --- |
54
  | Base model | [`nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16`](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16) |
@@ -60,12 +67,16 @@ This repository contains a stock 4-bit affine MLX conversion of NVIDIA Nemotron
60
  | Maximum configured context | 262,144 tokens |
61
  | Architecture | `nemotron_h` — Mamba-2 + sparse MoE + attention |
62
 
 
63
  > [!NOTE] MLX-LM reported an effective precision of 4.503 bits per weight.
64
 
 
65
  ## Apple-silicon performance
66
 
 
67
  This checkpoint was load-tested and generation-tested on the following machine:
68
 
 
69
  | Hardware | Configuration |
70
  | --- | --- |
71
  | Host | Mac Studio |
@@ -74,8 +85,10 @@ This checkpoint was load-tested and generation-tested on the following machine:
74
  | Unified memory | 256 GB |
75
  | Runtime | MLX-LM 0.31.3 / MLX 0.32.0 |
76
 
 
77
  A warmed local test produced:
78
 
 
79
  | Measurement | Result |
80
  | --- | ---: |
81
  | Decode (median) | **168.41 tokens/s** |
@@ -84,18 +97,24 @@ A warmed local test produced:
84
  | Warm-up | 32 generated tokens |
85
  | Prompt | 36 tokens after chat templating |
86
 
 
87
  The decode figure is the median of three greedy 256-token runs after a 32-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 MLX/oMLX versions can materially change performance.
88
 
 
89
  ## Quick start with MLX-LM
90
 
 
91
  Install recent MLX-LM and Hugging Face tooling:
92
 
 
93
  ```bash
94
  python -m pip install -U mlx-lm huggingface_hub
95
  ```
96
 
 
97
  Run directly from the Hub:
98
 
 
99
  ```bash
100
  mlx_lm.generate \
101
  --model Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
@@ -105,8 +124,10 @@ mlx_lm.generate \
105
  --top-p 0.95
106
  ```
107
 
 
108
  Reasoning mode is enabled by the upstream chat template by default. To disable it:
109
 
 
110
  ```bash
111
  mlx_lm.generate \
112
  --model Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
@@ -115,11 +136,14 @@ mlx_lm.generate \
115
  --max-tokens 256
116
  ```
117
 
 
118
  Python usage:
119
 
 
120
  ```python
121
  from mlx_lm import load, generate
122
 
 
123
  model, tokenizer = load("Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit")
124
  messages = [
125
  {"role": "user", "content": "Explain sparse mixture-of-experts routing."}
@@ -133,21 +157,27 @@ prompt = tokenizer.apply_chat_template(
133
  print(generate(model, tokenizer, prompt=prompt, max_tokens=512))
134
  ```
135
 
 
136
  To download the repository first:
137
 
 
138
  ```bash
139
  hf download Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
140
  --local-dir ~/.omlx/models/Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit
141
  ```
142
 
 
143
  ## Using it with oMLX
144
 
 
145
  1. Place the downloaded model at `~/.omlx/models/Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit`.
146
  2. Refresh the oMLX model registry.
147
  3. Load `NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit` and use the normal chat UI or OpenAI-compatible endpoint.
148
 
 
149
  Example request:
150
 
 
151
  ```bash
152
  curl http://localhost:8000/v1/chat/completions \
153
  -H "Content-Type: application/json" \
@@ -161,12 +191,16 @@ curl http://localhost:8000/v1/chat/completions \
161
  }'
162
  ```
163
 
 
164
  For long prompts, begin with a conservative context limit and increase it while watching memory pressure. The configured 256K context is a model capability, not a guarantee that every host can prefill that context within its available unified memory.
165
 
 
166
  ## Architecture
167
 
 
168
  Nemotron 3.5 Lightning is a hybrid sparse model designed for efficient agentic and reasoning workloads.
169
 
 
170
  | Architecture detail | Upstream value |
171
  | --- | ---: |
172
  | Total / active parameters | 30B / 3B |
@@ -179,10 +213,13 @@ Nemotron 3.5 Lightning is a hybrid sparse model designed for efficient agentic a
179
  | Vocabulary size | 131,072 |
180
  | Configured context | 262,144 tokens |
181
 
 
182
  The upstream release is intended for coding, tool use, reasoning, research, and customization. For NVIDIA's evaluations, deployment guidance, intended use, limitations, safety information, and full architecture discussion, see the [original model card](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16).
183
 
 
184
  ## Conversion and validation notes
185
 
 
186
  - Source weights: NVIDIA's BF16 checkpoint.
187
  - Quantization group size: 64.
188
  - Quantization mode: affine.
@@ -191,10 +228,46 @@ The upstream release is intended for coding, tool use, reasoning, research, and
191
  - The model was loaded and exercised through end-to-end generation on Apple silicon.
192
  - Quantization can reduce output quality relative to BF16; use a higher-precision variant when quality matters more than memory use.
193
 
 
194
  This is a community conversion, not an official NVIDIA release. Validate quality and numerical behavior on your own representative workload before production use.
195
 
 
196
  ## License and attribution
197
 
 
198
  The upstream model is released under the **OpenMDW License Agreement, version 1.1**. A copy is included in this repository; review it before use or redistribution.
199
 
 
200
  All model design, training, benchmark, and upstream documentation credit belongs to NVIDIA and the original contributors. The MLX conversion, Apple-silicon validation, and packaging are provided by [Vontra](https://huggingface.co/Vontra).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  - 4-bit
27
  ---
28
 
29
+
30
  <p align="center">
31
  <img src="https://img.shields.io/badge/NVIDIA-Nemotron-76B900?style=for-the-badge&logo=nvidia&logoColor=white" alt="NVIDIA Nemotron">
32
  <img src="https://img.shields.io/badge/Apple_Silicon-MLX-000000?style=for-the-badge&logo=apple&logoColor=white" alt="Apple silicon MLX">
33
  <img src="https://img.shields.io/badge/Vontra-oMLX-6E56CF?style=for-the-badge&logo=huggingface&logoColor=white" alt="Vontra oMLX">
34
  </p>
35
 
36
+
37
  <h1 align="center">NVIDIA Nemotron 3.5 Lightning 30B-A3B — MLX 4-bit</h1>
38
 
39
+
40
  <p align="center">
41
  A native Apple-silicon conversion of <a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16</a>, quantized with stock 4-bit affine weights and packaged for MLX-LM and oMLX.
42
  </p>
43
 
44
+
45
  <p align="center">
46
  <a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16">Original model</a> ·
47
  <a href="https://developer.nvidia.com/nemotron">NVIDIA Nemotron</a> ·
 
49
  <a href="https://openmdw.ai/license/1-1/">OpenMDW 1.1 license</a>
50
  </p>
51
 
52
+
53
  ## About this conversion
54
 
55
+
56
  This repository contains a stock 4-bit affine MLX conversion of NVIDIA Nemotron 3.5 Lightning. The source is a 30B-total / 3B-active hybrid mixture-of-experts model that interleaves Mamba-2, sparse MoE, and attention layers. The upstream tokenizer, chat template, and generation configuration are preserved.
57
 
58
+
59
  | Item | Value |
60
  | --- | --- |
61
  | Base model | [`nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16`](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16) |
 
67
  | Maximum configured context | 262,144 tokens |
68
  | Architecture | `nemotron_h` — Mamba-2 + sparse MoE + attention |
69
 
70
+
71
  > [!NOTE] MLX-LM reported an effective precision of 4.503 bits per weight.
72
 
73
+
74
  ## Apple-silicon performance
75
 
76
+
77
  This checkpoint was load-tested and generation-tested on the following machine:
78
 
79
+
80
  | Hardware | Configuration |
81
  | --- | --- |
82
  | Host | Mac Studio |
 
85
  | Unified memory | 256 GB |
86
  | Runtime | MLX-LM 0.31.3 / MLX 0.32.0 |
87
 
88
+
89
  A warmed local test produced:
90
 
91
+
92
  | Measurement | Result |
93
  | --- | ---: |
94
  | Decode (median) | **168.41 tokens/s** |
 
97
  | Warm-up | 32 generated tokens |
98
  | Prompt | 36 tokens after chat templating |
99
 
100
+
101
  The decode figure is the median of three greedy 256-token runs after a 32-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 MLX/oMLX versions can materially change performance.
102
 
103
+
104
  ## Quick start with MLX-LM
105
 
106
+
107
  Install recent MLX-LM and Hugging Face tooling:
108
 
109
+
110
  ```bash
111
  python -m pip install -U mlx-lm huggingface_hub
112
  ```
113
 
114
+
115
  Run directly from the Hub:
116
 
117
+
118
  ```bash
119
  mlx_lm.generate \
120
  --model Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
 
124
  --top-p 0.95
125
  ```
126
 
127
+
128
  Reasoning mode is enabled by the upstream chat template by default. To disable it:
129
 
130
+
131
  ```bash
132
  mlx_lm.generate \
133
  --model Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
 
136
  --max-tokens 256
137
  ```
138
 
139
+
140
  Python usage:
141
 
142
+
143
  ```python
144
  from mlx_lm import load, generate
145
 
146
+
147
  model, tokenizer = load("Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit")
148
  messages = [
149
  {"role": "user", "content": "Explain sparse mixture-of-experts routing."}
 
157
  print(generate(model, tokenizer, prompt=prompt, max_tokens=512))
158
  ```
159
 
160
+
161
  To download the repository first:
162
 
163
+
164
  ```bash
165
  hf download Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit \
166
  --local-dir ~/.omlx/models/Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit
167
  ```
168
 
169
+
170
  ## Using it with oMLX
171
 
172
+
173
  1. Place the downloaded model at `~/.omlx/models/Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit`.
174
  2. Refresh the oMLX model registry.
175
  3. Load `NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit` and use the normal chat UI or OpenAI-compatible endpoint.
176
 
177
+
178
  Example request:
179
 
180
+
181
  ```bash
182
  curl http://localhost:8000/v1/chat/completions \
183
  -H "Content-Type: application/json" \
 
191
  }'
192
  ```
193
 
194
+
195
  For long prompts, begin with a conservative context limit and increase it while watching memory pressure. The configured 256K context is a model capability, not a guarantee that every host can prefill that context within its available unified memory.
196
 
197
+
198
  ## Architecture
199
 
200
+
201
  Nemotron 3.5 Lightning is a hybrid sparse model designed for efficient agentic and reasoning workloads.
202
 
203
+
204
  | Architecture detail | Upstream value |
205
  | --- | ---: |
206
  | Total / active parameters | 30B / 3B |
 
213
  | Vocabulary size | 131,072 |
214
  | Configured context | 262,144 tokens |
215
 
216
+
217
  The upstream release is intended for coding, tool use, reasoning, research, and customization. For NVIDIA's evaluations, deployment guidance, intended use, limitations, safety information, and full architecture discussion, see the [original model card](https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16).
218
 
219
+
220
  ## Conversion and validation notes
221
 
222
+
223
  - Source weights: NVIDIA's BF16 checkpoint.
224
  - Quantization group size: 64.
225
  - Quantization mode: affine.
 
228
  - The model was loaded and exercised through end-to-end generation on Apple silicon.
229
  - Quantization can reduce output quality relative to BF16; use a higher-precision variant when quality matters more than memory use.
230
 
231
+
232
  This is a community conversion, not an official NVIDIA release. Validate quality and numerical behavior on your own representative workload before production use.
233
 
234
+
235
  ## License and attribution
236
 
237
+
238
  The upstream model is released under the **OpenMDW License Agreement, version 1.1**. A copy is included in this repository; review it before use or redistribution.
239
 
240
+
241
  All model design, training, benchmark, and upstream documentation credit belongs to NVIDIA and the original contributors. The MLX conversion, Apple-silicon validation, and packaging are provided by [Vontra](https://huggingface.co/Vontra).
242
+
243
+
244
+
245
+ <!-- vontra-chooser-start -->
246
+ ## Choose for your Mac
247
+
248
+ [64GB Macs](https://huggingface.co/collections/Vontra/mlx-models-for-64gb-macs-6a9fefda17932216ec9ab457) · [128GB Macs](https://huggingface.co/collections/Vontra/mlx-models-for-128gb-macs-6a9ff0abd31bc9abbe7922d7) · [256GB Macs](https://huggingface.co/collections/Vontra/mlx-models-for-256gb-macs-6a9ff0ef9fed7c5bdca15e9b)
249
+
250
+ Published peak memory: **17.95 GB**; estimated starting tier: **64GB**, leaving about **46 GB** nominal headroom. The collections use published M3 Studio peaks with at least 25% nominal headroom; fit on other Macs is an estimate, and full context is not guaranteed. Start with short context and one request.
251
+
252
+ ### Runtime and evidence
253
+
254
+ The exact tested oMLX application version is not recorded here; a library version is not an app version. The original performance tables retain their benchmark conditions and speed figures; this documentation update adds no new test results.
255
+
256
+ ### Quick start and demo prompt
257
+
258
+ ```bash
259
+ hf download Vontra/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit --local-dir ./models/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit
260
+ ```
261
+
262
+ Add the downloaded folder to oMLX model directories, refresh the list, and follow this card's architecture and MTP compatibility requirements before loading.
263
+
264
+ Try this in a new chat with a 128-token output limit:
265
+
266
+ ```text
267
+ Explain why the sky looks blue in three short sentences.
268
+ ```
269
+
270
+ This is a demo prompt to try, not a recorded successful run; a captured demonstration for this documentation update is not yet available.
271
+
272
+ [Follow Vontra for new Apple Silicon releases and fixes.](https://huggingface.co/Vontra)
273
+ <!-- vontra-chooser-end -->