❖ ❖ ❖
กำเมือง
Lanna Mnemonics for LannaBench Project

Every module, package, and command in the Lanna-3L benchmark carries an authentic Northern Thai name — drawn from traditional craft, ceremony, and community life of the ancient Lanna Kingdom.

ข่วง · Layer A · Data คัวไฟ · Layer B · Adaptation จ่อฟ้า · Layer C · Evaluation อูบ · Utilities

orchestrated by ฟ้อน · $ lanna-fon run --pipeline paper1_full.yaml

28Codenames
3Layers
explore
Layer A · lanna_khuang/
ข่วง Khuang · Courtyard Data Foundation
น้ำต้นหูกตอกรักตุง
Layer B · lanna_kuafai/
คัวไฟ Kua Fai · Kitchen Adaptation & Inference
ขันโตกไหข้าวกัวะอั้งโล่
Layer C · lanna_jorfa/
จ่อฟ้า Jor Fa · Sky Finial Evaluation & Diagnostics
สาตุไตรภูมิแก้วป่องแตะใบลานฮอมปอยกาแล
Utilities · oob_meta/
อูบ Oob · Lacquerware Container Shared Utilities
ปู่จ๋านป่อหลวงข้าวตอกปี้ฮีตฟ้อน
Layer A · lanna_khuang/ ข่วง Khuang · Open Courtyard "The open gathering space where community begins all important activity" $ lanna-khuang · formerly lannaforge · Data Foundation Toolkit
ข่วง
Khuang
"The open courtyard before a temple or palace"
Raw materials are laid out in the courtyard, organised, and prepared before any craft begins. Layer A takes the raw master Google Sheet and builds the JSONL corpus — everything downstream begins here.
$ lanna-khuang
น้ำต้นNam Ton · Water Carafe→ namton_builder.py · JSONL builder
formerly Anvil
click to expand ↗
หูกHuuk · Loom→ huuk_validator.py · schema validator
formerly Loom
click to expand ↗
ตอกTok · Bamboo Strips→ tok_splitter.py · partitioner
formerly Cleaver
click to expand ↗
รักRak · Lacquer→ rak_annotator.py · codebook applicator
formerly Quill
click to expand ↗
ตุงTung · Ritual Flag→ tung_definer.py · field definitions
formerly Compass
click to expand ↗
Layer B · lanna_kuafai/ คัวไฟ Kua Fai · Traditional Kitchen "The heart of transformation — where fire and skill shape everything" $ lanna-kuafai · formerly lannasmith · Adaptation Toolkit
คัวไฟ
Kua Fai
"The traditional Lanna kitchen — spiritual and architectural heart of the home"
Not just a cooking room but the centre of transformation. Raw ingredients become meals; fire shapes everything. Layer B transforms raw models through zero-shot prompting, few-shot conditioning, and LoRA fine-tuning. The GPU is the fire.
$ lanna-kuafai
ขันโตกKhan Tok · Serving Bowl→ khantok_registry.py · 9-model registry
formerly Roster
click to expand ↗
ไหข้าวHai Khao · Rice Steamer→ haikhao_templater.py · prompt templating
formerly Stencil / Chalu
click to expand ↗
กัวะKua · Rice Cooling Tray→ kua_inference/ · inference runner
formerly Forgehammer
click to expand ↗
อั้งโล่Ang Lo · Charcoal Brazier→ anglo_finetuner.py · LoRA fine-tuner
formerly Bellows / Sin
click to expand ↗
Layer C · lanna_jorfa/ จ่อฟ้า Jor Fa · Sky Finial "Reaching skyward — connecting the earthly generation to the heaven of perfect accuracy" $ lanna-jorfa · formerly lannascope · Diagnostic Toolkit
จ่อฟ้า
Jor Fa
"The elegant finial atop a Lanna viharn, often carved as a naga"
It reaches skyward, connecting earth to the highest realms — a measuring rod of sacred aspiration. Layer C runs the full LannaDiagnos stack: Triple-ChrF, Dialect Gap Score, LannaFacets slicing, human evaluation, and error analysis.
$ lanna-jorfa
① Automatic Diagnostics
สาตุSatu · Affirmation→ satu_robustness.py · 3P robustness
formerly Trident
click to expand ↗
ไตรภูมิTrai Phum · Three Realms→ traiphum_multiref.py · MultiRef scorer
formerly Triplet
click to expand ↗
แก้วKaew · Crystal→ kaew_aggregator.py · Triple-ChrF
formerly Prism
click to expand ↗
ป่องPong · Gap / Interval→ pong_gap.py · Dialect Gap Score G
formerly Caliper
click to expand ↗
แตะTae · Woven Bamboo Panel→ tae_slicer.py · LannaFacets slicer
formerly Lattice
click to expand ↗
② Human Diagnostics
ใบลานBai Lan · Palm-Leaf Manuscript→ bailan_form.py · human eval forms
formerly Slate
click to expand ↗
ฮอมปอยHom Poi · Communal Merit→ hompoi_agreement.py · Krippendorff α
formerly Concord
click to expand ↗
③ Error Analysis
กาแลKalae · Guardian Gable Finial→ kalae_error.py · error analysis
formerly Sieve / Hae
click to expand ↗
Utilities · oob_meta/ อูบ Oob · Ceremonial Lacquerware Container "A hand-crafted lacquerware container that holds and preserves what is most sacred" formerly lannakit · Shared utilities across all layers
อูบ
Oob
"In Lanna and Tai Khoen culture, an อูบ is a hand-crafted lacquerware container decorated with intricate gold-leaf patterns"
Used to store Buddhist manuscripts, ritual betel sets, or offerings for monks — precious, sacred items that must be preserved intact. The อูบ_meta package holds all shared utilities: schema definitions, run manifests, seed manager, I/O bridge, and orchestration. Like a ceremonial container, it safeguards the rules that ensure reproducibility.
oob_meta/
ปู่จ๋านPu Jan · Lay Minister→ pujan_io.py · JSONL I/O bridge
formerly io.py
click to expand ↗
ป่อหลวงPo Luang · Village Headman→ poluang_orchestrate.py · pipeline leader
formerly orchestrate.py
click to expand ↗
ข้าวตอกKhao Tok · Sacred Popped Rice→ khaotok_seed.py · deterministic seed
formerly loomstone.py
click to expand ↗
ปี้Pee · Tag / Mark→ pee_manifest.py · run manifest
formerly manifest.py
click to expand ↗
ฮีตHeet · Customary Law→ heet_schema.py · Pydantic schemas
formerly schema.py
click to expand ↗
ฟ้อนFon · Traditional Dance→ $ lanna-fon run · pipeline orchestrator
formerly lanna run
click to expand ↗
The Dance in Motion
ฟ้อน · lanna-fon

