Instructions to use nvidia/Nemotron-Flash-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Nemotron-Flash-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/Nemotron-Flash-3B-Instruct", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("nvidia/Nemotron-Flash-3B-Instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use nvidia/Nemotron-Flash-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Nemotron-Flash-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-Flash-3B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nvidia/Nemotron-Flash-3B-Instruct
- SGLang
How to use nvidia/Nemotron-Flash-3B-Instruct 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 "nvidia/Nemotron-Flash-3B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-Flash-3B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "nvidia/Nemotron-Flash-3B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-Flash-3B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nvidia/Nemotron-Flash-3B-Instruct with Docker Model Runner:
docker model run hf.co/nvidia/Nemotron-Flash-3B-Instruct
| { | |
| "architectures": [ | |
| "NemotronFlashForCausalLM" | |
| ], | |
| "attention_dropout": 0.0, | |
| "attn_hidden_size": -1, | |
| "attn_implementation": "fused_mha", | |
| "attn_implementation_new": "fused_mha", | |
| "auto_map": { | |
| "AutoConfig": "configuration_nemotron_flash.NemotronFlashConfig", | |
| "AutoModelForCausalLM": "modeling_nemotron_flash.NemotronFlashForCausalLM" | |
| }, | |
| "bos_token_id": 1, | |
| "calc_logits_for_entire_prompt": false, | |
| "d_conv": 4, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 2, | |
| "ffn_expand_ratio": 3, | |
| "global_attn_idx": [], | |
| "hidden_act": "silu", | |
| "hidden_size": 3072, | |
| "hybrid_decoder_layer": "mamba", | |
| "initializer_range": 0.02, | |
| "intermediate_size": 0, | |
| "kq_head_dim": -1, | |
| "kq_norm": "none", | |
| "layer_type": [ | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "a", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "a", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "a", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a", | |
| "m", | |
| "a" | |
| ], | |
| "layer_types": [ | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f", | |
| "a", | |
| "f", | |
| "m2", | |
| "f", | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f", | |
| "a", | |
| "f", | |
| "m2", | |
| "f", | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f", | |
| "a", | |
| "f", | |
| "m2", | |
| "f", | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f", | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f", | |
| "deltanet", | |
| "f", | |
| "m2", | |
| "f" | |
| ], | |
| "mamba2_headdim": 64, | |
| "mamba_conv_bias": true, | |
| "mamba_d_conv": 4, | |
| "mamba_d_state": 128, | |
| "mamba_dt_rank": 192, | |
| "mamba_expand": 2, | |
| "mamba_inner_layernorms": true, | |
| "mamba_proj_bias": false, | |
| "max_position_embeddings": 29000, | |
| "mlp_hidden_act": "silu", | |
| "model_type": "nemotron_flash", | |
| "new_seq_length": 2048, | |
| "num_attention_heads": 24, | |
| "num_experts": 1, | |
| "num_experts_per_tok": 1, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 6, | |
| "num_memory_tokens": 256, | |
| "orig_max_position_embeddings": 4096, | |
| "output_router_logits": false, | |
| "pad_token_id": 0, | |
| "rms_norm_eps": 1e-06, | |
| "rope": true, | |
| "rope_theta": 10000.0, | |
| "rope_type": "ntk", | |
| "router_aux_loss_coef": 0.001, | |
| "sliding_window": null, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "4.56.2", | |
| "use_cache": false, | |
| "use_mamba_kernels": true, | |
| "v_head_dim": -1, | |
| "vocab_size": 131075 | |
| } | |