Text Generation
Transformers
Safetensors
nemotron_h
nemotron-h
mixture-of-experts
Mixture of Experts
pruning
reap
expert-pruning
conversational
custom_code
Instructions to use sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e
- SGLang
How to use sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e 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 "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e" \ --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": "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", "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 "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e" \ --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": "sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e with Docker Model Runner:
docker model run hf.co/sapidlabs/Nemotron-3-Nano-30B-A3B-REAP-64e
| cluster_args: | |
| cluster_description: null | |
| cluster_method: agglomerative | |
| compression_ratio: 0.5 | |
| expert_sim: ttm | |
| frequency_penalty: true | |
| linkage_method: average | |
| max_cluster_size: null | |
| multi_layer: null | |
| num_clusters: null | |
| singleton_outlier_experts: false | |
| singleton_super_experts: false | |
| softmax_temperature: null | |
| ds_args: | |
| dataset_config_name: null | |
| dataset_name: theblackcat102/evol-codealpaca-v1:256 | |
| dataset_test_split: test | |
| shuffle: true | |
| split: train | |
| eval_args: | |
| evalplus_tasks: | |
| - mbpp | |
| - humaneval | |
| greedy: true | |
| lm_eval_tasks: | |
| - winogrande | |
| - arc_challenge | |
| - arc_easy | |
| - boolq | |
| - hellaswag | |
| - mmlu | |
| - openbookqa | |
| - rte | |
| min_p: 0.0 | |
| parallel_tasks: 32 | |
| results_dir: /home/joemuller/reap-out/nemotron-nano | |
| run_evalplus: true | |
| run_livecodebench: true | |
| run_lm_eval: true | |
| run_math: false | |
| run_wildbench: false | |
| server_log_file_name: server.log | |
| temperature: 0.7 | |
| top_k: 20 | |
| top_p: 0.8 | |
| use_server: true | |
| vllm_port: 8000 | |
| layerwise_args: | |
| batch_group_size: null | |
| low_cpu_mem_usage: true | |
| save_intermediate: false | |
| model_args: | |
| model_name: /home/joemuller/models/hf/Nemotron-3-Nano-30B-A3B-BF16 | |
| num_experts_per_tok_override: null | |
| obs_args: | |
| batch_size: 1 | |
| batches_per_category: 1024 | |
| distance_measure: angular | |
| model_max_length: 512 | |
| output_file_name: observations_1024_cosine.pt | |
| overwrite_observations: false | |
| record_pruning_metrics_only: false | |
| renormalize_router_weights: true | |
| return_vllm_tokens_prompt: false | |
| select_only_categories: null | |
| split_by_category: false | |
| truncate: false | |
| prune_args: | |
| n_experts_to_prune: null | |
| overwrite_pruned_model: false | |
| perserve_outliers: false | |
| perserve_super_experts: false | |
| prune_method: reap | |
| reap_args: | |
| debug: false | |
| do_eval: true | |
| plot_clusters: true | |
| profile: true | |
| run_observer_only: false | |
| seed: 42 | |
| smoke_test: true | |