Instructions to use Tagashy/dragon-12b-mtg-dsl-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Tagashy/dragon-12b-mtg-dsl-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-12b-it") model = PeftModel.from_pretrained(base_model, "Tagashy/dragon-12b-mtg-dsl-lora") - Notebooks
- Google Colab
- Kaggle
dragon — gemma-4-12b LoRA adapter for MTG intent→DSL
dragon is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards. Portions of the materials used are property of Wizards of the Coast. © Wizards of the Coast LLC. Card data provided by Scryfall.
QLoRA fine-tune of gemma-4-12b-it — the strongest model in the
mtg-compiler family — translating
structured card intents into the project's DSL (typed s-expressions of Magic
card mechanics). Gemma 4 is licensed under
Apache 2.0 (unlike earlier Gemma
generations), and this adapter is distributed under Apache 2.0 as well. Blog:
the mtg-compiler series.
Training
QLoRA r32/α32, lr 1e-4, batch 4 × grad-accum 6 (effective 24), seqlen 640, eager attention, on the v8 intent→DSL pairs. ≈60 h on one AMD R9700 (ROCm).
Evaluation
Held-out v8 test (5,051 cards), free decode, matched budgets, Wald 95% CI:
| model | parse | canonical-exact | dsl_sim | tree_sim |
|---|---|---|---|---|
| dragon-12B (this adapter) | 97.9% | 67.3% ±1.3 | 0.941 | 0.900 |
The headline number of the v8 cross-tier eval — and the one that un-shadowed the rare tail (once-seen node miss 0.247 vs ~1.0 for the from-scratch tier). See the blog's article 4 for what that does and doesn't prove.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-12b-it")
tok = AutoTokenizer.from_pretrained("unsloth/gemma-4-12b-it")
model = PeftModel.from_pretrained(base, "<this-repo>") # or .merge_and_unload()
Input format and output validation: see the wyrmling card and the compiler repo.
Limitations
- Trained on the v8 dataset, whose DSL still contained 117 counterfeit enum values (retired in !462); the 67.3% is measured on that same language. v9-trained adapters will supersede this one.
- The base model carries its own pretraining knowledge of Magic (names, flavor); nothing here licenses that content.
- With respect to Wizards of the Coast IP: free, non-commercial fan content and research use only.
- Downloads last month
- 18