DEx-3B-GGUF / README.md
malleshmadapathi's picture
Upload README.md
cab4c47 verified
|
Raw History Blame Contribute Delete
4.16 kB
---
license: apache-2.0
base_model: Qwen/Qwen2.5-Coder-3B-Instruct
tags:
- gguf
- data-engineering
- data-science
- sql
- duckdb
- polars
- pyspark
- dbt
- qwen2.5-coder
- mlx
language:
- en
pipeline_tag: text-generation
---
# DEx-3B (GGUF)
**DEx-3B** is a 3B parameter language model fine-tuned from [`Qwen/Qwen2.5-Coder-3B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct) for practical Data Engineering and Data Science tasks.
The training set consists of **15,598** examples that passed automated verification checks before training:
- SQL queries were executed in DuckDB against populated tables.
- Polars 2.x, Pandas, and Python data science snippets were executed in a sandboxed subprocess with assertions.
- dbt SQL and YAML models were parsed with `sqlglot` and `pyyaml`.
- Debugging tasks were checked for valid code syntax and structured fixes.
## Model Files
| File | Quantization | Size | Notes |
| :--- | :---: | :---: | :--- |
| `DEx-3B-Q4_K_M.gguf` | Q4_K_M | ~1.8 GB | Recommended for local CPU or Apple Silicon use |
| `DEx-3B-Q8_0.gguf` | Q8_0 | ~3.1 GB | Near-lossless quantization |
| `DEx-3B-F16.gguf` | F16 | ~5.8 GB | Full-precision weights for reference or custom quantization |
| `Modelfile` | - | - | Ready-to-use Ollama config |
## Evaluation
Both the base model and DEx-3B were evaluated on **120 held-out tasks** across three unseen database schemas (`cloud_billing_finops`, `energy_smart_grid`, `banking_credit_risk`). SQL outputs were executed in DuckDB, Python outputs were syntax-checked, and dbt outputs were parsed with `sqlglot` and `pyyaml`.
| Track | Base `Qwen2.5-Coder-3B-Instruct` | DEx-3B | Delta |
| :--- | :---: | :---: | :---: |
| Schema-Aware DuckDB SQL (Pass@1) | 50.0% (24/48) | **75.0% (36/48)** | +25.0 pts |
| ETL (Polars 2.x / Pandas / PySpark) | 76.0% (19/25) | **100.0% (25/25)** | +24.0 pts |
| Pipeline Debugging | 75.0% (15/20) | **95.0% (19/20)** | +20.0 pts |
| dbt Models & SQL Refactoring | 81.5% (22/27) | **88.9% (24/27)** | +7.4 pts |
| **Overall Pass@1** | **66.7% (80/120)** | **86.7% (104/120)** | **+20.0 pts** |
Table hallucinations (`CatalogException`) on unseen SQL schemas dropped from 6 to 0. Validation loss dropped from `0.935` to `0.412` over 2,500 steps.
## Scope
- **SQL:** Multi-table joins, CTEs, window functions (`ROW_NUMBER`, `LAG`, `LEAD`, rolling averages), cohort retention, funnel analysis, deduplication, and anomaly queries.
- **ETL:** Modern Polars 2.x (`with_columns`, `group_by`, `pl.len()`, `min_samples=`), Pandas, and PySpark transformations.
- **dbt & Data Quality:** Staging and incremental models, `schema.yml` tests, and SQL refactoring.
- **Debugging:** Root cause analysis and fixes for Spark skew/OOM, Airflow DAG errors, fan-out joins, timezone mismatches, and Parquet schema issues.
- **Data Science:** Leakage-free temporal splits, lag and rolling feature engineering, tabular forecasting metrics, and drift checks.
## Usage
### Ollama
```bash
ollama create dex-3b -f Modelfile
ollama run dex-3b
```
### llama.cpp
```bash
llama-cli -m DEx-3B-Q4_K_M.gguf \
-sys "You are DEx, a specialized Data Engineering and Data Science AI assistant." \
-p "Write a Polars 2.x snippet to compute a 7-day rolling revenue average per store_id."
```
### LM Studio
Load `DEx-3B-Q4_K_M.gguf` or `DEx-3B-Q8_0.gguf` using the **ChatML** prompt format.
## Training Details
- **Base model:** `Qwen/Qwen2.5-Coder-3B-Instruct`
- **Dataset:** 15,598 verified examples (14,820 train / 778 validation) across 5 tracks
- **Fine-tuning:** MLX LoRA (`rank=16`, `scale=32`, 16 layers, AdamW, cosine LR `1.5e-5` to `1.5e-6`, `max_seq_length=1536`, prompt-masked loss, 2,500 iterations)
- **Export:** Fused to FP16 safetensors and converted/quantized with `llama.cpp`
## Limitations
- Trained primarily on DuckDB-compatible SQL and Polars 2.x/Pandas/PySpark patterns; vendor-specific proprietary syntax outside these dialects may still need minor adjustment.
- At 3B parameters, complex multi-file repository reasoning is outside scope.
## License
Apache-2.0, matching the base `Qwen/Qwen2.5-Coder-3B-Instruct` license.