sirunchained/text-to-sql-model-v2

TEXT GENERATIONPricing:Input $0.04 / Cached $0.008 / Output $0.08Concurrent Unit Cost:1Model Size:0.3BQuant:BF16Context Size:32kPublished:Jul 23, 2026License:mitArchitecture:Transformer Open Weights Featherless Exclusive Cold

The sirunchained/text-to-sql-model-v2 is a 270 million parameter instruction-tuned causal language model, fine-tuned from google/gemma-3-270m-it by sirunchained. This version is a merged LoRA adapter, offering faster inference and simpler loading compared to its predecessor. It specializes in Text-to-SQL generation, converting natural language into SQL queries including SELECT, INSERT, UPDATE, and DELETE operations.

Loading preview...

Model Overview

This is Version 2 of the sirunchained/text-to-sql-model, a small language model (270M parameters) fine-tuned from google/gemma-3-270m-it for Text-to-SQL generation. Unlike v1, this version has the LoRA adapter merged into the base model, allowing direct loading with pipeline() without requiring PEFT.

Key Improvements in v2

  • Simplified Loading: Direct use with pipeline() for ease of use.
  • Faster Inference: Improved speed compared to the adapter-only v1.
  • Model Size: Approximately 536 MB (full model) compared to ~10 MB for the v1 adapter.
  • Performance: Maintains the same 89.7% accuracy as v1.

Capabilities

This model excels at Text-to-SQL Generation, converting natural language questions into various SQL queries. It supports:

  • SELECT queries (including JOINs, aggregations, subqueries)
  • INSERT operations
  • UPDATE operations
  • DELETE operations (though currently weaker in this area)

Training Details

The model was fine-tuned using LoRA with 4-bit quantization (QLoRA) on the sirunchained/text-to-sql-dataset, which contains 4,518 training samples. It achieved a highest mean token accuracy of 85.1% on the validation set during training.

Usage Notes

  • Designed to run efficiently on T4 GPUs due to its small size.
  • Can generate SQL queries with or without an explicit schema provided in the prompt.
  • Outputs INVALID_QUERY for non-SQL related requests, as it was trained with negative samples.