Instructions to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Ollama:
ollama run hf.co/tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chatting
- Pi
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
- Lemonade
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-DBT-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use tdelard/Qwen3-4B-DBT-Instruct-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default tdelard/Qwen3-4B-DBT-Instruct-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chattingUsing HuggingFace Spaces for Unsloth
# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chattingQwen3-4B-DBT-Instruct โ GGUF
A fine-tuned version of unsloth/Qwen3-4B-Instruct-2507-unsloth-bnb-4bit (the pre-quantized 4-bit Unsloth variant of Qwen3-4B-Instruct) specialized in converting natural language business questions into complete, multi-file dbt DAGs.
Looking for the LoRA adapter? โ tdelard/Qwen3-4B-DBT-Instruct-LoRA
What does this model do?
Given a business question and a SQL schema, the model generates a full dbt project structure:
- Staging layer โ
stg_*.sqlfiles that clean and rename raw source data - YAML sources โ
_sources.yml/_stg_*.ymlschema files with column definitions - Intermediate models โ
int_*.sqlfiles that join and enrich staging data - Marts layer โ
fct_*.sqlordim_*.sqlfinal business models
Example prompt:
Business question: Show the total revenue per product category, filtered to orders placed in the last 12 months.
SQL context: CREATE TABLE orders (...); CREATE TABLE products (...);
Example output: A ready-to-use dbt DAG with staging, intermediate, and mart SQL + YAML files.
Available GGUF files
| File | Quantization | Size | Recommended for |
|---|---|---|---|
qwen3-4b-instruct-2507.Q4_K_M.gguf |
Q4_K_M | ~2.5 GB | Most users (best size/quality trade-off) |
qwen3-4b-instruct-2507.Q5_K_M.gguf |
Q5_K_M | ~2.9 GB | Higher quality, still fits in 8 GB RAM |
qwen3-4b-instruct-2507.Q8_0.gguf |
Q8_0 | ~4.3 GB | Maximum quality, requires ~6 GB RAM |
Usage
LM Studio / Jan
- Search for
tdelard/Qwen3-4b-DBT-Instruct-GGUFin the model browser, or download the GGUF manually. - Load the model and use the system prompt below.
Ollama
An Modelfile is included in this repository for easy import:
ollama create qwen3-dbt -f Modelfile
ollama run qwen3-dbt
llama.cpp
llama-cli -hf tdelard/Qwen3-4b-DBT-Instruct-GGUF --jinja \
-m qwen3-4b-instruct-2507.Q4_K_M.gguf
Python (llama-cpp-python)
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="tdelard/Qwen3-4b-DBT-Instruct-GGUF",
filename="qwen3-4b-instruct-2507.Q4_K_M.gguf",
n_ctx=2048,
)
response = llm.create_chat_completion(
messages=[
{
"role": "system",
"content": (
"You are a dbt expert. Given a business question and a SQL schema, "
"generate a complete, production-ready dbt DAG including staging SQL files, "
"YAML schema files, intermediate models, and mart models. "
"Use proper dbt conventions: ref(), source(), naming prefixes (stg_, int_, fct_, dim_)."
),
},
{
"role": "user",
"content": (
"Business question: Show the total revenue per product category.\n"
"SQL context: CREATE TABLE orders (order_id INT, product_id INT, amount DECIMAL); "
"CREATE TABLE products (product_id INT, category VARCHAR, name VARCHAR);"
),
},
]
)
print(response["choices"][0]["message"]["content"])
Training details
| Parameter | Value |
|---|---|
| Base model | unsloth/Qwen3-4B-Instruct-2507-unsloth-bnb-4bit |
| Training framework | Unsloth + TRL SFTTrainer |
| Method | QLoRA (4-bit quantized base + LoRA adapters) |
| LoRA rank | 32 |
| LoRA alpha | 32 |
| Learning rate | 2e-4 |
| Max sequence length | 2048 tokens |
| Hardware | Google Colab T4 GPU (15 GB VRAM) |
| Training dataset | tdelard/text_to_dbt |
| Train split | 900 examples |
| Eval split | 100 examples |
Training dataset pipeline
The training data was built from scratch using a synthetic generation pipeline:
- Source: ~1 000 SQL queries sampled from
b-mc2/sql-create-context, filtered and scored on 24 structural complexity features (table count, join depth, aggregation, subqueriesโฆ). - Generation: Each SQL query was transformed into a multi-file dbt DAG by Claude Sonnet via structured prompting.
- Validation: Every generated DAG was validated with
dbt parse(no database required), catching ref/source resolution errors and YAML issues. Only passing DAGs were kept.
Limitations
- Context window is 2 048 tokens โ very large schemas or highly complex queries may be truncated.
- The model was trained on single-question โ single-DAG examples; multi-model or incremental dbt patterns are not covered.
- Output quality degrades on schemas with many tables (> 8โ10); use the intermediate layer to break complexity.
License
Apache 2.0 โ same as the base Qwen3-4B model.
Fine-tuned and converted to GGUF using Unsloth.
- Downloads last month
- 38
4-bit
5-bit
8-bit
Model tree for tdelard/Qwen3-4B-DBT-Instruct-GGUF
Base model
Qwen/Qwen3-4B-Instruct-2507
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tdelard/Qwen3-4B-DBT-Instruct-GGUF to start chatting