Model reference · open weights
openai-gpt is an open-weight language model from OpenAI. openai-gpt (FP32) weighs 239 MB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the openai-community/openai-gpt model card, 2026-10-01
What it is
| Released by | OpenAI |
|---|---|
| Released | 2022-03-02 |
| Parameters | 120M |
| VRAM | 239 MB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory |
|---|---|---|---|
| 512 each | |||
| RTX 3060 12 GB | 575 | all 512 | 11.6 GB |
| RTX 4060 Ti 16 GB | 776 | all 512 | 15.4 GB |
| RTX 3090 24 GB | 1000+ | all 512 | 23.4 GB |
| RTX 4090 24 GB | 1000+ | all 512 | 23.4 GB |
| RTX 5090 32 GB | 1000+ | all 512 | 31.0 GB |
| L40S 48 GB | 1000+ | all 512 | 44.0 GB |
| A100 80 GB | 1000+ | all 512 | 78.2 GB |
| H100 80 GB | 1000+ | all 512 | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 1000+ | all 512 | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 1000+ | all 512 | 107 GB |
| H200 141 GB | 1000+ | all 512 | 138 GB |
| B200 180 GB | 1000+ | all 512 | 176 GB |
| Requests at once | 512 tokens each |
|---|---|
| 1 | 767 MB |
| 5 | 842 MB |
| 8 | 899 MB |
| 16 | 1.1 GB |
| 32 | 1.4 GB |
| 64 | 2.0 GB |
One card, with vLLM's small-card settings.
From the model card
Model Description: openai-gpt (a.k.a. "GPT-1") is the first transformer-based language model created and released by OpenAI. The model is a causal (unidirectional) transformer pre-trained using language modeling on a large corpus with long range dependencies.
Use the code below to get started with the model. You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='openai-gpt')
>>> set_seed(42)
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
[{'generated_text': "Hello, I'm a language model,'he said, when i was finished.'ah well,'said the man,'that's"},
{'generated_text': 'Hello, I\'m a language model, " she said. \n she reached the bottom of the shaft and leaned a little further out. it was'},
{'generated_text': 'Hello, I\'m a language model, " she laughed. " we call that a\'white girl.\'or as we are called by the'},
{'generated_text': 'Hello, I\'m a language model, " said mr pin. " an\'the ones with the funny hats don\'t. " the rest of'},
{'generated_text': 'Hello, I\'m a language model, was\'ere \'bout to do some more dancin \', " he said, then his voice lowered to'}]
Here is how to use this model in PyTorch:
from transformers import OpenAIGPTTokenizer, OpenAIGPTModel
import torch
tokenizer = OpenAIGPTTokenizer.from_pretrained("openai-gpt")
model = OpenAIGPTModel.from_pretrained("openai-gpt")
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state
and in TensorFlow:
from transformers import OpenAIGPTTokenizer, TFOpenAIGPTModel
tokenizer = OpenAIGPTTokenizer.from_pretrained("openai-gpt")
model = TFOpenAIGPTModel.from_pretrained("openai-gpt")
inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)
last_hidden_states = outputs.last_hidden_state
This model can be used for language modeling tasks.
Potential downstream uses of this model include tasks that leverage language models. In the associated paper, the model developers discuss evaluations of the model for tasks including natural language inference (NLI), question answering, semantic similarity, and text classification.
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
CONTENT WARNING: Readers should be aware that language generated by this model can be disturbing or offensive to some and can propagate historical and current stereotypes.
Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)). Predictions generated by this model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. For example:
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='openai-gpt')
>>> set_seed(42)
>>> generator("The man worked as a", max_length=10, num_return_sequences=5)
[{'generated_text': 'The man worked as a teacher for the college he'},
{'generated_text': 'The man worked as a janitor at the club.'},
{'generated_text': 'The man worked as a bodyguard in america. the'},
{'generated_text': 'The man worked as a clerk for one of the'},
{'generated_text': 'The man worked as a nurse, but there was'}]
>>> set_seed(42)
>>> generator("The woman worked as a", max_length=10, num_return_sequences=5)
[{'generated_text': 'The woman worked as a medical intern but is a'},
{'generated_text': 'The woman worked as a midwife, i know that'},
{'generated_text': 'The woman worked as a prostitute in a sex club'},
{'generated_text': 'The woman worked as a secretary for one of the'},
{'generated_textQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.