chabab/gemma-3-270m-text2sql-oracle-postgres

TEXT GENERATIONPricing:Input $0.04 / Cached $0.008 / Output $0.08Concurrent Unit Cost:1Model Size:0.3BQuant:BF16Context Size:32kPublished:Aug 27, 2026License:apache-2.0Architecture:Transformer Open Weights Featherless Exclusive Cold

The chabab/gemma-3-270m-text2sql-oracle-postgres model is a 270 million parameter Gemma-3-270m-it variant fine-tuned by chabab. It specializes in converting natural language questions and database schemas into dialect-correct SQL statements for either Oracle or PostgreSQL. This compact model is optimized for text-to-SQL generation, producing single SQL queries without markdown fences or commentary, and runs efficiently on CPU with a quantized size of approximately 290 MB.

Loading preview...

Overview

This model, chabab/gemma-3-270m-text2sql-oracle-postgres, is a fine-tuned version of google/gemma-3-270m-it specifically designed for text-to-SQL generation. With only 270 million parameters, it is highly efficient, capable of running on CPUs and quantizing to approximately 290 MB.

Key Capabilities

  • Dialect-specific SQL Generation: Converts natural language questions and provided schemas into correct SQL for either Oracle or PostgreSQL.
  • Concise Output: Generates a single SQL statement without markdown fences or additional commentary.
  • Performance: Achieves an overall exact match of 78.3% on a held-out test set, with 86.7% for Oracle and 53.3% for PostgreSQL queries. Semantic accuracy is noted to be higher than strict exact match.
  • Efficiency: Its small size allows for full-parameter SFT (Supervised Fine-Tuning) without LoRA, trained in about 10 minutes on one L4 GPU.

Usage Considerations

  • Greedy Decoding: The model performs best with greedy decoding (do_sample=False) as the task has a single correct answer.
  • Attention Implementation: Requires attn_implementation="eager" to prevent degenerate token generation.
  • Schema Specificity: Performance is validated only on the 7 schemas used in training (hr, sales, banking, inventory, tickets, university, logistics); generalization to unseen schemas is untested.
  • Limitations: Generated SQL is not validated against a live database and may occasionally produce syntactically valid but semantically incorrect queries. Users should review output before execution, especially in production environments.