Microsoft NextCoder-32B is built on Qwen2.5-Coder-32B-Instruct and fine-tuned using SeleKT (Selective Knowledge Transfer) methodology:
1# Original (buggy):
2def find_max(numbers):
3 max = 0
4 for i in range(len(numbers))
5 if numbers[i] > max
6 max = numbers[i]
7 return max
8
9# Fixed - Found 3 bugs:
10# 1. Initialization to 0 (fails for negative numbers)
11# 2. Missing colon after if statement
12# 3. No empty list handling
1# Before:
2def get_even_squares(n):
3 result = []
4 for i in range(n):
5 if i % 2 == 0:
6 result.append(i ** 2)
7 return result
8
9# After:
10def get_even_squares(n):
11 return [i ** 2 for i in range(n) if i % 2 == 0]
1from gptqmodel import GPTQModel
2from transformers import AutoTokenizer
3
4model = GPTQModel.from_quantized(
5 "TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
6 device_map="auto",
7 trust_remote_code=True,
8)
9tokenizer = AutoTokenizer.from_pretrained(
10 "TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
11 trust_remote_code=True
12)
13
14# Code editing example
15prompt = """Fix the following function to handle edge cases:
16
17def divide(a, b):
18 returm a/b
19"""
20
21messages = [{"role": "user", "content": prompt}]
22
23text = tokenizer.apply_chat_template(
24 messages,
25 tokenize=False,
26 add_generation_prompt=True,
27)
28inputs = tokenizer([text], return_tensors="pt").to(model.device)
29
30outputs = model.generate(
31 **inputs,
32 max_new_tokens=1024,
33 temperature=0.7,
34 top_p=0.9,
35 do_sample=True,
36)
37print(tokenizer.decode(outputs[0], skip_special_tokens=True))
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained(
4 "TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
5 device_map="auto",
6 trust_remote_code=True
7)
8tokenizer = AutoTokenizer.from_pretrained(
9 "TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
10 trust_remote_code=True
11)
12
13# Use same generation code as above
1pip install -U "vllm>=0.12.0"
2
3vllm serve TevunahAi/NextCoder-32B-TevunahAi-GPTQ \
4 --max-num-seqs 8 \
5 --tensor-parallel-size 1 \
6 --max-model-len 8192 \
7 --trust-remote-code
1from transformers import AutoModelForCausalLM
2import torch
3
4# Distribute across multiple GPUs
5model = AutoModelForCausalLM.from_pretrained(
6 "TevunahAi/NextCoder-32B-TevunahAi-GPTQ",
7 device_map="auto",
8 torch_dtype=torch.float16,
9 trust_remote_code=True
10)
1messages = [{"role": "user", "content": """
2Fix the off-by-one error in this loop:
3for i in range(len(arr)):
4 print(arr[i+1])
5"""}]
1messages = [{"role": "user", "content": """
2Refactor this function to use list comprehension:
3def squares(n):
4 result = []
5 for i in range(n):
6 result.append(i**2)
7 return result
8"""}]
1messages = [{"role": "user", "content": """
2Complete this function to implement binary search:
3def binary_search(arr, target):
4 left, right = 0, len(arr) - 1
5"""}]
1messages = [{"role": "user", "content": """
2Add proper error handling to this function:
3def divide(a, b):
4 return a / b
5"""}]
1@software{nextcoder_32b_gptq_2025,
2 title = {Microsoft NextCoder-32B - TevunahAi Ultra-Hybrid GPTQ with EoRA},
3 author = {TevunahAi},
4 year = {2025},
5 note = {Ultra-Hybrid GPTQ with EoRA for code editing quality retention},
6 url = {https://huggingface.co/TevunahAi/NextCoder-32B-TevunahAi-GPTQ}
7}
8
9@misc{nextcoder2024,
10 title = {NextCoder: Advancing Code Editing via Selective Knowledge Transfer},
11 author = {Microsoft},
12 year = {2024},
13 url = {https://huggingface.co/microsoft/NextCoder-32B}
14}