RahulPi/qwen2.5-1.5B-sql

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

RahulPi/qwen2.5-1.5B-sql is a 1.5 billion parameter causal language model, fine-tuned from Qwen/Qwen2.5-1.5B-Instruct, specifically designed for text-to-SQL translation. This model excels at converting natural language questions into valid SQL queries, given a database schema context. It was trained using QLoRA on a structured SQL dataset, achieving a mean token accuracy of 85.97%. Its primary use case is generating SQL queries for database interaction.

Loading preview...

RahulPi/qwen2.5-1.5B-sql: Text-to-SQL Assistant

This model is a specialized 1.5 billion parameter causal language model, fine-tuned by RahulPi from Qwen/Qwen2.5-1.5B-Instruct. Its core function is to translate natural language questions into valid SQL queries, provided with a database context and schema.

Key Capabilities

  • Text-to-SQL Translation: Converts user questions and schema information into executable SQL queries.
  • Fine-tuned Performance: Achieved a mean token accuracy of 85.97% during training on SQL-specific data.
  • Efficient Training: Utilized QLoRA with Hugging Face's SFTTrainer on a 1,000-row subset of b-mc2/sql-create-context.
  • Optimized for Inference: Merged into fp16 precision after training for direct use.

Training Details

The model was trained with a specific prompt format: System: You are a strict SQL assistant. Output ONLY valid SQL queries.\nUser: Schema: <context/schema> Question: <natural_language_question>\nAssistant: <sql_query>. Training involved 3 epochs with a learning rate of 2e-4 and an effective batch size of 16, using paged_adamw_32bit optimizer and a max sequence length of 2048.

Good for

  • Automated SQL Generation: Ideal for applications requiring programmatic generation of SQL queries from user input.
  • Database Interaction: Streamlining data retrieval or manipulation through natural language interfaces.
  • Small-scale SQL Tasks: Suitable for scenarios where a compact yet specialized model for SQL generation is needed.