Create README.md
Browse files
README.md
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- text-to-sql
|
| 6 |
+
- phi-3
|
| 7 |
+
- genbi
|
| 8 |
+
- dbt
|
| 9 |
+
- azure-sql
|
| 10 |
+
- qlora
|
| 11 |
+
base_model: microsoft/Phi-3-mini-4k-instruct
|
| 12 |
+
license: mit
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# GenBI Phi-3 SQL Agent
|
| 16 |
+
|
| 17 |
+
## Model Description
|
| 18 |
+
This model is a specialized Small Language Model (SLM) designed to act as the reasoning engine for an Agentic GenBI Enterprise Platform. It translates natural language business questions into highly accurate, executable T-SQL queries.
|
| 19 |
+
|
| 20 |
+
It has been instruction-tuned to understand modern data stack semantics, specifically bridging the gap between a **dbt Semantic Layer** and an **Azure SQL** data warehouse.
|
| 21 |
+
|
| 22 |
+
- **Developed by:** deepinfo
|
| 23 |
+
- **Model type:** Causal Language Model (Fine-tuned via QLoRA)
|
| 24 |
+
- **Base model:** Microsoft Phi-3-mini-4k-instruct
|
| 25 |
+
- **Primary Use Case:** Enterprise Business Intelligence, Autonomous SQL Generation, and LangGraph Agentic Workflows.
|
| 26 |
+
|
| 27 |
+
## Training Details
|
| 28 |
+
This model was fine-tuned using a synthetic dataset generated from a strictly typed `dbt` semantic layer (`manifest.json`). The training ensures the model adheres strictly to predefined business logic (e.g., Margin, Revenue, Customer Lifetime Value) rather than hallucinating column names or relationships.
|
| 29 |
+
- **Hardware:** NVIDIA T4/A100 (Google Colab)
|
| 30 |
+
- **Technique:** QLoRA (Quantized Low-Rank Adaptation)
|
| 31 |
+
- **Format:** Merged fp16/bf16 weights.
|
| 32 |
+
|
| 33 |
+
## Usage Example (Python)
|
| 34 |
+
```python
|
| 35 |
+
from transformers import pipeline
|
| 36 |
+
|
| 37 |
+
pipe = pipeline("text-generation", model="deepinfo/genbi-phi3-sql-agent")
|
| 38 |
+
|
| 39 |
+
prompt = """You are the reasoning engine for an Agentic GenBI Enterprise Platform. Your role is to translate business questions into accurate T-SQL queries for an Azure SQL database.
|
| 40 |
+
|
| 41 |
+
Context:
|
| 42 |
+
Target Table: fct_sales_performance
|
| 43 |
+
Columns:
|
| 44 |
+
- gross_revenue: Standard definition for total sales: Qty * Price.
|
| 45 |
+
- gross_profit: Margin definition: Revenue - Cost.
|
| 46 |
+
- category_name: The top-level classification of the product sold.
|
| 47 |
+
|
| 48 |
+
User: What was the total gross profit generated by the Bikes category?"""
|
| 49 |
+
|
| 50 |
+
output = pipe(prompt, max_new_tokens=100, temperature=0.1)
|
| 51 |
+
print(output[0]['generated_text'])
|