Promptify is a small Python library for performing NLP tasks using language models. It is officially described as "scikit-learn for LLM-powered NLP."
Purpose Promptify provides task-based NLP engines, combining Pydantic structured output, built-in evaluation, and LiteLLM as a universal LLM backend. It is suitable for developers who want to complete common NLP tasks with a small amount of code and without training data.
Main capabilities
- Any NLP task in just 2-3 lines of code, without training data.
- Pydantic structured output: returns type-safe results instead of raw strings.
- Supports any LLM provider through LiteLLM: OpenAI, Anthropic, Google, Ollama, Azure, and more than 100 other providers, simply by changing the model string.
- Built-in tasks: NER, classification (binary/multiclass/multilabel), question answering, summarization, relation extraction, SQL generation, and more.
- Custom tasks: bring your own Pydantic schema to get arbitrary structured output.
- Few-shot examples: easily add examples to improve accuracy.
- Domain specialization: pass domain="medical" or any domain to generate context-aware prompts.
- Batch processing: processes multiple texts concurrently using async under the hood.
- Async support: native await support through acall().
- Evaluation framework: supports precision, recall, F1, accuracy, exact match, and ROUGE metrics.
- Safe parser: provides fallback JSON completion for providers without native structured output, without using eval().
- Cost tracking: built-in token usage and cost monitoring through get_cost_summary().
Usage Promptify requires Python 3.9+. Users can invoke any NLP task with a few lines of code, with support for synchronous and asynchronous calls (acall()), batch processing of multiple texts, and passing few-shot examples and domain parameters. Specific installation commands and code examples are not provided yet.
Use cases
- Named Entity Recognition (NER)
- Text classification (binary, multiclass, multilabel)
- Question Answering
- Summarization
- Relation Extraction
- SQL Generation
- Any structured output task that can be defined through a custom Pydantic schema
Limitations
- Requires Python 3.9 or later.
- Evaluation metric support: for tasks such as question answering, the materials only list question answering for evaluation metric support; the scope of evaluation support for other tasks is not provided yet.
- Specific installation commands, code examples, pricing, and billing information are not provided yet.