Skip to content

zoeychappell/PrivPrompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

212 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrivPrompt

This team has the purpose of ensuring data privacy is maintained in LLMs by identifying and obfuscating PII data; including the removal of names, emails, and SSNs from LLM prompts. Leveraging the use of artificial intelligence, we will develop a software called Priv Prompt that is open source and easy to integrate while maintaining utility and accuracy. This software will be a lightweight toolkit and API to preserve privacy of users and accuracy of LLM response.

This project is completed as part of a bachelor's capstone project at Rochester Institute of Technology.

We are guided by Faculty advisor Yidan Hu.

Team Members

Zoey Chappell, Adam Braccia, and Minn Myint

Set Up the environment

  1. Run the setup_environment.py program This program will install all requirements, setup a virtual environment, create a .env file, and ask for the required API keys. We've still included the manual setps to setup the environment below.

How to Set Up a dotenv environment

By using dotenv, API keys can be set as an environment variable and not included directly in the code.

  1. Import dotenv
  2. Create a file names '.env' in the root directory. .env
  3. Add an entry in the following format: api_key = "your_api_key" NOTE: Each LLM has a specific naming scheme that the API key should follow.

To use Flask and run front end:

  1. Open Terminal
  2. Go to the location of the /my-flask-app cd /Users/adambraccia/Documents/GitHub/PrivPrompt/my-flask-app
  3. Open virtual environment python3 -m venv venv source venv/bin/activate
  4. install flask and livereload and others pip install flask flask-cors pip install livereload pip install spacy python -m spacy download en_core_web_sm pip install groq pip install python-dotenv pip install nltk pip install google-genai pip install cohere pip install openai
  5. Run app.py python app.py
  6. Open in the browser the IP http://127.0.0.1:5001

How to get a Groq API key

  1. Create an groq account and login.
  2. Go to https://console.groq.com/keys and select "Create API Key" in the upper right.
  3. Follow the steps and copy the API key.

How to get a Cohere API key

  1. Go to https://dashboard.cohere.com/welcome/login and create a new account.
  2. Navigate to the API Keys button in the left menu
  3. Make a new TRIAL KEY - NOT the production key
  4. Add the api key to your .env file by following the dotenv instructions.
  5. IMPORTANT: Make sure to follow the naming scheme COHERE_API_KEY=’your_key’

How to get a Google AI Stuido API Key

  1. Go to https://aistudio.google.com/prompts/new_chat and create an account.
  2. Select “Get API Key” in the bottom left.
  3. Create a new project by selecting "Project" from the menu on the left.
  4. Select "Create a new project" in the upper right and follow steps.
  5. Select "Api keys" in the menu on the left.
  6. Select "Create API Key" in the upper right.
  7. Name your key and select the appropriate project.
  8. Add the API key to your .env file by following the dotenv instructions.
  9. IMPORTANT: Make sure to follow the naming scheme GEMINI_API_KEY='your_key'

How to get a Deepseek API Key

Note: This is not actually communicating with Deepseek but is going through OpenRouter.

  1. Go to https://openrouter.ai/models
  2. Find Deepseek V3.1 (Free). NOTE: it must be this specific version
  3. Select Deepseek and it will bring you to this page.
  4. Scroll down until you find Create API Key.
  5. Select it and it will bring you to this page.
  6. Select Create API Key and follow the prompts.
  7. Name the key and the other options are optional.
  8. Copy the api key
  9. Add the api key to your .env file by following the dotenv instructions. Make sure to follow the naming scheme DEEPSEEK_API_KEY=’your_key’

How to get a Workers AI API Key and Workers AI Account ID

  1. Sign up for an account by navigating here. https://dash.cloudflare.com/sign-up/workers-and-pages

  2. Go to the Workers AI page - https://dash.cloudflare.com/?to=/:account/ai/workers-ai

  3. Select REST API

  4. Copy the Account ID

    Add a line to your .env file WORKERS_ACCOUNT_ID=’’

  5. Select “Create a Workers AI API Token”

  6. Review the prefilled information

  7. Select Create API Token

  8. Select Copy API Token Add a value to your .env file WORKERS_API_KEY=’yourkey’

How to get a Mistral API Key

  1. Navigate to https://v2.auth.mistral.ai/login?flow=4295c612-12e7-4aa7-8126-8805fb9cd009 and make an account
  2. Create a Team - this can just be a dummy value
  3. Navigate to API keys
  4. Choose a plan.
  5. Choose the Experiement plan Follow the steps (requires phone number verification)
  6. Select API Keys
  7. Create New API Key
  8. COPY THE API KEY Add a value to your .env file MISTRAL_API_KEY=’yourkey’

How to get a Cerebras API Key

  1. Navigate to https://cloud.cerebras.ai/
  2. Create an account and follow the prompts.
  3. Hit Continue. Scroll and Select Free
  4. Copy the API key.
  5. Add it to your .env file CEREBRAS_API_KEY=’<your_api_key>’

About

CSEC 490 PrivPrompt Repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors