Instructions to use giangkh19/qwen3.5-4b-sql-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 giangkh19/qwen3.5-4b-sql-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 giangkh19/qwen3.5-4b-sql-gguf:BF16 # Run inference directly in the terminal: llama cli -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf giangkh19/qwen3.5-4b-sql-gguf:BF16 # Run inference directly in the terminal: llama cli -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
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 giangkh19/qwen3.5-4b-sql-gguf:BF16 # Run inference directly in the terminal: ./llama-cli -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
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 giangkh19/qwen3.5-4b-sql-gguf:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
Use Docker
docker model run hf.co/giangkh19/qwen3.5-4b-sql-gguf:BF16
- LM Studio
- Jan
- vLLM
How to use giangkh19/qwen3.5-4b-sql-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "giangkh19/qwen3.5-4b-sql-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "giangkh19/qwen3.5-4b-sql-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/giangkh19/qwen3.5-4b-sql-gguf:BF16
- Ollama
How to use giangkh19/qwen3.5-4b-sql-gguf with Ollama:
ollama run hf.co/giangkh19/qwen3.5-4b-sql-gguf:BF16
- Unsloth Desktop
- Pi
How to use giangkh19/qwen3.5-4b-sql-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "giangkh19/qwen3.5-4b-sql-gguf:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use giangkh19/qwen3.5-4b-sql-gguf with Docker Model Runner:
docker model run hf.co/giangkh19/qwen3.5-4b-sql-gguf:BF16
- Lemonade
How to use giangkh19/qwen3.5-4b-sql-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull giangkh19/qwen3.5-4b-sql-gguf:BF16
Run and chat with the model
lemonade run user.qwen3.5-4b-sql-gguf-BF16
List all available models
lemonade list
- Hermes Agent
How to use giangkh19/qwen3.5-4b-sql-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 giangkh19/qwen3.5-4b-sql-gguf:BF16
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 giangkh19/qwen3.5-4b-sql-gguf:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use giangkh19/qwen3.5-4b-sql-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf giangkh19/qwen3.5-4b-sql-gguf:BF16
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 "giangkh19/qwen3.5-4b-sql-gguf:BF16" \ --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"
Qwen3.5-4B-Text2SQL: DeepSeek-Style Reasoning & Multi-Table Specialist (GGUF & LoRA)
Mô hình chuyên sâu về Text-to-SQL phức tạp, được fine-tune từ Qwen/Qwen3.5-4B bằng công nghệ QLoRA 4-bit (Unsloth) trên tập dữ liệu tuyển chọn 17.000 mẫu nâng cao (kết hợp từ Gretel AI, Spider, và BIRD-Bench).
Mô hình hỗ trợ Native Reasoning (<think> ... </think>), tự động suy luận cấu trúc bảng, liên kết khóa ngoại và điều kiện logic trước khi sinh câu lệnh SQL chuẩn SQLite.
🚀 Cách Chạy Nhanh Bằng Ollama (1 Dòng Lệnh)
Không cần tải file thủ công, Ollama hỗ trợ kéo trực tiếp từ Hugging Face:
ollama run hf.co/giangkh19/qwen3.5-4b-sql-gguf:Q4_K_M
Yêu cầu phần cứng: Chạy siêu mượt trên máy tính cá nhân (chỉ cần 4GB VRAM GPU như GTX 1650 hoặc 8GB RAM nếu chạy CPU).
🎯 Cấu Trúc Prompt Chuẩn (ChatML Format)
<|im_start|>system
You are a SQLite expert. Given the database schema, write the correct SQL query.
### DATABASE SCHEMA:
CREATE TABLE customers (id INT PRIMARY KEY, name TEXT, tier TEXT);
CREATE TABLE orders (order_id INT, customer_id INT, amount REAL, FOREIGN KEY(customer_id) REFERENCES customers(id));
<|im_end|>
<|im_start|>user
Find top 3 VIP customers with total spent over 500?
<|im_end|>
<|im_start|>assistant
<think>
1. Identify target tables: 'customers' and 'orders'.
2. Join condition: customers.id = orders.customer_id.
3. Filter conditions: tier = 'VIP'.
4. Aggregation: SUM(amount) grouped by customers.id having sum > 500.
5. Sort descending and limit to 3.
</think>
SELECT c.name, SUM(o.amount) AS total_spent
FROM customers c
JOIN orders o ON c.id = o.customer_id
WHERE c.tier = 'VIP'
GROUP BY c.id, c.name
HAVING total_spent > 500
ORDER BY total_spent DESC
LIMIT 3;
<|im_end|>
📊 Đặc Điểm Tập Dữ Liệu Huấn Luyện (17.000 Mẫu Khó)
Đã loại bỏ 100% các câu đơn giản (1 bảng). Toàn bộ dữ liệu được chọn lọc khắt khe:
- Multi-table JOINs (70%+): Liên kết khóa ngoại từ 2 đến 4 bảng lồng nhau.
- Multi-conditions: Tối thiểu 2 điều kiện lọc logic (
AND/OR), xử lý ngày tháng (strftime), tính toán tỷ lệ. - Hàm nâng cao:
GROUP BY,HAVING,CASE WHEN,UNION,EXCEPT,WINDOW functionsvàCTEs.
⚙️ Cấu Hình Fine-Tuning (Unsloth QLoRA)
- Base Model:
Qwen/Qwen3.5-4B(4-bit NF4 Quantization) - LoRA Parameters: Rank $r = 16$, $lpha = 32$, Target 7 modules (
q, k, v, o, gate, up, down) - Loss Masking:
train_on_responses_only(chỉ tính điểm phạt trên câu lệnh SQL, không phạt trên Schema) - Hardware: Huấn luyện trên NVIDIA RTX 3080 Ti (12GB) với BF16 native trong ~2 giờ.
- Final Loss: Đạt mức ~0.35 (Loss cực kỳ đẹp, không overfitting).
- Downloads last month
- 131
4-bit