Instructions to use mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit 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("mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit") 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
- MLX LM
How to use mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Llama-3_3-Nemotron-Super-49B-v1-mlx-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
[LM Studio]Error in iterating prediction stream: AttributeError: 'NoneType' object has no attribute 'shape'. Error Data: n/a, Additional Data: n/a
what's wrong?
Same situation here (LM Studio Version: 0.3.16 / MLX engine 0.17.0): Error in iterating prediction stream: AttributeError: 'NoneType' object has no attribute 'shape'
The bug arises because in Jinja the filter operator (|) has higher precedence than the string‐concatenation operator (+). In the faulty line:
'…' + content | trim + '…'
only content is trimmed—Jinja interprets it as:
'…' + (content | trim) + '…'
Consequently, the surrounding tokens aren’t included in the trim, and the final '<|eot_id|>' can end up misplaced.
Fix: Wrap the entire concatenated string in parentheses and then apply | trim. For example:
( '<|start_header_id|>' + message.role + '<|end_header_id|>\n\n' + content + '<|eot_id|>' ) | trim
This ensures Jinja first builds the full string (header, role, content, footer) and only then removes leading/trailing whitespace.
I'm also facing the same error, but wasn't able to fix it following your explanation above. Could you please share the complete (correct) ninja template?
Hi!
We’ve struggled a lot with Nemotron Ultra conversion and inference settings adjustments but we succeed.
Try to modify the modified jinja template and a tokenizer config files adjustment we did in ours https://huggingface.co/LibraxisAI/Llama-3_1-Nemotron-Ultra-253B-v1-MLX-Q5.
If you have any questions I am open to help.
Maciej
I set up the code in the linked chat_template.jinja in lm studio, but I get a parse error!
Can someone please share the complete jinja code available in lm studio?