Skip to main content

An autonomous agent framework for prompt engineering

Project description

Prompt-Promptor: An Autonomous Agent Framework for Prompt Engineering

Prompt-Promptor(or shorten for ppromptor) is a Python library designed to automatically generate and improve prompts for LLMs. It draws inspiration from autonomous agents like AutoGPT and consists of three agents: Proposer, Evaluator, and Analyzer. These agents work together with human experts to continuously improve the generated prompts.

🚀 Features:

  • 🤖 The use of LLMs to prompt themself by giving few samples.

  • 💪 Guidance for OSS LLMs(eg, LLaMA) by more powerful LLMs(eg, GPT4)

  • 📈 Continuously improvement.

  • 👨‍👨‍👧‍👦 Collaboration with human experts.

  • 💼 Experiment management for prompt engineering.

  • 🖼 Web GUI interface.

  • 🏳️‍🌈 Open Source.

Warning

  • This project is currently in its earily stage, and it is anticipated that there will be major design changes in the future.

  • The main function utilizes an infinite loop to enhance the generation of prompts. If you opt for OpenAI's ChatGPT as Target/Analysis LLMs, kindly ensure that you set a usage limit.

Concept

Compare Prompts

A more detailed class diagram could be found in doc

Installations

From Github

  1. Clone Repository from Github
git clone https://github.com/pikho/ppromptor.git
cd ppromptor
  1. Install Required Packages
pip install -r requirements.txt
  1. Add Package Path to PythonPath
export PYTHONPATH=PYTHONPATH:<path_to_repo>/ppromptor
  1. Run Tests
pip install -r requirements_test.txt

pytest

Running Local Model(WizardLM)

  1. Install Required Packages
pip install requirements_local_model.txt
  1. Test if WizardLM can run correctly
cd <path_to_ppromptor>/ppromptor/llms
python wizardlm.py

Usage

  1. Start the Web App
cd <path_to_ppromptor>
streamlit run ui/app.py
  1. Load the Demo Project Load examples/antonyms.db(default) for demo purposes. This demonstrates how to use ChatGPT to guide WizardLM to generate antonyms for given inputs.

  2. Configuration In the Configuration tab, set Target LLM as wizardlm if you can infer this model locally. Or choose both Target LLM and Analysis LLM as chatgpt. If chatgpt is used, please provide the OpenAI API Key.

  3. Load the dataset The demo project has already loaded 5 records. You can add your own dataset.(Optional)

  4. Start the Workload Press the Start button to activate the workflow.

  5. Prompt Candidates Generated prompts can be found in the Prompt Candidates tab. Users can modify generated prompts by selecting only 1 Candidate, then modifying the prompt, then Create Prompt. This new prompt will be evaluated by Evaluator agent and then keep improving by Analyzer agent. By selecting 2 prompts, we can compare these prompts side by side.

Compare Prompts

Compare Prompts

Contribution

We welcome all kinds of contributions, including new feature requests, bug fixes, new feature implementation, examples, and documentation updates. If you have a specific request, please use the "Issues" section. For other contributions, simply create a pull request (PR). Your participation is highly valued in improving our project. Thank you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppromptor-0.1.3.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

ppromptor-0.1.3-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file ppromptor-0.1.3.tar.gz.

File metadata

  • Download URL: ppromptor-0.1.3.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ppromptor-0.1.3.tar.gz
Algorithm Hash digest
SHA256 580f8775b2c672377a99c5e0aadb375021cb618f35cc2aa9cc5cb3bc30ca2fec
MD5 2646b12f5b3c0b2b512e52d81fe1a291
BLAKE2b-256 0619f679cd529dba795182b50deda8466afb658727e5a97c99f1eadd7959cef8

See more details on using hashes here.

File details

Details for the file ppromptor-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ppromptor-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ppromptor-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3f00b376e8e7867759f0940c338a366f0d180e6ea1ce8de705081107fa3c01f4
MD5 4e4a687450cb7a01948a10774903cc9c
BLAKE2b-256 6bcbc8e378737841d030a9721776306599c92cf6317511561cea82957056e2b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page