explaingit

promptslab/promptify

4,600PythonAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Python library that uses large language models to perform structured text tasks, NER, classification, summarization, SQL generation, and more, returning typed Pydantic objects instead of raw text.

Mindmap

mindmap
  root((repo))
    What it does
      Structured LLM tasks
      Typed output objects
    Built-in tasks
      Named entity recognition
      Text classification
      Summarization
      SQL generation
    Features
      Multi-provider via LiteLLM
      Batch and async
      Evaluation framework
    Tech stack
      Python
      Pydantic
      LiteLLM
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Extract named entities from medical or legal text and receive structured Pydantic objects instead of raw strings

USE CASE 2

Classify customer feedback into custom categories using any LLM by changing one model name string

USE CASE 3

Define a custom Pydantic schema for any extraction task and let Promptify handle prompting and response parsing

USE CASE 4

Benchmark multiple LLMs or prompt strategies on your specific NER or classification task using built-in evaluation metrics

Tech stack

PythonPydanticLiteLLM

Getting it running

Difficulty · easy Time to first run · 30min

Requires Python 3.9+ and an API key for your chosen LLM provider (OpenAI, Anthropic, or a local Ollama instance).

Free to use, modify, and distribute for any purpose, including commercial use, as long as you include the license notice.

In plain English

Promptify is a Python library that makes it straightforward to use large language models for common text processing tasks without writing custom prompts or parsing code. You pick a task, point it at a language model, pass in some text, and get back a structured Python object instead of a raw string. The README describes it as something like scikit-learn for language model powered text work. The built-in tasks cover a range of standard text analysis needs: named entity recognition (identifying names, conditions, dates, and similar items in text), text classification into categories you define, question answering given a passage, summarization, relation extraction, table extraction, SQL generation from natural language, and topic modeling. Each task returns a typed Pydantic object, so the result has predictable fields with type checking rather than freeform text that needs further parsing. The library connects to language models through a backend called LiteLLM, which means you can swap between providers by changing a single model name string. The same NER class works with OpenAI models, Anthropic models, or locally running models through Ollama. Batch processing and async calls are both supported for handling multiple inputs efficiently. For custom work beyond the built-in tasks, you define a Pydantic schema describing the shape of output you want and pass it to a generic Task class. The library handles turning that schema into a prompt and parsing the model's response back into your defined structure. An evaluation framework is included that measures precision, recall, F1, accuracy, and other metrics against labeled test data, making it possible to compare models or prompt strategies on a specific task. Cost tracking is also built in to monitor token usage across calls. The project is released under the Apache 2.0 license and requires Python 3.9 or newer.

Copy-paste prompts

Prompt 1
Using promptslab/promptify, show me how to run named entity recognition on medical text and get back a structured Pydantic object with entity types and spans.
Prompt 2
I want to classify customer support tickets into 5 categories using Claude via promptify. Show me the setup code and how to run it on a list of tickets.
Prompt 3
Using promptify from promptslab/promptify, I want to define a custom Pydantic output schema for extracting product specs from descriptions. Show me how to create a custom Task.
Prompt 4
Help me use the promptify evaluation framework to compare GPT-4 and a Claude model on my NER dataset and see F1 scores for each.
Prompt 5
Show me how to run promptify's summarization task on a batch of 100 documents using async mode for efficient parallel processing.
Open on GitHub → Explain another repo

← promptslab on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.