SAVRN
Search Contact SAVRN

Open-weight model · Text generation

gpt2

by OpenAI community openai-community/gpt2

Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in and first released at this page. model.

Parameters137M
Context
Weights5.6 GB
Licensemit
AccessOpen weights
Monthly Downloads15.4M

Runs On

What it takes to serve gpt2 (137M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.3 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By OpenAI community, published under mit, revision 607a30d783df.

Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large

Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in this paper and first released at this page.

Disclaimer: The team releasing GPT-2 also wrote a model card for their model. Content from this model card has been written by the Hugging Face team to complete the information they provided and give specific examples of bias.

Model description

GPT-2 is a transformers model pretrained on a very large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences.

Read the full model card (1,065 words)

Configuration

Architecture
GPT2LMHeadModel
Vocabulary size
50,257
Model type
gpt2

Identity and Version

Repository
openai-community/gpt2
Publisher
OpenAI community
Task
Text generation
Modality
Text
Library
transformers
Parameters
137M parameters
Languages
en
Revision
607a30d783dfa663caf39e06633721c8d4cfcd7e
First published
2022-03-02
Last updated
2024-02-19

Files and Weights

26 files, 5.6 GB in total. The weights are 11 files totalling 5.6 GB in bin, h5, msgpack, onnx, ot, safetensors, tflite.

Weights11 files · 5.6 GB
Configuration5 files · 1.9 KB
Tokenizer8 files · 6.2 MB
Documentation1 file · 8.1 KB
Repository1 file · 445 B
Every file
FileTypeSizeSHA-256
64-8bits.tfliteWeights125.2 MB c966da3b7469
64-fp16.tfliteWeights248.3 MB 1ceafd82e733
64.tfliteWeights495.8 MB cfcd510b239d
flax_model.msgpackWeights497.8 MB 192e8257ae9e
model.safetensorsWeights548.1 MB 248dfc391186
onnx/decoder_model.onnxWeights653.7 MB e3fc9615868f
onnx/decoder_model_merged.onnxWeights655.2 MB e6fc046fe5a7
onnx/decoder_with_past_model.onnxWeights653.7 MB 570d958241de
pytorch_model.binWeights548.1 MB 7c5d3f4b8b76
rust_model.otWeights702.5 MB adf0adedbf40
tf_model.h5Weights497.9 MB d08c1307f7df
config.jsonConfiguration665 B
generation_config.jsonConfiguration124 B
onnx/config.jsonConfiguration879 B
onnx/generation_config.jsonConfiguration119 B
onnx/special_tokens_map.jsonConfiguration99 B
README.mdDocumentation8.1 KB
.gitattributesRepository445 B
merges.txtTokenizer456.3 KB
onnx/merges.txtTokenizer456.3 KB
onnx/tokenizer.jsonTokenizer2.1 MB
onnx/tokenizer_config.jsonTokenizer234 B
onnx/vocab.jsonTokenizer798.2 KB
tokenizer.jsonTokenizer1.4 MB
tokenizer_config.jsonTokenizer26 B
vocab.jsonTokenizer1.0 MB

License and Download

License
mit
Access
Open weights, no gate
Download size
5.6 GB
Download from OpenAI community

Released by OpenAI community through its official repository on Hugging Face. Read the license.

Memory Requirements

PrecisionWeights in memory
As published5.6 GB
16-bit0.3 GB
8-bit0.1 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Compare gpt2

Questions About gpt2

How much GPU memory does gpt2 need?

About 0.3 GB at 16-bit and 0.1 GB at 4-bit: the weights (137M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run gpt2 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use gpt2 commercially?

Yes. gpt2 is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

SmolLM2 is a family of compact language models available in three size: 135M, 360M, and 1.7B parameters. They are capable of solving a wide range of tasks while being lightweight enough to run on-device. More details in our paper: https://arxiv.org/abs/2502.02737 SmolLM2 demonstrates significant advances over its predecessor SmolLM1, particularly in instruction following, knowledge, reasoning. The 135M model was trained on 2 trillion tokens using a diverse dataset combination: FineWeb-Edu, DCLM, The Stack, along with new filtered datasets we curated and will release soon. We developed the instruct version through supervised fine-tuning (SFT) using a combination of public datasets and our…

Open weights apache-2.0 135M parameters 8,192 tokens transformers

SmolLM2 is a family of compact language models available in three size: 135M, 360M, and 1.7B parameters. They are capable of solving a wide range of tasks while being lightweight enough to run on-device. More details in our paper https://arxiv.org/abs/2502.02737 SmolLM2 demonstrates significant advances over its predecessor SmolLM1, particularly in instruction following, knowledge, reasoning. The 135M model was trained on 2 trillion tokens using a diverse dataset combination: FineWeb-Edu, DCLM, The Stack, along with new filtered datasets we curated and will release soon. We developed the instruct version through supervised fine-tuning (SFT) using a combination of public datasets and our own…

Open weights apache-2.0 135M parameters 8,192 tokens transformers

Model · Text generation

Haidass-Translate-143M

DALab

English | 中文 A 143M-parameter bidirectional Chinese↔English translation model, instruction-tuned on the Haidass1.5-143M base — the strongest zh⇄en translator at this scale among general chat-architecture models. Drafter-143M: a control model with identical configuration, data and training recipe, except that it starts from random initialization instead of the pretrained base — used to quantify the contribution of base-model pretraining. OPUS-MT models are single-directional — one independent 78M model per direction; "-" marks directions a model does not serve. The same models re-evaluated on FLORES+ devtest (released 2026; zero overlap with dev): devtest sentences do not overlap with dev.…

Open weights apache-2.0 143M parameters 4,096 tokens

English | 中文 The instruction-tolerant sibling of DALabCommunity/Haidass-Translate-143M: same 143M zh⇄en translation training, plus 9.1% cleaned general-domain data (STEPFUN ShareGPT) mixed in. Translation scores are within 0.3 BLEU of the pure-translation version, and the model retains limited general instruction-following ability that the pure-translation version does not have. Drafter-143M: a control model with identical configuration, data and training recipe, except that it starts from random initialization instead of the pretrained base — used to quantify the contribution of base-model pretraining. OPUS-MT models are single-directional — one independent 78M model per direction; "-"…

Open weights apache-2.0 143M parameters 4,096 tokens

This model is a custom-code derivative of AxiomicLabs/GPT-X2-125M, adapted for experimental long-context causal language modeling and architecture research. The repository includes a Hugging Face Transformers-compatible GPT-X2 implementation with optional Symplectic Metric-RoPE Governor support and training utilities built around CIxOpt, a heterogeneous optimizer developed for efficient parameter routing across large projection matrices, sensitive normalization parameters, and optional governor modules. The model is intended as a research checkpoint for compact long-context generation, positional encoding experiments, optimizer testing, and continued fine-tuning. This implementation uses a…

Open weights apache-2.0 126M parameters 32,768 tokens transformers