Instructions to use hkust-aaron/EdgeRock-4B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hkust-aaron/EdgeRock-4B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hkust-aaron/EdgeRock-4B-NVFP4", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("hkust-aaron/EdgeRock-4B-NVFP4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hkust-aaron/EdgeRock-4B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hkust-aaron/EdgeRock-4B-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hkust-aaron/EdgeRock-4B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hkust-aaron/EdgeRock-4B-NVFP4
- SGLang
How to use hkust-aaron/EdgeRock-4B-NVFP4 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 "hkust-aaron/EdgeRock-4B-NVFP4" \ --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": "hkust-aaron/EdgeRock-4B-NVFP4", "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 "hkust-aaron/EdgeRock-4B-NVFP4" \ --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": "hkust-aaron/EdgeRock-4B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hkust-aaron/EdgeRock-4B-NVFP4 with Docker Model Runner:
docker model run hf.co/hkust-aaron/EdgeRock-4B-NVFP4
EdgeRock-4B-NVFP4
EdgeRock's constant-memory reasoning architecture with packed NVFP4 weights.
This text checkpoint uses NVIDIA Model Optimizer's W4A16 NVFP4 format: E2M1 4-bit weights, one FP8 E4M3 scale per 16 values, and an FP32 global scale per matrix. Activations use BF16. The 256 large backbone and RMA linear matrices are quantized; the tied embedding/output head, admission networks, small recurrent gates, and normalization parameters retain their source precision. History capacities and RMA update rules are preserved.
Source: rockmatrix-ai/EdgeRock@a6a53a5573f1. See the EdgeRock project for the architecture, technical report, and visual frontend.
Package and validation
| Item | Result |
|---|---|
| Packed checkpoint size | 3.504 GB |
| BF16 source checkpoint size | 9.156 GB |
| Weight-file reduction | 61.7% |
| Matrices matching NVIDIA Model Optimizer's decoder exactly | 256/256 |
| Unquantized tensors matching the source exactly | 290 |
| Arithmetic and long-context memory smoke checks | 3/3 |
| Fresh-process reload: maximum probe-logit difference | 0 |
The Safetensors checkpoint contains packed 4-bit data and scales. validation.json records prompts, generated answers, and test settings. These conversion checks do not replace the source model's full benchmark evaluation.
Load on a CUDA GPU
The included reference loader expands NVFP4 weights to BF16 once during loading and executes EdgeRock's original architecture. File size is therefore smaller than runtime weight memory. This path was validated on a Hopper GPU; it does not benchmark native FP4 kernels or establish Blackwell runtime compatibility for EdgeRock's custom RMA layers.
python -m pip install -r requirements.txt
import sys
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
folder = snapshot_download("hkust-aaron/EdgeRock-4B-NVFP4")
sys.path.insert(0, folder)
from load_nvfp4 import load_nvfp4
tokenizer = AutoTokenizer.from_pretrained(folder, trust_remote_code=True)
model = load_nvfp4(folder)
text = tokenizer.apply_chat_template(
[{"role": "user", "content": "Calculate 17 * 23. Give only the answer."}],
tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to("cuda")
output = model.generate(**inputs, max_new_tokens=2048, do_sample=False)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
Use the included loader for this validated reference path. Generic AutoModelForCausalLM.from_pretrained runtime support for EdgeRock's NVFP4 checkpoint has not been validated.
Reproduce the conversion
Download the pinned source revision and run the included converter on a CUDA GPU:
python quantize.py --source /path/to/EdgeRock --output /path/to/EdgeRock-4B-NVFP4
The converter uses Model Optimizer 0.47.0's W4A16_NVFP4_CFG and export_hf_checkpoint. nvfp4_config.json lists quantized modules; hf_quant_config.json retains the official export configuration. Source revision, file hashes, and package versions are recorded in provenance.json.
License
Weights retain the EdgeRock Model License 1.0; code retains Apache-2.0. See NOTICE for source notices. Changes comprise NVFP4 weight quantization, conversion and reference-loading scripts, and packaged generation settings.
- Downloads last month
- 21
Model tree for hkust-aaron/EdgeRock-4B-NVFP4
Base model
rockmatrix-ai/EdgeRock