{"data":{"slug":"bigscience-workshop-promptsource","name":"promptsource","tagline":"Toolkit for creating, sharing and using natural language prompts.","github_url":"https://github.com/bigscience-workshop/promptsource","owner":"bigscience-workshop","repo":"promptsource","owner_avatar_url":"https://avatars.githubusercontent.com/u/82455566?v=4","primary_language":"Python","stars":3026,"forks":377,"topics":["machine-learning","natural-language-processing","nlp"],"archived":false,"github_pushed_at":"2023-10-23T17:59:41+00:00","maintenance_label":"Dormant","url":"https://www.graphcanon.com/tools/bigscience-workshop-promptsource","markdown_url":"https://www.graphcanon.com/tools/bigscience-workshop-promptsource.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/bigscience-workshop-promptsource","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=bigscience-workshop-promptsource","description":"Toolkit for creating, sharing and using natural language prompts.","homepage_url":null,"license":"Apache-2.0","open_issues":43,"watchers":36,"ai_summary":null,"readme_excerpt":"# PromptSource\n**PromptSource is a toolkit for creating, sharing and using natural language prompts.**\n\nRecent work has shown that large language models exhibit the ability to perform reasonable zero-shot generalization to new tasks. For instance, [GPT-3](https://arxiv.org/abs/2005.14165) demonstrated that large language models have strong zero- and few-shot abilities. [FLAN](https://arxiv.org/abs/2109.01652) and [T0](https://arxiv.org/abs/2110.08207) then demonstrated that pre-trained language models fine-tuned in a massively multitask fashion yield even stronger zero-shot performance. A common denominator in these works is the use of prompts which has gained interest among NLP researchers and engineers. This emphasizes the need for new tools to create, share and use natural language prompts.\n\nPrompts are functions that map an example from a dataset to a natural language input and target output. PromptSource contains a growing collection of prompts (which we call **P3**: **P**ublic **P**ool of **P**rompts). As of January 20, 2022, there are ~2'000 English prompts for 170+ English datasets in [P3](https://huggingface.co/datasets/bigscience/P3).\n\n<p align=\"center\">\n  <img src=\"assets/PromptSource ACL Demo Figure.png\" width=\"800\"/>\n</p>\n\nPromptSource provides the tools to create, and share natural language prompts (see [How to create prompts](#how-to-create-prompts), and then use the thousands of existing and newly created prompts through a simple API (see [How to use prompts](#how-to-use-prompts)). Prompts are saved in standalone structured files and are written in a simple templating language called Jinja. An example of prompt available in PromptSource for [SNLI](https://huggingface.co/datasets/snli) is:\n```jinja2\n{{premise}}\n\nQuestion: Does this imply that \"{{hypothesis}}\"? Yes, no, or maybe? ||| {{answer_choices[label]}}\n```\n\n**You can browse through existing prompts on the [hosted version of PromptSource](https://huggingface.co/spaces/bigscience/promptsource).**\n\n## Setup\nIf you do not intend to create new prompts, you can simply run:\n```bash\npip install promptsource\n```\n\nOtherwise, you need to install the repo locally:\n1. Download the repo\n1. Navigate to the root directory of the repo\n1. Run `pip install -e .` to install the `promptsource` module\n\n*Note: for stability reasons, you will currently need a Python 3.7 environment to run the last step. However, if you only intend to use the prompts, and not create new prompts through the interface, you can remove this constraint in the [`setup.py`](setup.py) and install the package locally.*\n\n## How to use prompts\nYou can apply prompts to examples from datasets of the [Hugging Face Datasets library](https://github.com/huggingface/datasets).\n```python\n# Load an example from the datasets ag_news\n>>> from datasets import load_dataset\n>>> dataset = load_dataset(\"ag_news\", split=\"train\")\n>>> example = dataset[1]\n\n# Load prompts for this dataset\n>>> from promptsource.templates import DatasetTemplates\n>>> ag_news_prompts = DatasetTemplates('ag_news')\n\n# Print all the prompts available for this dataset. The keys of the dict are the UUIDs the uniquely identify each of the prompt, and the values are instances of `Template` which wraps prompts\n>>> print(ag_news_prompts.templates)\n{'24e44a81-a18a-42dd-a71c-5b31b2d2cb39': <promptsource.templates.Template object at 0x7fa7aeb20350>, '8fdc1056-1029-41a1-9c67-354fc2b8ceaf': <promptsource.templates.Template object at 0x7fa7aeb17c10>, '918267e0-af68-4117-892d-2dbe66a58ce9': <promptsource.templates.Template object at 0x7fa7ac7a2310>, '9345df33-4f23-4944-a33c-eef94e626862': <promptsource.templates.Template object at 0x7fa7ac7a2050>, '98534347-fff7-4c39-a795-4e69a44791f7': <promptsource.templates.Template object at 0x7fa7ac7a1310>, 'b401b0ee-6ffe-4a91-8e15-77ee073cd858': <promptsource.templates.Template object at 0x7fa7ac7a12d0>, 'cb355f33-7e8c-4455-a72b-48d315bd4f60': <promptsource.templates.Template object at 0x7fa7ac7a1110>}\n\n# Select a prompt by","github_created_at":"2021-05-19T15:26:25+00:00","created_at":"2026-07-11T10:53:13.536376+00:00","updated_at":"2026-07-11T10:53:21.557649+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"},{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"nlp","name":"nlp"},{"slug":"machine-learning","name":"machine-learning"},{"slug":"python","name":"python"},{"slug":"natural-language-processing","name":"natural-language-processing"}],"trust":{"provenance":{"is_fork":false,"github_id":368915773,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-11T10:53:14.467Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":991,"last_release_at":"2022-07-02T17:57:17Z"},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T10:53:15.488Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-07-11T10:53:14.983Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-07-11T10:53:14.983Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-07-11T10:53:14.983Z"}}}}