sirunchained/text-to-sql-model-v2
sirunchained/text-to-sql-model-v2 is a 0.3 billion parameter instruction-tuned model developed by sirunchained, fine-tuned from google/gemma-3-270m-it. This version is a merged model, directly loadable for faster inference and simpler use compared to its LoRA adapter predecessor. It specializes in Text-to-SQL generation, converting natural language into SQL queries including SELECT, INSERT, UPDATE, and DELETE operations, and handles non-SQL requests by outputting INVALID_QUERY.
Loading preview...
Model Overview
This is Version 2 of the sirunchained/text-to-sql-model, a 0.3 billion parameter model fine-tuned from google/gemma-3-270m-it for Text-to-SQL generation. A key improvement in v2 is that the LoRA adapter has been merged into the base model, allowing direct loading with pipeline() for significantly faster inference and simpler usage compared to v1, which required PEFT.
Key Capabilities
- Text-to-SQL Generation: Converts natural language questions into SQL queries.
- Comprehensive SQL Support: Handles
SELECT(with JOINs, aggregations, subqueries),INSERT,UPDATE, andDELETEoperations. - Invalid Query Handling: Trained to output
INVALID_QUERYfor non-SQL requests. - Schema Flexibility: Works with or without provided database schemas.
Training and Performance
The model was fine-tuned using LoRA with 4-bit quantization (QLoRA) on the sirunchained/text-to-sql-dataset (2500 samples). It achieved a mean token accuracy of 81.6% on the test set. Being a small language model (270M parameters), it is efficient and can run on T4 GPUs.