Thai and English text-to-SQL where a small model chooses between typed query plans and never writes SQL itself.

Role
ML Engineer
Section
Data Projects
Built with
TypeScript / PostgreSQL / LiquidAI d1-3B / Hugging Face

How it works

A small language model (LiquidAI d1-3B) answers a fixed set of multiple-choice questions about each Thai or English question. Code turns those answers into candidate query plans, compiles each one into parameterized read-only PostgreSQL and asks the model to rank them. Answers show the result rows, the SQL, the chosen interpretation and the alternatives. It covers the public Olist e-commerce dataset and a synthetic utility-meter workspace with anomaly and period-change analysis. The decision examples are published as the Text2SQL-Decisions dataset on Hugging Face.