Instructions to use Simonssb/qwen2.5-coder-32b-pcb-grpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Simonssb/qwen2.5-coder-32b-pcb-grpo with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-32B-Instruct") model = PeftModel.from_pretrained(base_model, "Simonssb/qwen2.5-coder-32b-pcb-grpo") - Transformers
How to use Simonssb/qwen2.5-coder-32b-pcb-grpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Simonssb/qwen2.5-coder-32b-pcb-grpo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Simonssb/qwen2.5-coder-32b-pcb-grpo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Simonssb/qwen2.5-coder-32b-pcb-grpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Simonssb/qwen2.5-coder-32b-pcb-grpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Simonssb/qwen2.5-coder-32b-pcb-grpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Simonssb/qwen2.5-coder-32b-pcb-grpo
- SGLang
How to use Simonssb/qwen2.5-coder-32b-pcb-grpo 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 "Simonssb/qwen2.5-coder-32b-pcb-grpo" \ --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": "Simonssb/qwen2.5-coder-32b-pcb-grpo", "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 "Simonssb/qwen2.5-coder-32b-pcb-grpo" \ --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": "Simonssb/qwen2.5-coder-32b-pcb-grpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Simonssb/qwen2.5-coder-32b-pcb-grpo with Docker Model Runner:
docker model run hf.co/Simonssb/qwen2.5-coder-32b-pcb-grpo
Simonssb/qwen2.5-coder-32b-pcb-grpo
A LoRA adapter (r=32, alpha=64) fine-tuned on Qwen/Qwen2.5-Coder-32B-Instruct via Stage-1 QLoRA SFT + Stage-2 Online GRPO to act as an AI KiCad PCB Architectural Planner & Routing Strategist.
Given a compact netlist and footprint geometry summary (board_context.md), the model predicts:
groups(groups.json): 1-IC-per-group functional partitioning (core,power,interface), anchor selection, andnearadjacency hints.routing_strategy(routing_strategy.json): Ground/split-plane pours (ground_plane_nets), EMIkeep_away_rules,power_width_tiers, laminarbus_routing,placer_channel_reservation, andvia_and_trace_rules.
Designed to drive deterministic placement and Rust A* autorouting via drandyhaas/KiCadRoutingTools.
Training Summary (v7_full)
- Base Model:
Qwen/Qwen2.5-Coder-32B-Instruct - Dataset:
254physics-verified KiCad boards (393raw trajectories ->245curated high-purity SFT examples:214train /31val;274GRPO prompts). - Stage-1 QLoRA SFT:
2epochs,lr=8e-5,max_seq_length=16384->train_loss=0.1511,eval_loss=0.1767,eval_mean_token_accuracy=94.93%. - Stage-2 Online GRPO: Multi-sample (
G=4) physics rollouts graded by 100% routed connectivity (blocking=0), via/copper efficiency, and a 19-point hardware quality rubric (slalom avoidance, via-in-pad, layer weaving, hot-loop length, decoupling proximity, channel symmetry, and power width compliance) ->train_loss=0.0820.
Benchmark Results
- Held-Out Unseen Blind Validation (
10 / 10boards):- 100% Valid JSON Schema (
10 / 10) - 100%
blocking = 0(10 / 10) including0.5 mmpitchLQFP-48,QFN-20RF modules, andESP32/USB-Cboards.
- 100% Valid JSON Schema (
- Hydroponics Production-Finish Benchmark (
AI_Hydro_Controller&HydroPCB, ~84β104 movable parts):AI_Hydro_Controller:0KiCad DRC errors,0unconnected nets,91vias /1741.31 mmcopper (vs.129vias /2378.91 mmhuman reference).HydroPCB:0blocking (vs.2blocking human placement ceiling),0unconnected nets,77vias (vs.112human reference),0via-in-pad.
Quickstart (transformers + peft)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_id = "Qwen/Qwen2.5-Coder-32B-Instruct"
adapter_id = "Simonssb/qwen2.5-coder-32b-pcb-grpo"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
- Downloads last month
- 66
Model tree for Simonssb/qwen2.5-coder-32b-pcb-grpo
Base model
Qwen/Qwen2.5-32B Finetuned
Qwen/Qwen2.5-Coder-32B Finetuned
Qwen/Qwen2.5-Coder-32B-Instruct