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.
Zoey Chappell, Adam Braccia, and Minn Myint
- 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.
By using dotenv, API keys can be set as an environment variable and not included directly in the code.
- Import dotenv
- Create a file names '.env' in the root directory. .env
- 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.
- Open Terminal
- Go to the location of the /my-flask-app cd /Users/adambraccia/Documents/GitHub/PrivPrompt/my-flask-app
- Open virtual environment python3 -m venv venv source venv/bin/activate
- 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
- Run app.py python app.py
- Open in the browser the IP http://127.0.0.1:5001
- Create an groq account and login.
- Go to https://console.groq.com/keys and select "Create API Key" in the upper right.
- Follow the steps and copy the API key.
- Go to https://dashboard.cohere.com/welcome/login and create a new account.
- Navigate to the API Keys button in the left menu
- Make a new TRIAL KEY - NOT the production key
- Add the api key to your .env file by following the dotenv instructions.
- IMPORTANT: Make sure to follow the naming scheme COHERE_API_KEY=’your_key’
- Go to https://aistudio.google.com/prompts/new_chat and create an account.
- Select “Get API Key” in the bottom left.
- Create a new project by selecting "Project" from the menu on the left.
- Select "Create a new project" in the upper right and follow steps.
- Select "Api keys" in the menu on the left.
- Select "Create API Key" in the upper right.
- Name your key and select the appropriate project.
- Add the API key to your .env file by following the dotenv instructions.
- IMPORTANT: Make sure to follow the naming scheme GEMINI_API_KEY='your_key'
Note: This is not actually communicating with Deepseek but is going through OpenRouter.
- Go to https://openrouter.ai/models
- Find Deepseek V3.1 (Free). NOTE: it must be this specific version
- Select Deepseek and it will bring you to this page.
- Scroll down until you find Create API Key.
- Select it and it will bring you to this page.
- Select Create API Key and follow the prompts.
- Name the key and the other options are optional.
- Copy the api key
- 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’
-
Sign up for an account by navigating here. https://dash.cloudflare.com/sign-up/workers-and-pages
-
Go to the Workers AI page - https://dash.cloudflare.com/?to=/:account/ai/workers-ai
-
Select REST API
-
Copy the Account ID
Add a line to your .env file WORKERS_ACCOUNT_ID=’’
-
Select “Create a Workers AI API Token”
-
Review the prefilled information
-
Select Create API Token
-
Select Copy API Token Add a value to your .env file WORKERS_API_KEY=’yourkey’
- Navigate to https://v2.auth.mistral.ai/login?flow=4295c612-12e7-4aa7-8126-8805fb9cd009 and make an account
- Create a Team - this can just be a dummy value
- Navigate to API keys
- Choose a plan.
- Choose the Experiement plan Follow the steps (requires phone number verification)
- Select API Keys
- Create New API Key
- COPY THE API KEY Add a value to your .env file MISTRAL_API_KEY=’yourkey’
- Navigate to https://cloud.cerebras.ai/
- Create an account and follow the prompts.
- Hit Continue. Scroll and Select Free
- Copy the API key.
- Add it to your .env file CEREBRAS_API_KEY=’<your_api_key>’