{"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":3029,"forks":375,"topics":["machine-learning","natural-language-processing","nlp"],"archived":false,"github_pushed_at":"2023-10-23T17:59:41+00:00","maintenance_label":"Dormant","stars_delta_30d":2,"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":"PromptSource is a toolkit designed to facilitate the creation, sharing, and usage of natural language prompts intended for large language models.","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-08-15T18:00:39.740826+00:00","categories":[{"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"},{"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"}],"tags":[{"slug":"few-shot","name":"few-shot"},{"slug":"fine-tuning","name":"fine-tuning"},{"slug":"language-models","name":"language-models"},{"slug":"machine-learning","name":"machine-learning"},{"slug":"natural-language-processing","name":"natural-language-processing"},{"slug":"nlp","name":"nlp"},{"slug":"prompts","name":"prompts"},{"slug":"zero-shot","name":"zero-shot"}],"trust":{"provenance":{"is_fork":false,"github_id":368915773,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-15T18:00:38.749Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":1027,"last_release_at":"2022-07-02T17:57:17Z","stars_delta_30d":2,"open_issues_delta_30d":-1},"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-08-15T18:00:39.381Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-08-15T18:00:39.381Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-15T18:00:39.381Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you need to create reusable prompts for multiple datasets with a focus on simplicity through a templating language called Jinja.","If your workflow involves fine-tuning pre-existing prompts or leveraging an existing pool of over two thousand English prompts from the Public Pool of Prompts (P3)."],"when_not_to_use":["Avoid if you require complex prompt customization beyond what simple templating can offer, as PromptSource is not designed for intricate configurations.","Not suitable for users focused on real-time interaction with prompts, since it lacks dynamic features for immediate adjustments."],"source":"enrich:decision_facts","observed_at":"2026-07-14T21:33:51.850Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"PromptSource aids in creating, sharing, and using natural language prompts for large language models."}]}}