93 4 months ago

A customized version of the phi-4 model specialized in generating secure, clean, and production-ready SQL Server queries from natural language prompts (Arabic or English). Designed by Alwaleed Alduais, this model is optimized for enterprise use cases and

Models

View all →

Readme

๐Ÿง  walphi-sql

walphi-sql is a customized variant of the phi-4 model designed by Alwaleed Alduais.
It specializes in generating strict, secure, and clean SQL Server queries from natural language prompts in Arabic or English.

This model is optimized for enterprise data platforms that require: - Strict schema enforcement - Permission-aware SQL generation - Direct execution without explanation or formatting


๐Ÿ’ก Use Case

The model is ideal for: - Business Intelligence platforms - Data query bots - Secure dashboards - Role-based access control (RBAC) systems


๐Ÿ› ๏ธ Prompt Format

To get the best results, use this format:

View name: Employees
Allowed columns:
[
  {"name": "EmployeeID", "type": "int", "description": "Employee unique ID"},
  {"name": "Department", "type": "varchar", "description": "Department name"},
  {"name": "JoinDate", "type": "varchar", "description": "Date of joining"}
]
User question: ูƒู… ุนุฏุฏ ุงู„ู…ูˆุธููŠู† ููŠ ู‚ุณู… ุงู„ู…ูˆุงุฑุฏ ุงู„ุจุดุฑูŠุฉุŸ

or this version for english users

View name: Employees
Allowed columns:
[
  {"name": "EmployeeID", "type": "int", "description": "Employee unique ID"},
  {"name": "Department", "type": "varchar", "description": "Department name"},
  {"name": "JoinDate", "type": "varchar", "description": "Date of joining"}
]
User question: How many employees are there in the HR department?

The model will return ONLY the corresponding SQL Server query (no comments, explanations, or formatting).


โœ… Model Behavior

  • Uses only allowed columns
  • Prevents SELECT *
  • Uses TOP N (not LIMIT)
  • Supports WHERE, ORDER BY, GROUP BY, AGGREGATE
  • Uses TRY_CAST(... AS DATE) for date comparisons
  • Outputs strict SQL only โ€” nothing else

โš ๏ธ Notes

  • Table/view schema must be provided per prompt
  • Response is intended for direct SQL execution
  • No need for extra instruction โ€” behavior is embedded via system prompt

๐Ÿ‘จโ€๐Ÿ’ป Author

Created by Alwaleed Alduais
GitHub: @AlwaleedAlduies

Built and published using Ollama.