Text Generation
Transformers
Safetensors
MLX
English
nemotron-nas
nvidia
unsloth - llama-3 - pytorch
mlx-my-repo
conversational
custom_code
4-bit precision
Instructions to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", trust_remote_code=True, device_map="auto") - MLX
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-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("Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-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
- vLLM
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit
- SGLang
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit"
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": "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-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 "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-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": "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with Docker Model Runner:
docker model run hf.co/Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit
- Hermes Agent
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit 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 "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit"
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 Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit"
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 "Wwayu/Llama-3_3-Nemotron-Super-49B-v1_5-mlx-4Bit" \ --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"
| import dataclasses | |
| import json | |
| import warnings | |
| from dataclasses import dataclass, MISSING | |
| from functools import partial | |
| from typing import Optional, Any | |
| class JsonComparable: | |
| def to_json(self) -> str: | |
| return json.dumps(dataclasses.asdict(self)) | |
| def __eq__(self, other: "JsonComparable") -> bool: | |
| return self.to_json() == other.to_json() | |
| def __hash__(self) -> int: | |
| return hash(self.to_json()) | |
| def __lt__(self, other: "JsonComparable") -> bool: | |
| return self.to_json() < other.to_json() | |
| class SubblockConfig(JsonComparable): | |
| no_op: bool = False | |
| replace_with_linear: bool = False | |
| sparsify: Optional[list[str]] = None | |
| def __post_init__(self): | |
| assert not (self.no_op and self.replace_with_linear) | |
| def _force_setattr(self, name: str, value: Any) -> None: | |
| """ | |
| Set an attribute even in frozen dataclasses. | |
| Use only inside __post_init__! | |
| """ | |
| object.__setattr__(self, name, value) | |
| class AttentionConfig(SubblockConfig): | |
| n_heads_in_group: Optional[int] = None | |
| window_length: Optional[int] = None | |
| num_sink_tokens: Optional[int] = None | |
| use_prefill_window_in_sink_attention: bool = False | |
| unshifted_sink: bool = False | |
| def __post_init__(self): | |
| super().__post_init__() | |
| assert not (self.no_op and self.replace_with_linear) | |
| if self.no_op or self.replace_with_linear: | |
| for irrelevant_att in ["n_heads_in_group", "window_length", "num_sink_tokens"]: | |
| self._force_setattr(irrelevant_att, None) | |
| else: | |
| assert self.n_heads_in_group is not None | |
| if self.is_sink: | |
| assert not (self.unshifted_sink and self.use_prefill_window_in_sink_attention), \ | |
| ("Unshifted sink uses its own kind of explicit masking, not standard window. " | |
| "Set use_prefill_window_in_sink_attention to False.") | |
| assert not (self.num_sink_tokens == 0 and not self.unshifted_sink), \ | |
| "Fake sink attention with 0 sink tokens is only supported with unshifted_sink=True" | |
| def prefill_sliding_window(self) -> Optional[int]: | |
| if self.window_length is not None: | |
| if not self.is_sink or self.use_prefill_window_in_sink_attention: | |
| return self.window_length | |
| return None | |
| def is_sliding(self) -> bool: | |
| return self.prefill_sliding_window is not None | |
| def is_sink(self) -> bool: | |
| return ( | |
| (self.window_length is not None) | |
| and | |
| (self.num_sink_tokens is not None) | |
| ) | |
| class FFNConfig(SubblockConfig): | |
| ffn_mult: Optional[float] = None | |
| def __post_init__(self): | |
| super().__post_init__() | |
| if self.no_op or self.replace_with_linear: | |
| self._force_setattr("ffn_mult", None) | |
| else: | |
| assert self.ffn_mult is not None | |
| self._force_setattr("ffn_mult", round(self.ffn_mult, 6)) | |
| class BlockConfig(JsonComparable): | |
| attention: AttentionConfig = MISSING | |
| ffn: FFNConfig = MISSING | |
| def __post_init__(self): | |
| """ | |
| Init subblock dataclasses from dicts | |
| """ | |
| for subblock_name in dataclasses.fields(self): | |
| subblock_config = getattr(self, subblock_name.name) | |
| if isinstance(subblock_config, dict): | |
| subblock_fields = [field.name for field in dataclasses.fields(subblock_name.type)] | |
| unsupported_fields = [field_name for field_name in subblock_config.keys() | |
| if field_name not in subblock_fields] | |
| if len(unsupported_fields) > 0: | |
| warnings.warn(f"Removed unsupported fields {unsupported_fields} from {subblock_name.type.__name__}") | |
| subblock_config = {k: v for k, v in subblock_config.items() if k not in unsupported_fields} | |
| object.__setattr__(self, subblock_name.name, | |
| subblock_name.type(**subblock_config)) # __setattr__ to overcome frozen=True | |