Instructions to use loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use loftytechlabsdev/Caden-SQL-1.5B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "loftytechlabsdev/Caden-SQL-1.5B-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": "loftytechlabsdev/Caden-SQL-1.5B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
- Ollama
How to use loftytechlabsdev/Caden-SQL-1.5B-GGUF with Ollama:
ollama run hf.co/loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
- Unsloth Studio
How to use loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for loftytechlabsdev/Caden-SQL-1.5B-GGUF to start chatting
- Pi
How to use loftytechlabsdev/Caden-SQL-1.5B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf loftytechlabsdev/Caden-SQL-1.5B-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": "loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use loftytechlabsdev/Caden-SQL-1.5B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf loftytechlabsdev/Caden-SQL-1.5B-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 "loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF with Docker Model Runner:
docker model run hf.co/loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
- Lemonade
How to use loftytechlabsdev/Caden-SQL-1.5B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Caden-SQL-1.5B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-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 loftytechlabsdev/Caden-SQL-1.5B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
🚀 Caden SQL (1.5B) - Text-to-SQL AI
Caden is a highly specialized, localized Artificial Intelligence designed to convert natural language questions into complex, production-ready SQL queries. It was built by fine-tuning the powerful Qwen2.5-Coder-1.5B-Instruct model on the extensive Spider dataset using Unsloth.
By utilizing 4-bit GGUF quantization, Caden is designed to be completely offline and privacy-first. You can query your private company databases locally on a standard laptop without ever sending your sensitive database schema to cloud APIs like OpenAI or Anthropic.
📊 Model Architecture & Details
- Base Model:
Qwen/Qwen2.5-Coder-1.5B-Instruct - Parameters: 1.5 Billion
- Format: GGUF (
Q4_K_MQuantized) - Training Framework: Unsloth (Fast LoRA adapters, successfully merged)
- Context Length: 32,768 tokens (Capable of ingesting massive database schemas!)
🧠 Capabilities
Unlike basic SQL generators that only output SELECT * FROM table, Caden has been aggressively fine-tuned to master complex relationships:
- Advanced Joins: Seamlessly traverses foreign keys and uses
LEFT JOINandINNER JOINappropriately. - Correlated Subqueries: Can nest queries dynamically (
WHERE salary > (SELECT AVG(salary) FROM...)). - Analytical Window Functions: Excels at
RANK(),ROW_NUMBER(), andPARTITION BY. - Set Operations: Fluidly handles
INTERSECT,EXCEPT, andUNION. - Conversational Awareness: Caden is trained to converse naturally when greeted, but strictly outputs SQL blocks when requested.
🛠️ Prompt Format (ChatML)
The model expects inputs formatted in ChatML with a specific structured template:
[
{
"role": "system",
"content": "You are Caden, an expert SQL engineer and helpful database assistant. Your primary task is to write single, accurate, and efficient SQL queries based on the given database schema and user questions."
},
{
"role": "user",
"content": "### Database Schema DDL:\nCREATE TABLE head (age INT, name VARCHAR(20));\n\n### User Request:\nFind names of heads whose age is older than 50.\n\nGenerate the SQL query that answers the user request."
}
]
Response Example:
SELECT name FROM head WHERE age > 50;
💻 Getting Started & Usage
1. Running Locally with Ollama (Recommended)
Ollama is the fastest way to run Caden on MacOS, Windows, or Linux.
- Download the
caden-sql-1.5b-q4_k_m.gguffile from the Files tab. - Create a file named
Modelfilein the same folder with this configuration:
FROM ./caden-sql-1.5b-q4_k_m.gguf
SYSTEM """You are Caden, an expert SQL engineer and helpful database assistant. Your primary task is to write single, accurate, and efficient SQL queries based on the given database schema and user questions.
Follow these strict rules when the user asks for data or a query:
1. Generate valid SQL syntax only.
2. Use ONLY the table and column names present in the provided schema DDL.
3. Carefully observe foreign key relationships when performing JOIN operations.
4. Unless explicitly requested by the user, only produce read-only queries (SELECT).
5. Provide your SQL query enclosed in a single ```sql ... ``` block.
If the user asks a general conversational question, respond conversationally and naturally without generating SQL."""
- Build and register the model with Ollama:
ollama create caden-sql -f Modelfile - Query the model in your terminal:
ollama run caden-sql
2. Running via Hugging Face Transformers (Python)
If you are using the unquantized or merged weights directly via Python:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "loftytechlabsdev/Caden-SQL-1.5B"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Format the message using ChatML
messages = [
{
"role": "system",
"content": "You are Caden, an expert SQL engineer and helpful database assistant. Your primary task is to write single, accurate, and efficient SQL queries based on the given database schema and user questions."
},
{
"role": "user",
"content": "### Database Schema DDL:\nCREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(50), city VARCHAR(50));\n\n### User Request:\nHow many customers are from London?\n\nGenerate the SQL query that answers the user request."
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, use_cache=True)
response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)
📈 Training Details & Hyperparameters
- Base Model:
unsloth/Qwen2.5-Coder-1.5B-Instruct - Method: QLoRA (4-bit quantization, rank
r = 16,lora_alpha = 16) - Dataset:
xlangai/spider/philikai/SQL_Spider_DDL(containing 10,000+ text-to-SQL alignment examples) - Optimizer:
adamw_8bit - Learning Rate:
2e-4 - Scheduler:
linear - Weight Decay:
0.01 - Batch Size: 4 per device, 4 gradient accumulation steps (Effective batch size = 16)
- Training Steps: 200 SFT steps (tuned to prevent overfitting while maintaining high zero-shot SQL validation accuracy)
📝 Release Notes (v1.0)
- Initial Release: First highly capable 1.5B-parameter SQL generation model.
- Focus: Mastered Spider dataset benchmarks, including:
- Correlated Subqueries
- Set Operations
- Window Functions
- Future Roadmap (v2.0): Plans to scale up to a 7B-parameter model and support more complex real-world database schemas and advanced SQL query patterns.
⚠️ Limitations & Bias
- Database Engine: Primarily trained and evaluated on general SQLite/ANSI SQL. Syntaxes specific to PostgreSQL, MSSQL, or Oracle may require small manual adjustments or specialized fine-tuning.
- Query Complexity: Excellent for joins, subqueries, group by, and aggregate operations. Highly complex recursive CTEs or vendor-specific window functions may occasionally require manual corrections.
📜 License
This project is released under the Apache 2.0 License, adhering to the base model guidelines of the Qwen series.
- Downloads last month
- -
4-bit
Model tree for loftytechlabsdev/Caden-SQL-1.5B-GGUF
Base model
Qwen/Qwen2.5-1.5B