Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sieve Training

Fine-tuning Llama 3.2 1B for SQL WHERE clause generation, used by the Planorix sieve feature.

Overview

This is a completion model (not instruct/chat). Given a PostgreSQL schema (DDL), a natural language filter as a -- filter: comment, and a SELECT * FROM table prefix, the model completes with the appropriate WHERE clause.

Example

Input:

CREATE TABLE "public"."product" (
  "id" bigint PRIMARY KEY,
  "name" text NOT NULL,
  "category" text NOT NULL,
  "price" numeric(10,2) NOT NULL,
  "in_stock" boolean NOT NULL DEFAULT true
);
-- filter: electronics under $50
SELECT * FROM product

Output:

WHERE category LIKE '%electronics%' AND price < 50

Training

  • Method: LoRA (r=16, alpha=32, dropout=0.05) via TRL's SFTTrainer
  • Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Dataset: 500 examples (completion-only loss)
  • Epochs: 3
  • Hardware: H100 (via Modal)
  • Precision: bf16

Links

Usage

# Train
modal run main.py

# Push to HF
modal run push.py --volume-name sieve-checkpoints

About

Fine tuned model from Llama 3.2 1b on creating WHERE clauses

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages