File size: 1,118 Bytes
24310d8
4936ab3
24310d8
 
4936ab3
 
 
24310d8
4936ab3
 
 
 
24310d8
 
 
 
4936ab3
24310d8
4936ab3
24310d8
4936ab3
 
 
 
 
24310d8
4936ab3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
license: mit
base_model: unsloth/Phi-3-mini-4k-instruct-bnb-4bit
tags:
- text-to-sql
- sql
- phi-3
- unsloth
- gguf
- ollama
datasets:
- b-mc2/sql-create-context
language:
- en
---

# Phi-3-SQL-Expert (GGUF)

This model is a fine-tuned version of **Microsoft Phi-3-mini-4k-instruct**, specialized for **Text-to-SQL** conversion. It was trained using the `b-mc2/sql-create-context` dataset and is optimized for local inference on consumer hardware.

## Model Details
- **Architecture:** Phi-3-mini (3.8B parameters)
- **Quantization:** Q4_K_M GGUF (Optimised for balance of speed/accuracy)
- **Fine-tuning Technique:** LoRA (Low-Rank Adaptation) via Unsloth
- **Primary Task:** Natural Language to SQL Query generation

## Usage (Ollama)
To run this model locally, create a `Modelfile` with the following content:

```dockerfile
FROM ./phi3-sql-expert.Q4_K_M.gguf

TEMPLATE """<|system|>
You are a helpful assistant that writes SQL queries. Given a user question and a table schema, output only the SQL code.<|end|>
<|user|>
{{ .Prompt }}<|end|>
<|assistant|>
"""

PARAMETER stop "<|end|>"
PARAMETER temperature 0.1