The lanna-fon command is the pipeline orchestrator — it reads a YAML pipeline file and runs every layer in sequence, passing manifest IDs between stages. Think of it as the village headman (ป่อหลวง) calling the performance: each tool plays its part in order, and the benchmark runs from raw sheet to final report in one graceful, uninterrupted dance. Below is a realistic terminal session showing the full Paper 1 pipeline.

northern-thai-llm · terminal
Layer A · ข่วง · Build the corpus
$lanna-khuang build --sheet lanna_master.xlsx --out data/
✓ namton_builder 1120 rows forged into JSONL ✓ tok_splitter test=200 · dev=100 · train=820 (stratified)
$lanna-khuang validate data/lannacore_dataset.jsonl
✓ huuk_validator 1120 rows comply with ฮีต · 0 violations
Layer B · คัวไฟ · Fire up the kitchen
$lanna-kuafai register
khantok_registry 9 models loaded (5 api · 4 fine-tunable)
$lanna-kuafai infer --model gpt4o --condition zero-shot --prompt-index 1
✓ haikhao_templater → kua_inference/api 200 items · 45.1s
$lanna-kuafai train --base typhoon2 --r 8 --alpha 16
✓ anglo_finetuner LoRA adapter infused · pee_manifest stamped
Layer C · จ่อฟ้า · Reach toward the sky
$lanna-jorfa score --hypotheses outputs/ --references test.jsonl
✓ traiphum_multiref → kaew_aggregator chrf_max=42.1 · chrf_avg=38.7 · chrf_diff=3.4
$lanna-jorfa gap --reports reports/
✓ pong_gap G = 8.3 (STD − NTD dialect gap)
$lanna-jorfa errors --reports reports/ --human human/responses/
✓ kalae_error 20 worst-k · 12 tone-flip · 8 CD-drop flagged
Full pipeline · ฟ้อน · One graceful dance
$lanna-fon run --pipeline pipelines/paper1_full.yaml
🕊️ Lanna Fon — orchestrating the benchmark with grace ✔ khuang.build · khuang.validate · kuafai.infer ×27 · kuafai.train ✔ jorfa.score · jorfa.gap · jorfa.facets · jorfa.human · jorfa.errors ✨ Complete · All reports in runs/exp1/
รวมกำเมือง
Complete Index · All Lanna Codenames
ThaiRomanisationLayerFileMeaning · Role
กาแลKalaeCkalae_error.pyGuardian gable finial — error analysis & outlier filtering
กัวะKuaBkua_inference/Rice cooling tray — inference runner (API + vLLM)
แก้วKaewCkaew_aggregator.pyCrystal — Triple-ChrF aggregator (max · avg · diff)
ขันโตกKhan TokBkhantok_registry.pyServing bowl — 9-model registry
ข้าวตอกKhao Tokutilkhaotok_seed.pySacred popped rice — deterministic seed manager
ข่วงKhuangA pkglanna_khuang/Open courtyard — data foundation layer package
คัวไฟKua FaiB pkglanna_kuafai/Traditional kitchen — adaptation layer package
จ่อฟ้าJor FaC pkglanna_jorfa/Sky finial — evaluation layer package
ตอกTokAtok_splitter.pyBamboo strips — stratified train/dev/test partitioner
ตุงTungAtung_definer.pyRitual flag — LannaFacets field definitions
แตะTaeCtae_slicer.pyWoven bamboo panel — LannaFacets slice analyzer
ไตรภูมิTrai PhumCtraiphum_multiref.pyThree realms — Lanna MultiRef scorer (3 hyp × 3 ref)
น้ำต้นNam TonAnamton_builder.pyWater carafe — JSONL builder from master sheet
ใบลานBai LanCbailan_form.pyPalm-leaf manuscript — human eval form generator
ปี้Peeutilpee_manifest.pyTag / mark — run manifest (config + hashes + SHA)
ป่องPongCpong_gap.pyGap / interval — Dialect Gap Score G
ป่อหลวงPo Luangutilpoluang_orchestrate.pyVillage headman — pipeline coordinator
ปู่จ๋านPu Janutilpujan_io.pyLay minister — JSONL I/O bridge & hashing
ฟ้อนFonCLIlanna-fonTraditional dance — graceful pipeline orchestration
รักRakArak_annotator.pyLacquer — annotation codebook applicator
สาตุSatuCsatu_robustness.pyAffirmation (amen × 3) — 3P prompt robustness harness
หูกHuukAhuuk_validator.pyLoom — schema validator (Loom-as-gate)
ไหข้าวHai KhaoBhaikhao_templater.pyRice steamer — prompt templater
อั้งโล่Ang LoBanglo_finetuner.pyCharcoal brazier — LoRA fine-tuner (slow, steady heat)
อูบOobutiloob_meta/Ceremonial lacquerware container — shared utilities package
ฮอมปอยHom PoiChompoi_agreement.pyCommunal merit-making — Krippendorff's α
ฮีตHeetutilheet_schema.pyCustomary law — Pydantic data schemas (the right way)