PEFT LoRA adapter from the llm-chess-move-learning project. It was fine-tuned to enumerate every legal move from a chess FEN and return lexicographically sorted UCI moves.
The checkpoint was selected on 128 positions. Final quality was measured on a disjoint 9,872-position test set. The repository contains adapter and tokenizer runtime files plus trainer history; optimizer and scheduler state are excluded.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
adapter_id = "ProttiProtto/gemma-4-e4b-chess-legal-moves-lora-r32"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base = AutoModelForCausalLM.from_pretrained("google/gemma-4-e4b-it")
model = PeftModel.from_pretrained(base, adapter_id)
Use the exact all-legal-moves prompt documented in the project repository. Generate deterministically and stop at Gemma's end-of-turn marker.
This model predicts text and is not a chess rules engine. Errors concentrate in globally constrained positions, especially when the side to move is in check. The project used one training seed per configuration, so rank comparisons are observations from these runs rather than universal claims.
This adapter is a modification of the base model and remains subject to its license and usage terms. See the Gemma terms. The processed dataset is derived from the CC0 Lichess database.
The quality values on this card use the project's current v2 checkpoint/export matrix. They supersede pre-v2 first-EOT summaries because EOT-aware checkpoint reselection changed the selected 270M rank-16, 270M rank-32, and E2B rank-32 checkpoints. The v2 report independently rescored all 266,544 saved completions and records the raw archive and checkpoint hashes; older values must not be substituted into this card.
Historical natural-FEN saturated throughput and latency measurements are archived/provisional because timing could include generation after the first <end_of_turn> marker. They are not final production-throughput or interactive-latency claims. A correct-stop rerun is required for such claims. Fixed 128-input/128-output results intentionally ignore EOS and are only a synthetic length-controlled hardware comparison.