GP

Gpt2 Medium

GptGGUF by mradermacherUpdated 2024-09-08
Download on Hugging Face
Parameters406M
Context1K
Layers24
Architecturegpt2
Smallest quant0.1 GB
Quick answer

Gpt2 Medium needs about 1.6 GB of memory at Q4_K_M (a 0.3 GB file) with an 8K context window, so it fits on a 4 GB GPU. This repository has 24 quants, from 0.1 GB (IQ1_S) to 0.3 GB (Q6_K).

GPT‑2 Medium in GGUF format

GPT‑2 Medium is a 355M‑parameter transformer language model. The GGUF version is quantized by mradermacher and available under the MIT license. It supports English text generation with a 1024‑token context window.

Good at

  • Text completion
  • Grammar assistance
  • Creative writing

Limits

  • No vision support
  • Limited to 1024‑token context
  • Requires 8‑k context for memory estimates

Best for

  • Chatbot prototypes
  • Autocompletion in IDEs
  • Poetry generation

Who it’s for. Researchers and developers who need a lightweight GPT‑2 variant for experimentation or low‑resource deployment. The model is suitable for those who prefer open‑source, MIT‑licensed models.

Quants & memory

QuantFileEst. memoryvs VRAMResultDownload
IQ1_S0.1 GB 0.7 GB
Fits Get file →
IQ1_M0.1 GB 0.7 GB
Fits Get file →
IQ2_XXS0.1 GB 0.7 GB
Fits Get file →
IQ2_XS0.1 GB 0.7 GB
Fits Get file →
IQ2_S0.2 GB 0.8 GB
Fits Get file →
IQ2_M0.2 GB 0.8 GB
Fits Get file →
Q2_K0.2 GB 0.8 GB
Fits Get file →
IQ3_XXS0.2 GB 0.8 GB
Fits Get file →
IQ3_XS0.2 GB 0.8 GB
Fits Get file →
IQ3_S0.2 GB 0.8 GB
Fits Get file →
Q3_K_S0.2 GB 0.8 GB
Fits Get file →
IQ3_M0.2 GB 0.8 GB
Fits Get file →
Q3_K_M0.2 GB 0.8 GB
Fits Get file →
IQ4_XS0.2 GB 0.8 GB
Fits Get file →
Q3_K_L0.2 GB 0.8 GB
Fits Get file →
Q4_00.2 GB 0.8 GB
Fits Get file →
Q4_00.2 GB 0.8 GB
Fits Get file →
Q4_00.2 GB 0.8 GB
Fits Get file →
Q4_00.2 GB 0.8 GB
Fits Get file →
Q4_K_S0.2 GB 0.9 GB
Fits Get file →
Q4_K_M0.3 GB 0.9 GB
Fits Get file →
Q5_K_S0.3 GB 0.9 GB
Fits Get file →
Q5_K_M0.3 GB 0.9 GB
Fits Get file →
Q6_K0.3 GB 0.9 GB
Fits Get file →

For 8‑GB VRAM, use IQ1_S (0.12 GB) or IQ1_M (0.13 GB). If 16‑GB VRAM is available, Q4_0 (0.25 GB) or Q4_K_M (0.27 GB) offer a balance of size and quality. Larger quants such as Q6_K (0.34 GB) provide higher fidelity but need more memory.

What GPU do you need for Gpt2 Medium?

These figures add the file size, an fp16 KV cache at an 8K context window (worked out from this model’s own header) and about 0.5 GB for the runtime. They are estimates, so leave a little headroom, and expect to use less context or a smaller quant if you are right at the limit.

  • 4 GB VRAM: the best quant that fits is Q6_K (0.3 GB file, about 1.6 GB in use).

Which Gpt2 Medium quant should you choose?

Q4_K_M is the usual starting point for Gpt2 Medium: it balances file size and quality well. Here it is a 0.3 GB file.

If memory is tight, the smallest file is IQ1_S at 0.1 GB, with the quality trade-offs that come with fewer bits. Use it only when memory is very tight. Expect a clear drop in quality, which is usually worse on small models and easier to live with on large ones.

New to quant names? Read GGUF quantization explained.

Specifications

Architecture from the GGUF header

Architecturegpt2
Parameters406M
Layers24
Trained context1,024 tokens
KV cache (fp16)96 KB per token

Source

Quantized bymradermacher
FamilyGpt
Licensemit
Downloads (HF)4,610
Last updated2024-09-08

Frequently asked questions about Gpt2 Medium

How much VRAM does Gpt2 Medium need?

About 1.6 GB at Q4_K_M with an 8K context window. That is the 0.3 GB file, plus the KV cache and roughly 0.5 GB of runtime overhead. Smaller quants need less and longer context needs more.

Can I run Gpt2 Medium on an 8 GB GPU?

Yes, with Q6_K: the 0.3 GB file needs about 1.6 GB at 8K context. Larger quants in this repository do not fit in 8 GB.

What is the file size of Gpt2 Medium GGUF?

It depends on the quant: IQ1_S is 0.1 GB, IQ1_M is 0.1 GB, IQ2_XXS is 0.1 GB, IQ2_XS is 0.1 GB, IQ2_S is 0.2 GB, IQ2_M is 0.2 GB and 18 more.

What context length does Gpt2 Medium support?

The GGUF header lists a trained context length of 1,024 tokens (1K). The KV cache grows with the context you use: about 0.8 GB at 8K and 0.1 GB at 1K.

Where can I download Gpt2 Medium GGUF?

The files are on Hugging Face in the mradermacher/gpt2-medium-i1-GGUF repository. The download buttons on this page open the file on Hugging Face. ggufmodels.com does not host any model files.

What license does Gpt2 Medium use?

Hugging Face lists the license as mit. Licenses can differ between the quantized files and the original model, so check the repository and the base model before commercial use.

Can I run GPT‑2 Medium on 8 GB VRAM?

Yes, using IQ1_S or IQ1_M quants will fit within 8 GB VRAM, with estimated memory usage of 1.4 GB at 8k context.

Does this model support multiple languages?

The model is trained on English only; no other languages are supported.

What license applies to the GGUF files?

The files are released under the MIT license.

Other GGUFs of gpt2-medium

Similar models

Browse all →

More from mradermacher

All by mradermacher →

More Gpt models

All Gpt →

Other tiny models

All tiny models →