I have been building a logistics SaaS on the side called Frachtdok. At some point I needed a way to let non-technical users query data without touching SQL. I looked at the usual options: GPT-4 via API, hosted solutions, the whole thing. They all felt like overkill, or too expensive, or both.
So I decided to fine-tune something small myself.
This is the story of how I built Antelope-textTosql, a Phi-2 3B model that converts plain English into SQL queries. It has 534 downloads so far, which honestly surprised me.
Why Phi-2?
At the time, Phi-2 was one of the more interesting small models around. Microsoft trained it to punch above its weight on reasoning tasks, and text-to-SQL is fundamentally a structured reasoning problem: you're mapping a question onto a schema.






