{"data":{"slug":"promptslab-promptify","name":"Promptify","tagline":"Task-based NLP engine with Pydantic structured outputs","github_url":"https://github.com/promptslab/Promptify","owner":"promptslab","repo":"Promptify","owner_avatar_url":"https://avatars.githubusercontent.com/u/120981762?v=4","primary_language":"Python","stars":4630,"forks":363,"topics":["chatgpt","chatgpt-api","chatgpt-python","gpt-3","gpt-3-prompts","gpt-4","gpt-4-api","gpt3-library","large-language-models","machine-learning","nlp","openai","prompt-engineering","prompt-toolkit","prompt-tuning","prompt-versioning","prompting","prompts","promptversioning","transformers"],"archived":false,"github_pushed_at":"2026-03-27T01:09:45+00:00","maintenance_label":"Slowing","stars_delta_30d":11,"url":"https://www.graphcanon.com/tools/promptslab-promptify","markdown_url":"https://www.graphcanon.com/tools/promptslab-promptify.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/promptslab-promptify","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=promptslab-promptify","description":"Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research","homepage_url":"https://discord.gg/m88xfYMbK6","license":"Apache-2.0","open_issues":60,"watchers":51,"ai_summary":"Promptify is an NLP library that focuses on prompt engineering and versioning for LLMs like GPT-3, GPT-4. It provides a structured manner of retrieving output using Pydantic models.","readme_excerpt":"<div align=\"center\">\n<img width=\"110px\" src=\"https://raw.githubusercontent.com/promptslab/Promptify/main/assets/logo.png\">\n<h1>Promptify</h1></div>\n\n\n<p align=\"center\">\n  <p align=\"center\">Task-based NLP engine with Pydantic structured outputs, built-in evaluation, and LiteLLM as the universal LLM backend. Think \"scikit-learn for LLM-powered NLP\".\n</p>\n</p>\n\n <h4 align=\"center\">\n  <a href=\"https://github.com/promptslab/Promptify/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg\" alt=\"Promptify is released under the Apache 2.0 license.\" />\n  </a>\n  <a href=\"https://pypi.org/project/promptify/\">\n    <img src=\"https://badge.fury.io/py/Promptify.svg\" alt=\"PyPI version\" />\n  </a>\n  <a href=\"http://makeapullrequest.com\">\n    <img src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\" alt=\"http://makeapullrequest.com\" />\n  </a>\n  <a href=\"https://discord.gg/m88xfYMbK6\">\n    <img src=\"https://img.shields.io/badge/Discord-Community-orange\" alt=\"Community\" />\n  </a>\n  <a href=\"#\">\n    <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"colab\" />\n  </a>\n</h4>\n\n<img width=\"910px\" src=\"https://raw.githubusercontent.com/promptslab/Promptify/main/assets/dark.png\">\n\n## Installation\n\n### With pip\n\nRequires Python 3.9+.\n\n```bash\npip install promptify\n```\n\nor\n\n```bash\npip install git+https://github.com/promptslab/Promptify.git\n```\n\nFor evaluation metrics support:\n```bash\npip install promptify[eval]\n```\n\n## Quick Tour\n\n### 3-Line NER\n\n```python\nfrom promptify import NER\n\nner = NER(model=\"gpt-4o-mini\", domain=\"medical\")\nresult = ner(\"The patient is a 93-year-old female with a medical history of chronic right hip pain, osteoporosis, hypertension, depression, and chronic atrial fibrillation admitted for evaluation and management of severe nausea and vomiting and urinary tract infection\")\n```\n\n**Output:**\n```python\nNERResult(entities=[\n    Entity(text=\"93-year-old\", label=\"AGE\"),\n    Entity(text=\"chronic right hip pain\", label=\"CONDITION\"),\n    Entity(text=\"osteoporosis\", label=\"CONDITION\"),\n    Entity(text=\"hypertension\", label=\"CONDITION\"),\n    Entity(text=\"depression\", label=\"CONDITION\"),\n    Entity(text=\"chronic atrial fibrillation\", label=\"CONDITION\"),\n    Entity(text=\"severe nausea and vomiting\", label=\"SYMPTOM\"),\n    Entity(text=\"urinary tract infection\", label=\"CONDITION\"),\n])\n```\n\n### Classification\n\n```python\nfrom promptify import Classify\n\nclf = Classify(model=\"gpt-4o-mini\", labels=[\"positive\", \"negative\", \"neutral\"])\nresult = clf(\"Amazing product! Best purchase I've ever made.\")\n# Classification(label=\"positive\", confidence=0.95)\n```\n\n### Question Answering\n\n```python\nfrom promptify import QA\n\nqa = QA(model=\"gpt-4o-mini\")\nanswer = qa(\"Einstein was born in Ulm in 1879.\", question=\"Where was Einstein born?\")\n# Answer(answer=\"Ulm\", evidence=\"Einstein was born in Ulm\", confidence=0.98)\n```\n\n### Custom Task with Any Pydantic Schema\n\n```python\nfrom promptify import Task\nfrom pydantic import BaseModel\n\nclass MovieReview(BaseModel):\n    sentiment: str\n    rating: float\n    key_themes: list[str]\n\ntask = Task(model=\"gpt-4o\", output_schema=MovieReview, instruction=\"Analyze this movie review.\")\nreview = task(\"Nolan's best work. Stunning visuals but the plot drags.\")\n# MovieReview(sentiment=\"mostly positive\", rating=7.5, key_themes=[\"visuals\", \"pacing\"])\n```\n\n### Any Provider - Just Change the Model String\n\n```python\nner_openai = NER(model=\"gpt-4o-mini\")\nner_claude = NER(model=\"claude-sonnet-4-20250514\")\nner_local  = NER(model=\"ollama/llama3\")\n```\n\n### Batch Processing\n\n```python\nresults = ner.batch([\"text1\", \"text2\", \"text3\"], max_concurrent=10)\n```\n\n### Async Support\n\n```python\nresult = await ner.acall(\"Patient has diabetes\")\n```\n\n### Built-in Evaluation\n\n```python\nfrom promptify.eval import evaluate\n\nscores = evaluate(task=ner, dataset=labeled_data, metrics=[\"precision\", \"recall\", \"f1\"])\n# {\"precision\": 0.92, \"recall\": 0.88, \"f1\": 0.90}\n```\n\n## Features\n\n- **2-3","github_created_at":"2022-12-12T18:06:32+00:00","created_at":"2026-07-07T17:35:08.184411+00:00","updated_at":"2026-08-07T18:02:15.489342+00:00","categories":[{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"},{"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"}],"tags":[{"slug":"chatgpt","name":"chatgpt"},{"slug":"chatgpt-api","name":"chatgpt-api"},{"slug":"gpt-3","name":"gpt-3"},{"slug":"gpt-4","name":"gpt-4"},{"slug":"prompt-engineering","name":"prompt-engineering"},{"slug":"prompt-toolkit","name":"prompt-toolkit"},{"slug":"prompt-versioning","name":"prompt-versioning"}],"trust":{"provenance":{"is_fork":false,"github_id":577429312,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-07T18:02:14.707Z","maintenance":{"label":"Slowing","score":36,"methodology":"github_public_v1","releases_90d":0,"days_since_push":133,"last_release_at":null,"stars_delta_30d":11,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T10:41:00.968Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-07T18:02:15.168Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-07T18:02:15.168Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-07T18:02:15.168Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":{"notes":["Requires Python 3.9 or higher","Can be installed via pip or directly from GitHub"],"min_ram_gb":null,"requires_docker":false},"constraints":{"min_ram_gb":null,"requires_docker":false},"when_to_use":["When your application requires structured NLP outputs with clear schemas defined using Pydantic","If you need to version control over different prompts for repeatability in tasks such as Named Entity Recognition (NER), classification, and question-answering","In scenarios where easy integration with multiple large language models (LLMs) is necessary without changing much of the codebase"],"when_not_to_use":["When your project does not require structured outputs or if Pydantic schemas are not suitable for your use case","If you do not need built-in evaluation metrics for prompt performance and prefer more customization in the evaluation process","In situations where integration with only a few specific LLMs is required, as Promptify's advantage lies in its flexibility across various providers"],"source":"enrich:decision_facts","observed_at":"2026-07-09T08:28:15.926Z"},"constraint_facets":{"min_ram_gb":null,"requires_docker":false},"decision_summary":[{"label":"Requirements","value":"Requires Python 3.9 or higher; Can be installed via pip or directly from GitHub"},{"label":"Adopt for","value":"Promptify is a Python library designed for task-based Natural Language Processing with Pydantic structured outputs and built-in evaluation features, leveraging LiteLLM as its universal LLM backend. It supports prompt版本控制"},{"label":"License detail","value":"Promptify is available under the Apache-2.0 license, granting users permissions to use, modify, distribute, and sell this software."}]}}