promptslab/Promptify

★ 4,636⑂ 364

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

About promptslab/Promptify

promptslab/Promptify is an open-source project on GitHub, mainly written in Python. Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. It currently holds 4,636 stars and 364 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Prompt Engineering board.

GitHub Repository Details

Repository promptslab/Promptify · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

Promptify

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".

https://github.com/promptslab/Promptify/blob/HEAD/Promptify is released under the Apache 2.0 license. https://github.com/promptslab/Promptify/blob/HEAD/PyPI version https://github.com/promptslab/Promptify/blob/HEAD/http://makeapullrequest.com https://github.com/promptslab/Promptify/blob/HEAD/Community https://github.com/promptslab/Promptify/blob/HEAD/colab

Installation

With pip

Requires Python 3.9+.

pip install promptify

or

pip install git+https://github.com/promptslab/Promptify.git

For evaluation metrics support:

pip install promptify[eval]

Quick Tour

3-Line NER

from promptify import NER

ner = NER(model="gpt-4o-mini", domain="medical") result = 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")

Output:

NERResult(entities=[
    Entity(text="93-year-old", label="AGE"),
    Entity(text="chronic right hip pain", label="CONDITION"),
    Entity(text="osteoporosis", label="CONDITION"),
    Entity(text="hypertension", label="CONDITION"),
    Entity(text="depression", label="CONDITION"),
    Entity(text="chronic atrial fibrillation", label="CONDITION"),
    Entity(text="severe nausea and vomiting", label="SYMPTOM"),
    Entity(text="urinary tract infection", label="CONDITION"),
])

Classification

from promptify import Classify

clf = Classify(model="gpt-4o-mini", labels=["positive", "negative", "neutral"]) result = clf("Amazing product! Best purchase I've ever made.")

Classification(label="positive", confidence=0.95)

Question Answering

from promptify import QA

qa = QA(model="gpt-4o-mini") answer = qa("Einstein was born in Ulm in 1879.", question="Where was Einstein born?")

Answer(answer="Ulm", evidence="Einstein was born in Ulm", confidence=0.98)

Custom Task with Any Pydantic Schema

from promptify import Task
from pydantic import BaseModel

class MovieReview(BaseModel): sentiment: str rating: float key_themes: list[str]

task = Task(model="gpt-4o", output_schema=MovieReview, instruction="Analyze this movie review.") review = task("Nolan's best work. Stunning visuals but the plot drags.")

MovieReview(sentiment="mostly positive", rating=7.5, key_themes=["visuals", "pacing"])

Any Provider - Just Change the Model String

ner_openai = NER(model="gpt-4o-mini")
ner_claude = NER(model="claude-sonnet-4-20250514")
ner_local  = NER(model="ollama/llama3")

Batch Processing

results = ner.batch(["text1", "text2", "text3"], max_concurrent=10)

Async Support

result = await ner.acall("Patient has diabetes")

Built-in Evaluation

from promptify.eval import evaluate

scores = evaluate(task=ner, dataset=labeled_data, metrics=["precision", "recall", "f1"])

{"precision": 0.92, "recall": 0.88, "f1": 0.90}

Features

Supported NLP Tasks

| Task | Class | Output Schema | |------|-------|---------------| | Named Entity Recognition | NER | NERResult (list of Entity) | | Binary Classification | Classify | Classification | | Multiclass Classification | Classify | Classification | | Multilabel Classification | Classify(multi_label=True) | MultiLabelResult | | Question Answering | QA | Answer | | Summarization | Summarize | Summary | | Relation Extraction | ExtractRelations | ExtractionResult | | Tabular Extraction | ExtractTable | ExtractionResult | | Question Generation | GenerateQuestions | list of GeneratedQuestion | | SQL Generation | GenerateSQL | SQLQuery | | Text Normalization | NormalizeText | normalized text | | Topic Modelling | ExtractTopics | list of topics | | Custom Task | Task | any Pydantic BaseModel |

Community

If you are interested in Prompt-Engineering, LLMs, and NLP, please consider joining PromptsLab
https://github.com/promptslab/Promptify/blob/HEAD/Join us on Discord

@misc{Promptify2022,
  title = {Promptify: Structured Output from LLMs},
  author = {Pal, Ankit},
  year = {2022},
  howpublished = {\url{https://github.com/promptslab/Promptify}},
  note = {Prompt-Engineering components for NLP tasks in Python}
}

💁 Contributing

We welcome any contributions to our open source project, including new features, improvements to infrastructure, and more comprehensive documentation. Please see the contributing guidelines

GitHub Stars & Activity

4,636Stars
364Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars4,636
Forks364
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

headroomlabs-ai / headroom

Python★ 73,186⑂ 5,631
2

blader / humanizer

Python★ 50,467⑂ 4,061
3

Imbad0202 / academic-research-skills

Python★ 48,823⑂ 3,789
4

mlflow / mlflow

Python★ 28,051⑂ 6,328
5

alirezarezvani / claude-skills

Python★ 26,168⑂ 3,686
6

comet-ml / opik

Python★ 22,157⑂ 1,809
7
8

tradecatlabs / vibe-coding-cn

Python★ 16,314⑂ 1,653

More AI Rankings