Promptify  by promptslab

Prompt engineering SDK for structured LLM output

Created 2 years ago
4,242 stars

Top 11.5% on SourcePulse

GitHubView on GitHub
Project Summary

Promptify simplifies Natural Language Processing (NLP) tasks by enabling users to generate structured outputs from Large Language Models (LLMs) like GPT and PaLM. It targets developers and researchers looking to leverage LLMs for tasks such as Named Entity Recognition (NER), text classification, and question answering without requiring custom model training. The library's core benefit is its ability to abstract away prompt complexity and LLM output variability, providing consistent, parseable Python objects.

How It Works

Promptify utilizes a pipeline approach, combining pre-defined or custom Jinja2 prompt templates with various LLM integrations (OpenAI, Huggingface Hub models, Azure). Users select a task-specific template (e.g., ner.jinja), provide input text, and the pipeline constructs the appropriate prompt for the chosen LLM. This method allows for zero-shot or few-shot learning, directly extracting structured data from LLM responses, thereby avoiding the need for fine-tuning and simplifying integration into applications.

Quick Start & Requirements

  • Install via pip: pip3 install promptify or pip3 install git+https://github.com/promptslab/Promptify.git
  • Tested on Python 3.7+ and openai 0.25+.
  • Requires API keys for services like OpenAI.
  • Official Docs: https://promptify.readthedocs.io/
  • Colab Notebooks for various tasks are linked in the README.

Highlighted Details

  • Supports a wide range of NLP tasks including NER, multi-label/class/binary classification, question-answering, relation extraction, summarization, and SQL generation.
  • Outputs are consistently formatted as Python objects (lists, dictionaries) for easy parsing.
  • Allows easy integration of few-shot examples into prompts.
  • Can run inference on any model stored on the Huggingface Hub.

Maintenance & Community

The project is open-source with a call for contributions. Community discussions are encouraged via Discord.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. This requires further investigation for commercial use or closed-source linking.

Limitations & Caveats

The README mentions "Optimized prompts to reduce OpenAI token costs (coming soon)," indicating this feature is not yet implemented. The lack of an explicit license is a significant caveat for adoption.

Health Check
Last Commit

7 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
166 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Kevin Hou Kevin Hou(Head of Product Engineering at Windsurf), and
6 more.

TypeChat by microsoft

0.1%
9k
Library for building natural language interfaces using types
Created 2 years ago
Updated 2 months ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), and
42 more.

spaCy by explosion

0.1%
32k
NLP library for production applications
Created 11 years ago
Updated 3 months ago
Feedback? Help us improve.