LFED SQL Assistant v2 โ€” Qwen2.5-Coder-14B-LoRA (Warehouse r=64)

Trained on the real DuckDB warehouse schema (main_core, main_analytics, main_staging โ€” ~30+ tables) for the Local First Education Data Framework.

Differences from v1

v1 (r=32) v2 (r=64)
Training schema 5 synthetic tables Real warehouse (~30 tables)
LoRA rank 32 64
Adapter size ~551 MB ~1.1 GB
Target tables students, enrollment, attendance, discipline, grades main_core., main_analytics., main_staging.*

Intended use

Converts natural-language questions about K-12 school data into read-only DuckDB SQL queries. Designed for the LFED Gradio app.

Training data

Synthetic NLโ†’SQL pairs generated against the real warehouse schema using Qwen2.5-72B-Instruct-AWQ via vLLM on Modal A100-80GB. Every generated SQL was validated by executing it against the real DuckDB warehouse.

How to use

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = "unsloth/qwen2.5-coder-14b-instruct-bnb-4bit"
adapter = "KDDSTLC/lfed-qwen2.5-coder-14b-sql-lora-warehouse-r64"

model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, adapter, torch_device="cpu")
tokenizer = AutoTokenizer.from_pretrained(adapter)

Known limitations

  • Trained on synthetic data against the real schema; may hallucinate columns
  • Does not know about Rill metrics views (see project docs for the known gap)
  • Requires CUDA for 4-bit inference (bnb); CPU/MPS needs a different base model
Downloads last month
18
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support