sqlcoder-7b-2
defogcc-by-sa-4.0text

sqlcoder-7b-2

Updated Nov 23, 2026
Parameters
6.7B
Context
16,384
License
cc-by-sa-4.0
Q4 GGUF
4.08 GB
Updated
Nov 23, 2026

Q4 GGUF download: MaziyarPanahi/sqlcoder-7b-2-GGUF - 4.08 GB on disk, read 2026-11-13. VRAM figures above are estimates; this is the actual file size.

Will it run on your hardware?

Pick your GPU memory - see which quantizations fit, and the cheapest card for the rest

Runs on your 24 GB - best at FP16
4 of 4 quantizations fit sqlcoder-7b-2 with real runtime overhead.
Q4_K_M
4 GB
Q5_K_M
5 GB
Q8_0
7 GB
FP16
13 GB
fits tight too big

Need an exact figure for your context length? Use the VRAM calculator.

Run it locally

Copy-paste - running in under a minute

vLLMOpenAI-compatible API
vllm serve defog/sqlcoder-7b-2

New to this? Start with Ollama · serve to many users with vLLM.

Deep dive

Notes, sources, and the full write-up

sqlcoder-7b-2 is a 6.7B-parameter cc-by-sa-4.0 model from defog. At Q4_K_M it needs roughly 4 GB of VRAM, placing it in the CPU / ≤4 GB hardware tier.

PopularityLink to this section

sqlcoder-7b-2 has 418,804 downloads in the last month on HuggingFace and 452 likes.

From the community

What users are saying

“I think maybe we can use another text-to-text llm model for fixing non-sqllite command. With this extra layer sql sentences could be suitable for sqllite.”

“Ah, thanks very much for raising this! This is a blindspot in our training data for the 7b model, and it's consistently getting this wrong. We'll get a fix out in the next few days. The [34b model](https://defog.ai/sqlcoder-demo/) seems to handle this fine – but the 7b bugs out with your second questions.”

“Hi @Ammad1Ali , the model's instruction following abilities is not fool-proof. Would you mind sharing your prompt here for us to reproduce the issue? If it contains sensitive data, please feel free to email us at support@defog.ai and we'll do our best to fix the issue in the next model release.”

Frequently asked

Quick answers to common questions

How much VRAM does sqlcoder-7b-2 need?

sqlcoder-7b-2 with 6.7B parameters needs approximately 4 GB at Q4_K_M quantization. Use our VRAM calculator for an exact estimate.

Is sqlcoder-7b-2 better than other defog models?

sqlcoder-7b-2 has 6.7B parameters with 16,384 context - a strong choice for coding.

What license is sqlcoder-7b-2 under?

sqlcoder-7b-2 is released under the cc-by-sa-4.0 license, making it suitable for most commercial and personal projects.

What hardware runs sqlcoder-7b-2 well?

With 6.7B parameters, sqlcoder-7b-2 requires adequate VRAM. High-end GPUs like the RTX 4090 (24GB), RTX 5090 (32GB), or Mac Studio with unified memory are good options. Check our hardware directory for specific recommendations.

What is the best quantization for sqlcoder-7b-2?

Q4_K_M is the recommended sweet spot - ~98% of FP16 quality at ~27% of the size. Q5_K_M (~5 GB) is an option if you have spare VRAM. Use our VRAM calculator to compare.

What models compete with sqlcoder-7b-2?

sqlcoder-7b-2 competes with other models in its class. Browse our model directory for comparisons, benchmarks, and community reviews to find the best fit.

Nearby options

Similar models and compatible hardware by spec