# thunlp/OpenPrompt

An Open-Source Framework for Prompt-Learning.

Repository: https://github.com/thunlp/OpenPrompt
Canonical: https://ross.abutalabs.com/products/openprompt
Homepage: https://thunlp.github.io/OpenPrompt/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: nlp, pre-trained-language-models, ai, nlp-machine-learning, natural-language-processing, natural-language-understanding, deep-learning, pre-trained-model, nlp-library, pytorch, transformer, prompt, prompt-toolkit, prompts, prompt-based-tuning, prompt-learning
Last push: 2024-07-16T03:48:08+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 1798, "days_push": 778, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4890, forks 476 (observed 2026-08-28T04:09:01.997105+00:00)

## What it is
OpenPrompt is a PyTorch-based open-source framework for prompt-learning, providing a standard, flexible pipeline of templates and verbalizers to adapt pre-trained language models to downstream NLP tasks. It loads PLMs directly from Hugging Face transformers and supports manual, soft, prefix-tuning, and generation-style prompting.

## Use cases
- apply prompt-based tuning to pre-trained language models
- run few-shot text classification with templates and verbalizers
- adapt BERT or T5 to downstream NLP tasks via prompting
- experiment with manual and soft prompt templates in PyTorch
- do supervised instruction tuning for a chat model
- benchmark prompt-learning methods on SuperGLUE

## When to choose
- you want a research-grade, extensible framework for prompt-learning pipelines
- your models come from Hugging Face transformers and you need template/verbalizer abstractions
- you need few-shot classification or generation paradigms over PLMs

## When to avoid
- you need modern LLM fine-tuning with LoRA/PEFT or chat-style inference rather than classic prompt-learning
- you want a library with frequent updates and current model support
- you just need prompt engineering for an LLM API without training

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, nlp, prompt-engineering, llm-training
- domain: machine-learning, deep-learning, large-language-models
- platform: python, cross-platform
- tags: prompt-learning, pytorch, pre-trained-language-models, prompt-tuning, huggingface-transformers, few-shot-learning, natural-language-processing

## Member repositories
- thunlp/OpenPrompt (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:01.997105+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:18:11.898584+00:00, confidence not recorded.
  - readme: https://github.com/thunlp/OpenPrompt (fetched 2026-08-28T04:09:01.997105+00:00, sha 024707da6eeb)
  - homepage: https://thunlp.github.io/OpenPrompt/ (fetched 2026-08-29T09:00:26.229681+00:00, sha fe25b877f87e)
  - registry_pypi: https://pypi.org/pypi/openprompt/json (fetched 2026-08-29T09:00:26.238991+00:00, sha c22ccbb37ae7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
