A task-oriented Python engine that calls LLMs through LiteLLM and returns Pydantic-typed results for common NLP jobs without training data.
Overview
Promptify is a Python package positioned as a concise way to run NLP-style tasks with large language models. You pick a task class, pass text and a model identifier, and receive structured output validated by Pydantic schemas instead of raw strings.
Built-in tasks cover named entity recognition, several classification modes, question answering, summarization, relation and table extraction, question generation, SQL generation, text normalization, and topic extraction. Custom tasks can use any Pydantic model as the output shape.
LiteLLM serves as the backend so the same code can target OpenAI, Anthropic, Google, Ollama, Azure, and many other providers by changing the model string. The library supports few-shot examples, optional domain hints such as medical context, batch processing with async concurrency, and awaitable calls.
An evaluation framework reports precision, recall, F1, accuracy, exact match, and ROUGE-style metrics. A safe JSON parser helps when providers lack native structured output. Token usage and cost summaries are available through a dedicated helper. Installation is via pip and requires Python 3.9 or newer.
Key features
- Pydantic structured outputs
- LiteLLM multi-provider backend
- Built-in NER, QA, and classification tasks
- Custom tasks with any schema
- Few-shot example support
- Async and batch processing
- Evaluation metrics built in
- Token and cost tracking
Use cases
- Quick NER without labeled data
- LLM classification pipelines
- Swapping providers via model strings
- Measuring prompt task quality