Instructions to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF", filename="qwen-3-4b-thinking-2004-checkpoint-1500-merged-BF16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16 # Run inference directly in the terminal: llama-cli -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16 # Run inference directly in the terminal: llama-cli -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-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 Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16 # Run inference directly in the terminal: ./llama-cli -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-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 Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
Use Docker
docker model run hf.co/Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
- LM Studio
- Jan
- Ollama
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with Ollama:
ollama run hf.co/Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
- Unsloth Studio
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-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 Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-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 Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF to start chatting
- Pi
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
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": "Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-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 Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with Docker Model Runner:
docker model run hf.co/Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
- Lemonade
How to use Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF:BF16
Run and chat with the model
lemonade run user.Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF-BF16
List all available models
lemonade list
Qwen3-4B-Thinking-2507 Text-to-SQL Agent FT GGUF
This repository contains GGUF exports of the fine-tuned Qwen3-4B-Thinking-2507 Text-to-SQL agent model. It is intended for local inference with llama.cpp, LM Studio, or another OpenAI-compatible local server.
Code and reproducibility repository:
https://github.com/Boakpe/distilled-slms-for-text-to-sql-pt-br
Related collection:
https://huggingface.co/collections/Boakpe/distilled-slms-for-text-to-sql-pt-br
Recommended File
Use the Q8_0 GGUF for most local runs. It is the practical default because it is much smaller than BF16 while preserving strong behavior for this task.
Available variants on the model page:
| Quantization | Approx. size | Suggested use |
|---|---|---|
| Q8_0 | 4.28 GB | Recommended local default |
| BF16 | 8.05 GB | Higher precision, more memory |
Run with llama.cpp
Install or build llama.cpp:
https://github.com/ggml-org/llama.cpp
Download the Q8_0 model:
uvx --from huggingface-hub hf download \
Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF \
qwen-3-4b-thinking-2004-checkpoint-1500-merged-Q8_0.gguf \
--local-dir models
Start an OpenAI-compatible server:
SERVER_BIN="${SERVER_BIN:-llama.cpp/build/bin/llama-server}"
MODEL_PATH="${MODEL_PATH:-models/qwen-3-4b-thinking-2004-checkpoint-1500-merged-Q8_0.gguf}"
CTX_SIZE="${CTX_SIZE:-37000}"
N_GPU_LAYERS="${N_GPU_LAYERS:-999}"
N_PARALLEL="${N_PARALLEL:-1}"
THREADS="$(nproc --all 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 8)"
"$SERVER_BIN" \
--model "$MODEL_PATH" \
--ctx-size "$CTX_SIZE" \
--n-gpu-layers "$N_GPU_LAYERS" \
--threads "$THREADS" \
--threads-batch "$THREADS" \
--parallel "$N_PARALLEL" \
--flash-attn on \
--mlock \
--no-mmap \
--cont-batching \
--batch-size 512 \
--ubatch-size 512 \
--host 127.0.0.1 \
--port 8080 \
--alias text2sql \
--temp 0.6 \
--top-p 0.95 \
--top-k 20
Then run the agent from the GitHub repository with a model entry pointing to:
provider: openai
model_name: text2sql
api_key: lmstudio
base_url: http://localhost:8080/v1
tool_choice: auto
Easier Setup with LM Studio
LM Studio can also serve GGUF models through a local OpenAI-compatible API:
Load the Q8_0 GGUF, start the local server, and set the model name and port in agent/config/models.yaml.
Results
These are the same model weights as the safetensors model, exported to GGUF.
Primary environmental-registry benchmark:
| Model | Overall | Strict SQL | Relaxed SQL | Non-SQL | Clarification | Unanswerable |
|---|---|---|---|---|---|---|
| Qwen3-4B-Thinking-2507 base | 56.1 | 28.9 | 36.7 | 75.6 | 71.1 | 80.0 |
| Qwen3-4B-Thinking FT | 78.9 | 34.4 | 70.0 | 87.8 | 86.7 | 88.9 |
Pass@5 for the fine-tuned model reached 91.7% overall, 87.8% relaxed SQL, and 95.6% non-SQL.
On rede_saude_publica, the fine-tuned model reached 75.0% overall, 72.0% SQL, and 78.0% non-SQL.
Notes
- Use a recent
llama.cppbuild. Tool-calling and chat-template handling matter for this agent. - If you run CPU-only, set
N_GPU_LAYERS=0. - Increase
--parallelonly if you need concurrent requests and have enough memory for the KV cache. - The model is intended for the released agent protocol, not standalone production database access.
License
Apache 2.0.
- Downloads last month
- -
8-bit
16-bit
Model tree for Boakpe/Qwen3-4B-Thinking-2507-Text-to-SQL-Agent-FT-GGUF
Base model
Qwen/Qwen3-4B-Thinking-2507