tinyforge: Llama-3.1-8B-Instruct LoRA for text-to-SQL, trained on a 4 GB GPU

A 14 MB LoRA adapter (r=16) trained with tinyforge on a 4 GB RTX 3050 Ti laptop GPU using layer streaming: 200 steps in 9.5 minutes. Training data: 1,800 question/SQL pairs over six public seaborn tables (titanic, mpg, tips, car_crashes, planets, healthexp), each answer verified by executing the SQL. Use under the Llama 3.1 Community License.

Results (read the caveats)

100 questions about a table the model never saw (penguins), served with llama.cpp (adapter f16 on a Q4_K_M base), greedy decoding.

Model Execution accuracy
This adapter 100%
Base told to "reply with exactly one SQLite query" 93%

Caveats, honestly:

  • 100% is a ceiling: the instructed base is already at 93%, so this test cannot show how much headroom tuning adds. All 7 base misses are one malformed MAX/MIN call, so the gain is consistency, not new capability.
  • Questions use the same 12 templates as training, on a new schema: it measures transfer to new tables, not new kinds of questions.
  • On harder question shapes the same 8B model scored 98% vs 97% (no meaningful gain over a well-prompted base).
  • n=100, one run, no confidence interval. Raw numbers: eval_results.json.

Use

from transformers import AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct", device_map="auto")
model = PeftModel.from_pretrained(base, "RajGMore/tinyforge-llama3.1-8b-sql-lora")
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RajGMore/tinyforge-llama3.1-8b-sql-lora

Adapter
(2960)
this model

Collection including RajGMore/tinyforge-llama3.1-8b-sql-lora