defog·LlamaForCausalLM

Sqlcoder 7B 2 — Hardware Requirements & GPU Compatibility

ChatCode

SQLCoder 7B 2 is a 6.7-billion-parameter model from Defog, purpose-built for converting natural-language questions into SQL queries. Fine-tuned specifically on text-to-SQL tasks, it consistently outperforms much larger general-purpose models when the job is generating accurate, executable SQL against real database schemas. For developers and data analysts who regularly query databases, running SQLCoder locally means fast, private SQL generation without sending proprietary schema details to an external API. It works best when provided with table definitions as context and is particularly strong on PostgreSQL, MySQL, and SQLite dialects.

76.7K downloads 421 likesFeb 202416K context

Specifications

Publisher
defog
Parameters
6.7B
Architecture
LlamaForCausalLM
Context Length
16,384 tokens
Vocabulary Size
32,016
Release Date
2024-02-12
License
CC BY-SA 4.0

Get Started

How Much VRAM Does Sqlcoder 7B 2 Need?

Select a quantization to see compatible GPUs below.

QuantizationBitsVRAM
FP1616.0014.8 GB

Which GPUs Can Run Sqlcoder 7B 2?

FP16 · 14.8 GB

Sqlcoder 7B 2 (FP16) requires 14.8 GB of VRAM to load the model weights. For comfortable inference with headroom for KV cache and system overhead, 20+ GB is recommended. Using the full 16K context window can add up to 7.5 GB, bringing total usage to 22.4 GB. 17 GPUs can run it, including NVIDIA GeForce RTX 5090, NVIDIA GeForce RTX 3090 Ti, NVIDIA GeForce RTX 5080.

Which Devices Can Run Sqlcoder 7B 2?

FP16 · 14.8 GB

27 devices with unified memory can run Sqlcoder 7B 2, including NVIDIA DGX H100, NVIDIA DGX A100 640GB, Mac Mini M4 (16 GB).

Related Models

Frequently Asked Questions

How much VRAM does Sqlcoder 7B 2 need?

Sqlcoder 7B 2 requires 14.8 GB of VRAM at FP16. Full 16K context adds up to 7.5 GB (22.4 GB total).

VRAM = Weights + KV Cache + Overhead

Weights = 6.7B × 16 bits ÷ 8 = 13.5 GB

KV Cache + Overhead 1.3 GB (at 2K context + ~0.3 GB framework)

KV Cache + Overhead 8.9 GB (at full 16K context)

VRAM usage by quantization

14.8 GB
22.4 GB

Learn more about VRAM estimation →

Can I run Sqlcoder 7B 2 on a Mac?

Sqlcoder 7B 2 requires at least 14.8 GB at FP16, which exceeds the unified memory of most consumer Macs. You would need a Mac Studio or Mac Pro with a high-memory configuration.

Can I run Sqlcoder 7B 2 locally?

Yes — Sqlcoder 7B 2 can run locally on consumer hardware. At FP16 quantization it needs 14.8 GB of VRAM. Popular tools include Ollama, LM Studio, and llama.cpp.

How fast is Sqlcoder 7B 2?

At FP16, Sqlcoder 7B 2 can reach ~196 tok/s on AMD Instinct MI300X. On NVIDIA GeForce RTX 4090: ~44 tok/s. Speed depends mainly on GPU memory bandwidth. Real-world results typically within ±20%.

tok/s = (bandwidth GB/s ÷ model GB) × efficiency

Example: AMD Instinct MI300X5300 ÷ 14.8 × 0.55 = ~196 tok/s

Estimated speed at FP16 (14.8 GB)

~196 tok/s
~44 tok/s
~147 tok/s
~121 tok/s

Real-world results typically within ±20%. Speed depends on batch size, quantization kernel, and software stack.

Learn more about tok/s estimation →

What's the download size of Sqlcoder 7B 2?

At FP16, the download is about 13.48 GB.