Starwell is a generative model for stellarator design. Given a number of field periods, an aspect ratio and a target magnetic-gradient scale length L_grad_B, it samples a plasma boundary for the mhd_stable problem of the ConStellaration benchmark, predicts its benchmark metrics, and lays out modular coils for it.
Usage
from transformers import AutoModel
model = AutoModel.from_pretrained("phanerozoic/starwell", trust_remote_code=True)
boundaries = model.sample(nfp=[3, 4], aspect_ratio=[8.0, 16.0], l_grad_b=[6.5, 21.5])
open("submission.json", "w").write(model.to_submission(boundaries))
design = model.design(nfp=3, aspect_ratio=8.0, l_grad_b=6.5)[0]
design["boundary"], design["predicted"], design["coils"]
Boundaries are SurfaceRZFourier dicts (r_cos, z_sin) that constellaration evaluates directly; sample also takes tau, guidance, steps and seed, and model.config.sampling holds the integrator's defaults. Coils are simsopt CurveXYZFourier coefficients for one half period with their currents, and simsopt.field.coils_via_symmetries builds the full set; limits (in metres and per metre) sets the coil spacing, plasma clearance and curvature they are made for, and each coil set reports the bending and twist strain of a REBCO tape wound on it (strain_met).
Model
The generator is a conditional flow-matching transformer with one token per Fourier mode of the boundary, conditioned on nfp, log aspect ratio and log L_grad_B through adaptive layer norm, trained on boundaries that satisfy all five mhd_stable constraints. A residual MLP head predicts L_grad_B and the five constrained quantities. A second predicts the coils from the boundary and the engineering limits; it was trained on the coil sets of Proxima Fusion's CoilStellaration that meet their limits and on our own optimized sets. The model also carries a library of coil sets that meet every limit. The nearest library set is tried first and the head's coils when it misses a limit, with the currents solved on the boundary; polish=N refines the better start by up to N L-BFGS iterations of a stage-two coil objective, stopping once every limit holds, and polishes the other start only if the first fails.