Instructions to use Bhuvandesai/phi3-text-to-sql-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Bhuvandesai/phi3-text-to-sql-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Bhuvandesai/phi3-text-to-sql-gguf", filename="phi3-text-to-sql-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Bhuvandesai/phi3-text-to-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 Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf Bhuvandesai/phi3-text-to-sql-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 Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf Bhuvandesai/phi3-text-to-sql-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 Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Bhuvandesai/phi3-text-to-sql-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 Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
Use Docker
docker model run hf.co/Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Bhuvandesai/phi3-text-to-sql-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bhuvandesai/phi3-text-to-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": "Bhuvandesai/phi3-text-to-sql-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
- Ollama
How to use Bhuvandesai/phi3-text-to-sql-gguf with Ollama:
ollama run hf.co/Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
- Unsloth Studio
How to use Bhuvandesai/phi3-text-to-sql-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 Bhuvandesai/phi3-text-to-sql-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 Bhuvandesai/phi3-text-to-sql-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Bhuvandesai/phi3-text-to-sql-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Bhuvandesai/phi3-text-to-sql-gguf with Docker Model Runner:
docker model run hf.co/Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
- Lemonade
How to use Bhuvandesai/phi3-text-to-sql-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Bhuvandesai/phi3-text-to-sql-gguf:Q4_K_M
Run and chat with the model
lemonade run user.phi3-text-to-sql-gguf-Q4_K_M
List all available models
lemonade list
Phi-3-mini Text-to-SQL — GGUF (quantized for CPU)
Quantized GGUF builds of the fine-tuned Phi-3-mini Text-to-SQL model (LoRA already merged into the base weights), for fast CPU inference with llama.cpp.
| File | Size | Effective bits/weight | vs f16 |
|---|---|---|---|
phi3-text-to-sql-Q4_K_M.gguf ⭐ recommended |
2.40 GB | 5.01 | −68.6% (3.2× smaller) |
phi3-text-to-sql-Q5_K_M.gguf |
2.76 GB | 5.76 | −64.0% (2.8× smaller) |
Note: "Q4" K-quants average ~5 effective bits/weight (embeddings and some tensors stay higher-precision), so the file is larger than a literal 4-bit×params calculation.
Which one?
Use Q4_K_M. On this task it matched Q5_K_M on quality while being smaller and faster.
Benchmarks (measured)
CPU = Intel i7-13650HX, 14 threads, llama-bench, build 9637:
| Model | Prompt processing (pp256) | Token generation (tg64) |
|---|---|---|
| Q4_K_M | 91.4 tok/s | 20.1 tok/s |
| Q5_K_M | 59.6 tok/s | 18.5 tok/s |
Task quality (12 held-out questions, execution-match against a live SQLite DB):
| Model | Execution-match | Valid SQL |
|---|---|---|
| Q4_K_M | 75.0% | 100% |
| Q5_K_M | 75.0% | 100% |
4-bit quantization cost no measurable task accuracy vs 5-bit here.
Run it
# CLI
llama-cli -m phi3-text-to-sql-Q4_K_M.gguf -p "<|user|>\n<schema + question><|end|>\n<|assistant|>\n" -n 150 --temp 0
# Server (OpenAI-compatible)
llama-server -m phi3-text-to-sql-Q4_K_M.gguf -c 2048 -t 14 --port 8080
The model expects Phi-3 chat formatting; include the database schema in the user turn (see the adapter card for the exact prompt). It outputs raw SQLite.
License: MIT.
- Downloads last month
- 289
4-bit
5-bit
Model tree for Bhuvandesai/phi3-text-to-sql-gguf
Base model
microsoft/Phi-3-mini-4k-instruct