Skip to content

An intuitive web UI enabling non-technical users to test prompts for utilization within applications with a variety of AI models.

Notifications You must be signed in to change notification settings

zacharypodbela/prompt-engineering-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prompt Engineering Playground

An intuitive web UI enabling non-technical users to design prompts that can be utilized within applications and test them with a variety of AI models.

When it comes to designing prompts for use in software applications, consumer AI interfaces (like OpenAI's Chat GPT web app) hinder exploration of AI capabilities in several ways:

  • Consumer interfaces only allow the definition of user prompts, while direct interface with models allows for deinition of system and user prompts.
  • Consumer interfaces usually only allow the selection of one or two model versions, while a much larger variety with different tradeoffs are available when interfacing directly. Using OpenAI as an example, the web app only allows GPT3.5 or GPT4, but the API supports 9 different language models.
  • Even when using the exact same models, the responses provided can sometimes be markedly different given the subject matter filtering or privacy rules in the consumer application.

This app provides an easy interface to get started testing prompts and sending them through the same rails that a production software application would leverage (i.e. APIs or locally running Open Source models).

Setup

Video Walkthrough (5 mins) of Steps Below: https://www.loom.com/share/b6760bcabf9547d9bc2934c3fcf9e1f0?sid=f9d8b0e2-d622-4063-807d-d8942ea96ea1

Ollama

  1. Download Ollama
  2. Double click the zip file you downloaded and your computer should automatically unzip it into the Ollama application.
  3. Double click on "Ollama" application and follow instructions on screen.
  4. In Terminal, type ollama pull llama2 and press Enter.

Homebrew and Pipenv

From Terminal, run the folowing commands one at a time (type them in or copy and paste them in and then press Enter):

  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. When Homebrew finishes installing it will show two commands under Next Steps which you need to run. These commands are custom to your machine, so I can't list them here. One beginning with echo 'eval "$(/opt... and one beginning with eval "$(/opt/.... Copy and paste each into Terminal and press Enter.
  3. brew install pipenv

Open AI

  1. Sign up for Open AI
  2. In User settings > API Keys, click "Create new secret key", give it a name, and then save it to use later. (Note: Once you close this page, you will not be able to see the key again and will need to generate a new on if you lose it.)

This Project

  1. Download the project
  2. Double click the zip file you downloaded and your computer should automatically unzip it into a folder
  3. In Terminal, type cd and then drag the folder into the terminal window. The text in Terminal should now look something like cd /Users/.... Press Enter.
  4. Type echo "OPENAI_API_KEY= followed by your Open AI key then type " >> .env and press Enter.
  5. Type pipenv install and press Enter.

Running the Program

Follow these steps whenever you want to run the project.

  1. In Terminal, type cd and then drag the folder into the terminal window. The text in Terminal should now look something like cd /Users/.... Press Enter.
  2. Type pipenv shell and press Enter.
  3. Type streamlit run app.py and press Enter.
  4. A chrome window should open up where you can interact with the AI!

Roadmap

Future improvements to be added to the project:

  • Enable different Ollama and Open AI models to be choosen from a dropdown
  • Estimate costs of Open AI API calls and display cost-tracking in UI
  • Support more complex use cases, like follow-up prompts and/or document upload and retrival.
    • Follow-up prompts (prompt chaining) is in Beta on branch feature/prompt-chaining

About

An intuitive web UI enabling non-technical users to test prompts for utilization within applications with a variety of AI models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages