Downloads · 30 days
10
6% of all-time downloads
build-small-hackathon/lfed-qwen2.5-coder-14b-sql-lora
lfed-qwen2.5-coder-14b-sql-lora is a text generation model from build-small-hackathon. Use it when you need the model to write or continue text. It is set up for peft.
A LoRA adapter that turns plain-English school-data questions into read-only DuckDB SQL queries. Built for the Local First Education Data Framework (LFED), a local-first analytics assistant for school administrators.
Downloads · 30 days
10
6% of all-time downloads
All-time downloads
154
Public
Repo size
562 MB
Likes
0
Public
Click a slice to open those files.
.safetensors551 MB · 98%
From the Hugging Face model README
A LoRA adapter that turns plain-English school-data questions into read-only DuckDB SQL queries. Built for the Local First Education Data Framework (LFED), a local-first analytics assistant for school administrators.
unsloth/qwen2.5-coder-14b-instruct-bnb-4bitq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj)This adapter is designed for a single downstream task: converting natural-language questions about school data into safe, read-only SQL.
transformers + PEFT.SELECT statements.students, enrollment, attendance, discipline, grades.question and a sql field.modal_train/generate_synthetic_v2.py, modal_train/augment_gretel.py, modal_train/rephrase_pairs.py in the project repo.| Setting | Value |
|---|---|
| Optimizer | AdamW (Unsloth default) |
| Learning rate | 1e-4 |
| LR scheduler | cosine |
| Warmup steps | 10 |
| Batch size | 4 |
| Gradient accumulation | 4 |
| Epochs | 2 |
| LoRA r | 32 |
| LoRA α | 32 |
| LoRA dropout | 0 |
| Target modules | all linear layers |
| Quantization | 4-bit (bnb NF4) |
| Max sequence length | 2048 |
| Trainer | SFTTrainer (TRL) |
| Packing | False |
| Hardware | Modal A10G |
Training completed on 2026-06-10.
| Artifact | Location |
|---|---|
| This LoRA adapter | build-small-hackathon/lfed-qwen2.5-coder-14b-sql-lora |
| Merged GGUF Q4_K_M | build-small-hackathon/lfed-qwen2.5-coder-14b-sql-gguf |
| Training code | modal_train/ in the LFED project repo |
Evaluation is currently manual: a bank of 15 real-world-style queries spanning attendance, discipline, grades, enrollment, and equity comparisons is run through the LFED demo UI. Each query is scored on:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id = "unsloth/qwen2.5-coder-14b-instruct-bnb-4bit"
adapter_id = "build-small-hackathon/lfed-qwen2.5-coder-14b-sql-lora"
tokenizer = AutoTokenizer.from_pretrained(base_id)
model = AutoModelForCausalLM.from_pretrained(
base_id,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_id, torch_device="cpu")
prompt = """You are an assistant that converts school-data questions into DuckDB SQL.
Schema:
- students(student_id, school_name, grade_level, gender, race_ethnicity, english_learner, special_education, economically_disadvantaged)
- attendance(student_id, school_name, school_year, absence_count, is_chronically_absent)
Question: How many chronically absent students at Lincoln Elementary in 2023-2024?
SQL:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.0)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Use the matching GGUF:
llama-cli \
-m lfed-qwen2.5-coder-14b-sql-gguf/ggml-model-q4_k_m.gguf \
-p "Question: How many chronically absent students at Lincoln Elementary in 2023-2024?\nSQL:" \
-n 128 --temp 0.0
Or run the full LFED app locally:
git checkout -b product local-llamacpp-v1
python3.12 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python app.py
student_ids only.data_engine.py validator enforces SELECT-only and forbidden-token rules.EXPLAIN validation.Estimated training energy use on a Modal A10G for ~2 epochs:
If you use this model, please cite the base model and the LFED project:
BibTeX:
@misc{lfed_sql_adapter,
title={Local First Education Data Framework: A Qwen2.5-Coder-14B LoRA Adapter for School-Data Text-to-SQL},
author={build-small-hackathon},
year={2026},
howpublished={\url{https://huggingface.co/build-small-hackathon/lfed-qwen2.5-coder-14b-sql-lora}}
}
APA: build-small-hackathon. (2026). Local First Education Data Framework: A Qwen2.5-Coder-14B LoRA adapter for school-data text-to-SQL. Hugging Face. https://huggingface.co/build-small-hackathon/lfed-qwen2.5-coder-14b-sql-lora