Base model
32B

Qwen2.5-Coder-32B-Instruct, 4-bit NF4 during training

Training pairs
3,296

Instruction/response pairs from schema, docs, and shipped examples — 199 held out

LoRA rank
64

α=128, dropout 0.05, on all linear projections

Solver target
v0.14.0

Palace schema version the adapter is trained against

Configs that the solver accepts

General code models handle Palace's format poorly because it is niche and its constraints are unforgiving. Palace-LoRA does two jobs, both ending in JSON the solver will take.

Authoring

Write a complete Palace JSON config from a natural-language description of the problem — electrostatic, magnetostatic, or driven electromagnetics — including mesh references, terminals, and domains.

Repair

Given a broken config, fix schema violations, wrong types, invalid enums, dangling mesh references, and missing required sections — targeted edits, not a rewrite.

Why a specialist

Palace's schema vocabulary and idioms are barely represented in general training data. The adapter closes exactly that gap — the base model keeps doing everything else it already does.

Drop it on the base model

Load the adapter with PEFT, or serve it as a named LoRA module with vLLM — no merged weights to host.

Transformers + PEFT python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

BASE    = "Qwen/Qwen2.5-Coder-32B-Instruct"
ADAPTER = "rwmasood/Qwen2.5-Coder-32B-Palace-LoRA"

tok   = AutoTokenizer.from_pretrained(ADAPTER)
model = AutoModelForCausalLM.from_pretrained(
    BASE, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER)

messages = [
  {"role": "system",
   "content": "You write and repair Palace configuration files."},
  {"role": "user",
   "content": "Write a Palace electrostatic configuration that "
              "computes the capacitance of a parallel-plate "
              "capacitor. Mesh: mesh/plate.msh, one terminal on "
              "attribute 3, ground on attribute 4, vacuum domain "
              "on attribute 1."},
]
Serving with vLLM bash
vllm serve Qwen/Qwen2.5-Coder-32B-Instruct \
  --enable-lora \
  --lora-modules \
    palace=rwmasood/Qwen2.5-Coder-32B-Palace-LoRA \
  --max-lora-rank 64

# then request model name "palace"

How we built it

Same recipe as every Chaperone build: a proven base, data derived from the domain's own ground truth, and an adaptation that leaves the base's general skills intact.

1
A proven code base

Qwen2.5-Coder-32B-Instruct brings general coding and JSON fluency — we only need to teach it one solver's dialect.

2
Data from ground truth

3,296 instruction/response pairs derived from Palace's JSON schema, documentation, and shipped example configs — rendered into authoring and targeted-repair tasks.

3
QLoRA adaptation

4-bit NF4 base, LoRA rank 64, α=128, dropout 0.05 on all linear projections. ChatML template, loss on responses only.

4
A disciplined schedule

3 epochs at sequence length 8192, effective batch 16, LR 1e-4 cosine, paged AdamW-8bit, bf16. PEFT + Axolotl + Transformers.

Who it is for

Engineers and researchers running Palace who spend real time hand-writing or debugging solver configs — outputs are JSON meant for the solver, not prose.

Where it shines

Schema-exact authoring from a problem description, and surgical repair of broken configs — field names, types, enums, mesh references, required sections.

Always verify

Validate against the schema and run palace --dry-run. A config can pass both and still be physically wrong — a mis-scaled length unit runs to completion yet computes a different system. Check against a reference where one exists.

In production on NumericalAI

Palace-LoRA runs inside NumericalAI's CEM platform — Palace-powered full-wave 3D electromagnetics on cloud GPUs — where every run starts and ends with this model.

Pre-flight validation

Before a job launches, the model validates and diagnoses the input config and geometry references — schema violations, wrong types, invalid enums, dangling mesh attributes — so mistakes are caught before they burn GPU time.

Failure diagnosis

When a simulation fails anyway, Palace-LoRA works inside the AI diagnosis pipeline — tracing the failure back to the configuration and proposing the fix, turning a dead run into a corrected setup instead of a support ticket.

CEM ships 19 ready-to-run Palace launch templates — eigenmode, S-parameters, antennas, quantum hardware — with zero license fees and pay-per-compute.

See it working on numericalai.net

Have a different solver, schema, or in-house code dialect?

The public adapter proves the method. The product is teaching a proven code model the exact language your tools speak — and shipping the adapter with the data it was trained on.

right-image