Ultra Quantization Hybrid Model.
Collection
These models are quantized in mixed precision that allows them to have a smaller footprint than fp8, but still high quality. • 15 items • Updated • 1
| Property | Value |
|---|---|
| Base Model | microsoft/NextCoder-32B |
| Architecture | Qwen2.5-based Transformer (64 layers) |
| Parameters | 32.5B (31.0B non-embedding) |
| Context Length | 32,768 tokens |
| Specialization | Code editing tasks (+44% improvement) |
| Quantization | TevunahAi Ultra-Hybrid GPTQ + EoRA |
| Original Size | ~65 GB (BF16) |
| Quantized Size | ~22-24 GB |
| Compression | ~65% reduction |
| Active VRAM | ~23.6 GB (with inference overhead) |
| License | MIT |
Microsoft NextCoder-32B is built on Qwen2.5-Coder-32B-Instruct and fine-tuned using SeleKT (Selective Knowledge Transfer) methodology:
This quantization uses EoRA (Error-optimized Low-Rank Adaptation) - NVIDIA's technique for recovering quantization error through learned low-rank adapters applied during the quantization process.
| Component | Precision | EoRA Rank | Rationale |
|---|---|---|---|
| Attention Q proj (all 64 layers) | INT8 | 128 | Critical for code understanding |
| Attention K proj (all 64 layers) | INT8 | 128 | Key matching precision |
| Attention V proj (all 64 layers) | INT8 | 128 | Value preservation |
| Attention O proj (all 64 layers) | INT8 | 128 | Output quality |
| MLP gate/up/down (layers 0-53) | INT4 | 64 | Maximum compression in early/middle layers |
| MLP gate/up/down (layers 54-63) | INT8 | 64 | Higher precision near output |
| Embeddings | FP16 | - | Preserved for 152K vocab accuracy |
| LM Head | FP16 | - | Preserved for output quality |
| Test | Result | Details |
|---|---|---|
| Basic Code Generation | ✅ PASS | Clean function with docstring |
| Bug Fixing | ✅ PASS | Found all bugs, explained each fix |
| Code Refactoring | ✅ PASS | Clean list comprehension conversion |
| Code Completion | ✅ PASS | Binary search - 5/5 elements |
| Code Explanation | ✅ PASS | Memoization - 6/7 keywords |
| JavaScript Generation | ✅ PASS | Both verbose and concise versions |
| Error Handling | ✅ PASS | 7/7 patterns (try/except/TypeError/ZeroDivision) |
| Algorithm Implementation | ✅ PASS | Quicksort with detailed comments |
| Task | Score | Metric | Stderr |
|---|---|---|---|
| Winogrande | 80.00% | acc | ±4.02% |
| TruthfulQA MC2 | 70.43% | acc | ±4.29% |
| HellaSwag | 68.00% | acc_norm | ±4.69% |
| ARC-Challenge | 52.00% | acc_norm | ±5.02% |
Quick test with 100 samples per task.
| Metric | Value |
|---|---|
| VRAM Usage | 23.62 GB |
| Generation Speed | 14-16 tok/s |
| Load Time | ~112 seconds |
| Tests Passed | 8/8 |
Bug Fixing - Identified and fixed all issues:
# Original (buggy):
def find_max(numbers):
max = 0
for i in range(len(numbers))
if numbers[i] > max
max = numbers[i]
return max
# Fixed - Found 3 bugs:
# 1. Initialization to 0 (fails for negative numbers)
# 2. Missing colon after if statement
# 3. No empty list handling
Refactoring - Clean list comprehension:
# Before:
def get_even_squares(n):
result = []
for i in range(n):
if i % 2 == 0:
result.append(i ** 2)
return result
# After:
def get_even_squares(n):
return [i ** 2 for i in range(n) if i % 2 == 0]
from gptqmodel import GPTQModel
from transformers import AutoTokenizer
model = GPTQModel.from_quantized(
"TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
trust_remote_code=True
)
# Code editing example
prompt = """Fix the following function to handle edge cases:
def divide(a, b):
returm a/b
"""
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
trust_remote_code=True
)
# Use same generation code as above
pip install -U "vllm>=0.12.0"
vllm serve TevunahAi/NextCoder-32B-TevunahAi-GPTQ \
--max-num-seqs 8 \
--tensor-parallel-size 1 \
--max-model-len 8192 \
--trust-remote-code
from transformers import AutoModelForCausalLM
import torch
# Distribute across multiple GPUs
model = AutoModelForCausalLM.from_pretrained(
"TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
device_map="auto",
torch_dtype=torch.float16,
trust_remote_code=True
)
pip install gptqmodel transformers>=4.48
NextCoder-32B excels at specialized code tasks:
messages = [{"role": "user", "content": """
Fix the off-by-one error in this loop:
for i in range(len(arr)):
print(arr[i+1])
"""}]
messages = [{"role": "user", "content": """
Refactor this function to use list comprehension:
def squares(n):
result = []
for i in range(n):
result.append(i**2)
return result
"""}]
messages = [{"role": "user", "content": """
Complete this function to implement binary search:
def binary_search(arr, target):
left, right = 0, len(arr) - 1
"""}]
messages = [{"role": "user", "content": """
Add proper error handling to this function:
def divide(a, b):
return a / b
"""}]
fix_mistral_regex=True when loading tokenizer| Context Length | VRAM Required |
|---|---|
| Short (4K) | 22-24 GB |
| Medium (8K) | 24-26 GB |
| Long (16K) | 28-32 GB |
| Full (32K) | 40+ GB |
Tested on: RTX 5000 Ada (32GB) - 23.62 GB active VRAM during inference
| Specification | Value |
|---|---|
| Method | GPTQ + Ultra-Hybrid + EoRA |
| Quantizer | GPTQModel |
| EoRA Attention Rank | 128 |
| EoRA MLP Rank | 64 |
| Calibration Samples | 2,048 (8x industry standard) |
| Sequence Length | 4,096 tokens |
| Group Size | 128 |
| desc_act | False |
| sym | True (symmetric quantization) |
| Bits (default) | 4 |
| Layer Rules | 448 custom precision rules |
Ideal for:
| Specification | Value |
|---|---|
| Model Family | Microsoft NextCoder |
| Base Model | Qwen2.5-Coder-32B-Instruct |
| Fine-tuning | SeleKT (Selective Knowledge Transfer) |
| Total Parameters | 32.5B |
| Non-embedding Parameters | 31.0B |
| Total Layers | 64 |
| Hidden Size | 5,120 |
| Intermediate Size | 27,648 |
| Attention Heads | 40 |
| KV Heads | 8 (GQA) |
| Activation | SwiGLU |
| Normalization | RMSNorm |
| Position Encoding | RoPE |
| Context Length | 32,768 |
| Vocab Size | 152,064 |
| Improvement | +44% on code editing tasks |
MIT License - Permissive open source license allowing commercial use, modification, and distribution.
@software{nextcoder_32b_gptq_2025,
title = {Microsoft NextCoder-32B - TevunahAi Ultra-Hybrid GPTQ with EoRA},
author = {TevunahAi},
year = {2025},
note = {Ultra-Hybrid GPTQ with EoRA for code editing quality retention},
url = {https://huggingface.co/TevunahAi/NextCoder-32B-TevunahAi-GPTQ}
}
@misc{nextcoder2024,
title = {NextCoder: Advancing Code Editing via Selective Knowledge Transfer},
author = {Microsoft},
year = {2024},
url = {https://huggingface.co/microsoft/NextCoder-32B}
}
Base model
Qwen/Qwen2.5-32B