Instructions to use thxlxn/qwen3.5-0.8b-sql 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 thxlxn/qwen3.5-0.8b-sql 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 thxlxn/qwen3.5-0.8b-sql:F16 # Run inference directly in the terminal: llama cli -hf thxlxn/qwen3.5-0.8b-sql:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf thxlxn/qwen3.5-0.8b-sql:F16 # Run inference directly in the terminal: llama cli -hf thxlxn/qwen3.5-0.8b-sql:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf thxlxn/qwen3.5-0.8b-sql:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf thxlxn/qwen3.5-0.8b-sql:F16
Use Docker
docker model run hf.co/thxlxn/qwen3.5-0.8b-sql:F16
- Llama new
- LM Studio
- Jan
- Ollama
How to use thxlxn/qwen3.5-0.8b-sql with Ollama:
ollama run hf.co/thxlxn/qwen3.5-0.8b-sql:F16
- Unsloth Desktop
- Pi
How to use thxlxn/qwen3.5-0.8b-sql with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf thxlxn/qwen3.5-0.8b-sql:F16
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": "thxlxn/qwen3.5-0.8b-sql:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use thxlxn/qwen3.5-0.8b-sql with Docker Model Runner:
docker model run hf.co/thxlxn/qwen3.5-0.8b-sql:F16
- Lemonade
How to use thxlxn/qwen3.5-0.8b-sql with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull thxlxn/qwen3.5-0.8b-sql:F16
Run and chat with the model
lemonade run user.qwen3.5-0.8b-sql-F16
List all available models
lemonade list
- Hermes Agent
How to use thxlxn/qwen3.5-0.8b-sql with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf thxlxn/qwen3.5-0.8b-sql:F16
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 thxlxn/qwen3.5-0.8b-sql:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use thxlxn/qwen3.5-0.8b-sql with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf thxlxn/qwen3.5-0.8b-sql:F16
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 "thxlxn/qwen3.5-0.8b-sql:F16" \ --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"
GitHub Repo of the Pipeline
By using Qwen 3.5 9B as a teacher, a Qwen 3.5 0.8B student was fine-tuned for Text-to-SQL operations, recovering 95% of the teacher's accuracy while resolving multi-table JOIN hallucinations and running 2.3x faster.

Overview
Initial baseline testing of the Qwen 3.5 0.8B model on Text-to-SQL generation revealed a significant bottleneck: 72% of its failures were no_such_column errors when attempting multi-table JOIN operations.
The Goal:
Build an automated knowledge distillation pipeline to transfer complex, multi-table schema reasoning from a 9B parameter teacher model into a 0.8B parameter student model, achieving high execution validity while maintaining low VRAM usage and latency.
Pipeline
- Teacher Model:
qwen3.5:9b(Ollama) - Student Model:
qwen3.5:0.8b(Unsloth) - Base Dataset:
b-mc2/sql-create-context - Training Framework: PyTorch & Unsloth (16-bit LoRA)
1. Procedural Data Distillation (src/1_generate_dataset.py)
The base dataset was filtered to strictly contain complex schemas requiring at least one JOIN operation (2,001 total rows). The Teacher model generated SQL for 1,698 training rows. Importantly, an automated SQLite verification step was implemented to execute the Teacher's outputs against the schema, rejecting 268 invalid queries and ending up with 1,430 verified training examples.
2. Fine-Tuning (src/3_train_lora.ipynb)
The verified JSONL dataset was used to fine-tune the 0.8B Student using Unsloth (LoRA, r=16, alpha=32). The model was trained for 3 epochs (270 steps) with a cosine learning rate scheduler and an adamw_8bit optimizer, then merged and exported to a 16-bit GGUF format for local serving.
Benchmark Results
Evaluated against an unseen test pool of 303 multi-table queries. Accuracy is defined by successful and valid execution against an SQLite database matching the provided DDL schema.
| Model | Parameters | Valid SQL Execution | Avg Latency | Column Hallucinations |
|---|---|---|---|---|
| Qwen 3.5 (Student) | 0.8B | 50.50% (153/303) | ~209 ms | 108 |
| Qwen 3.5 (Teacher) | 9B | 84.49% (256/303) | ~601 ms | 20 |
| Qwen 3.5-SQL (Distilled) | 0.8B | 82.84% (251/303) | ~257 ms | 24 |
Key Takeaways:
- Hallucination Resolution: Schema-grounded distillation successfully reduced
no_such_columnerrors by 78%. - Pareto Efficiency: The distilled student matches the 9B teacher's execution rate (within 5 queries) while running 2.34x faster.
license: apache-2.0
- Downloads last month
- 31
16-bit