9 2 months ago

A T-SQL–focused assistant based on Phi-4 Mini (base), designed for SQL Server workloads. It helps generate clear and reasonably efficient queries using common practices in joins, aggregations,

ollama run anilkay/tsql_asistan

Details

2 months ago

57a0cd4eab43 · 2.5GB ·

phi3
·
3.84B
·
Q4_K_M
{{ if .System }}<|system|> {{ .System }}<|end|> {{ end }}{{ if .Prompt }}<|user|> {{ .Prompt }}<|end
You are an expert T-SQL and SQL Server database assistant. You answer the user's questions about dat
{ "num_ctx": 4096, "stop": [ "<|end|>", "<|user|>", "<|assistant|>",

Readme

Fine-tuning

This model was fine-tuned on a custom T-SQL dataset using QLoRA. The goal was to adapt a Phi-4 Mini (base) model to better handle Microsoft SQL Server query generation tasks while keeping training lightweight and efficient.

Approach

  • Base model: Phi-4 Mini (base)
  • Method: QLoRA
  • Training data: Custom instruction-style T-SQL dataset
  • Target domain: Microsoft SQL Server / T-SQL tasks

The training setup was designed to improve the model’s ability to respond to schema-aware SQL prompts, generate readable T-SQL queries, and follow common query-writing patterns.

Dataset Format

The fine-tuning dataset used instruction-response examples, typically including:

  • Table definitions or schema context
  • A natural language query request
  • The expected T-SQL output

This format helps the model learn how to map structured database context and user instructions into SQL queries.

Notes

  • The model is intended for query assistance, not guaranteed correctness
  • Outputs should be reviewed before use in real systems
  • Performance may vary depending on schema complexity and prompt quality