OpenPrompt is an open-source framework for prompt-learning developed by Tsinghua University’s THUNLP lab. It unifies the fragmented world of prompt-based fine-tuning into a single PyTorch library, so researchers can combine pre-trained language models, prompt templates and verbalizers without rewriting glue code for every experiment. It has earned more than 4,900 stars on GitHub.
Prompt-learning reformulates downstream tasks to look like the pre-training objective of a language model: wrap the input in a template with a masked slot, and map model predictions to labels with a verbalizer. OpenPrompt standardizes each of these pieces. It loads a wide range of pre-trained models, from BERT and RoBERTa to GPT and T5, provides template and verbalizer implementations from the literature, and ships dataset loaders for common benchmarks. A modular pipeline then composes these parts for tasks such as text classification, relation extraction and question answering, including few-shot settings where prompt methods shine brightest.
OpenPrompt’s design has influenced several later prompt-learning toolkits, and it ships implementations accompanying the lab’s own papers, which makes reproducing published prompt-learning results considerably easier. It also supports tuning soft prompts on frozen models, a practical option when full fine-tuning is too expensive for the available hardware.
OpenPrompt is completely free and open source under the Apache-2.0 license. There are no paid features; you run it on your own hardware with your own models.
OpenPrompt is for NLP researchers and graduate students who study or apply prompt-learning and parameter-efficient adaptation, and who need a reproducible baseline framework instead of one-off experiment scripts.