How to use from
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 omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf omeryentur/llama-3-sqlcoder-8b-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 omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf omeryentur/llama-3-sqlcoder-8b-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 omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
# Run inference directly in the terminal:
./llama-cli -hf omeryentur/llama-3-sqlcoder-8b-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 omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/omeryentur/llama-3-sqlcoder-8b-GGUF:Q4_K_M
Quick Links

llama-3-sqlcoder-8b โ€” GGUF

GGUF (llama.cpp) build of defog/llama-3-sqlcoder-8b, a Llama-3 8B model fine-tuned for text-to-SQL generation. This repo packages a Q4_K_M quantization so the model runs efficiently on CPU/GPU through llama.cpp, Ollama, LM Studio, and other GGUF-compatible runtimes.

Files

File Quant Approx. size Notes
llama-3-sqlcoder-8b.Q4_K_M.gguf Q4_K_M ~4.9 GB 4-bit, good quality/size trade-off

Usage

llama.cpp

./llama-cli -m llama-3-sqlcoder-8b.Q4_K_M.gguf -p "Generate a SQL query to answer the question."

Ollama (Modelfile)

FROM ./llama-3-sqlcoder-8b.Q4_K_M.gguf

Python (llama-cpp-python)

from llama_cpp import Llama

llm = Llama.from_pretrained(
    repo_id="omeryentur/llama-3-sqlcoder-8b-GGUF",
    filename="llama-3-sqlcoder-8b.Q4_K_M.gguf",
)
out = llm("### Task\nGenerate a SQL query to answer the question.\n### Question\nHow many users signed up in 2024?\n### SQL\n")
print(out["choices"][0]["text"])

Use the prompt format expected by the base defog/llama-3-sqlcoder-8b model for best results.

Credits

See more text-to-SQL work on this profile, including the Text-to-PostgreSQL dataset.

Downloads last month
172
GGUF
Model size
8B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for omeryentur/llama-3-sqlcoder-8b-GGUF

Quantized
(42)
this model

Collection including omeryentur/llama-3-sqlcoder-8b-GGUF