Text Generation
Transformers
Safetensors
English
Chinese
qwen3_5_text
veriloop
veriloop-coder
code
coding-agent
software-engineering
mathematical-reasoning
nvfp4
modelopt
tensorrt-llm
vllm
sglang
code-optimized
quantization
open-source
apache-2.0
qwen3_5
self-harness
harness-engineering
surface-host-adapter
evidence-binding
rollback
uncertainty-calibration
long-context
vertical-code-model
recursive-improvement
conversational
Instructions to use rodrigoramosrs/veriloop-coder-e2-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rodrigoramosrs/veriloop-coder-e2-nvfp4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rodrigoramosrs/veriloop-coder-e2-nvfp4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rodrigoramosrs/veriloop-coder-e2-nvfp4") model = AutoModelForCausalLM.from_pretrained("rodrigoramosrs/veriloop-coder-e2-nvfp4", 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 rodrigoramosrs/veriloop-coder-e2-nvfp4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rodrigoramosrs/veriloop-coder-e2-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": "rodrigoramosrs/veriloop-coder-e2-nvfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rodrigoramosrs/veriloop-coder-e2-nvfp4
- SGLang
How to use rodrigoramosrs/veriloop-coder-e2-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 "rodrigoramosrs/veriloop-coder-e2-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": "rodrigoramosrs/veriloop-coder-e2-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 "rodrigoramosrs/veriloop-coder-e2-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": "rodrigoramosrs/veriloop-coder-e2-nvfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rodrigoramosrs/veriloop-coder-e2-nvfp4 with Docker Model Runner:
docker model run hf.co/rodrigoramosrs/veriloop-coder-e2-nvfp4
Upload scripts/quantize_veriloop.py with huggingface_hub
Browse files- scripts/quantize_veriloop.py +19 -10
scripts/quantize_veriloop.py
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
"""NVFP4 W4A4 quantization for VeriLoop-E2 (Qwen3.8-27B based).
|
| 2 |
|
| 3 |
-
Uses NVIDIA Model Optimizer's canonical recipe
|
| 4 |
-
NVFP4_W4A4_WEIGHT_LOCAL_HESSIAN_CFG
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
Calibration: nvidia/Nemotron-Competitive-Programming-v1 (streaming), defaults
|
| 8 |
512 samples x 512 tokens (262144 tokens total).
|
|
@@ -93,13 +95,20 @@ def build_device_map():
|
|
| 93 |
|
| 94 |
|
| 95 |
def build_quant_cfg():
|
| 96 |
-
# NVIDIA canonical recipe
|
| 97 |
-
#
|
| 98 |
-
#
|
| 99 |
-
#
|
| 100 |
-
#
|
| 101 |
-
#
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
def messages_to_text(messages):
|
|
|
|
| 1 |
"""NVFP4 W4A4 quantization for VeriLoop-E2 (Qwen3.8-27B based).
|
| 2 |
|
| 3 |
+
Uses NVIDIA Model Optimizer's canonical recipe
|
| 4 |
+
(NVFP4_W4A4_WEIGHT_LOCAL_HESSIAN_CFG: local Hessian + fp8 scale sweep,
|
| 5 |
+
static weight scales + dynamic input scales) with linear_attn blocks and
|
| 6 |
+
self-attention projections kept in BF16, matching validated NVFP4
|
| 7 |
+
releases for this architecture family.
|
| 8 |
|
| 9 |
Calibration: nvidia/Nemotron-Competitive-Programming-v1 (streaming), defaults
|
| 10 |
512 samples x 512 tokens (262144 tokens total).
|
|
|
|
| 95 |
|
| 96 |
|
| 97 |
def build_quant_cfg():
|
| 98 |
+
# NVIDIA canonical recipe + granularity adjustments: linear_attn (GDN)
|
| 99 |
+
# fully BF16 plus BF16 self-attention, matching validated NVFP4 releases
|
| 100 |
+
# for this architecture family (MLP-only NVFP4). NVFP4 attention/GDN
|
| 101 |
+
# weights produce degenerate output on some stacks; MLP-only is the
|
| 102 |
+
# widely-deployed pattern (conv1d/in_proj_a/in_proj_b already disabled
|
| 103 |
+
# in the base recipe). Appended last: entries apply in list order,
|
| 104 |
+
# later overrides earlier.
|
| 105 |
+
cfg = copy.deepcopy(mtq.NVFP4_W4A4_WEIGHT_LOCAL_HESSIAN_CFG)
|
| 106 |
+
for name in ["*linear_attn.in_proj_qkv*", "*linear_attn.in_proj_z*",
|
| 107 |
+
"*linear_attn.out_proj*",
|
| 108 |
+
"*self_attn.q_proj*", "*self_attn.k_proj*",
|
| 109 |
+
"*self_attn.v_proj*", "*self_attn.o_proj*"]:
|
| 110 |
+
cfg["quant_cfg"].append({"quantizer_name": name, "enable": False})
|
| 111 |
+
return cfg
|
| 112 |
|
| 113 |
|
| 114 |
def messages_to_text(messages):
|