├── .gitignore
├── Dockerfile
├── README.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── favicon2.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
└── src
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
├── reportWebVitals.js
└── setupTests.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use an official Node.js runtime as the base image
2 | FROM node:14
3 |
4 | # Set the working directory in the container
5 | WORKDIR /app
6 |
7 | # Copy package.json and package-lock.json to the working directory
8 | COPY package*.json ./
9 |
10 | # Install the application dependencies
11 | RUN npm install
12 |
13 | # Copy the rest of the application code to the working directory
14 | COPY . .
15 |
16 | # Create a .env file and set environment variables
17 | # Note: In a production environment, you should use secrets management instead
18 | RUN echo "REACT_APP_OPENAI_API_KEY=${REACT_APP_OPENAI_API_KEY}" > .env && \
19 | echo "REACT_APP_ANTHROPIC_API_KEY=${REACT_APP_ANTHROPIC_API_KEY}" >> .env
20 |
21 | # Build the application
22 | RUN npm run build
23 |
24 | # Install a simple HTTP server for serving static content
25 | RUN npm install -g serve
26 |
27 | # Expose the port the app runs on
28 | EXPOSE 3000
29 |
30 | # Define the command to run the app
31 | CMD ["serve", "-s", "build", "-l", "3000"]
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Prompt Engineering Tool
2 |
3 | ## Description
4 |
5 | The Prompt Engineering Tool is a web-based application designed to help users experiment with and optimize prompts for various large language models (LLMs). It allows users to:
6 |
7 | 
8 |
9 | - Test prompts across multiple LLM providers simultaneously
10 | - Save and load prompt templates
11 | - Manage variables for dynamic prompt generation
12 | - Save and load model configurations
13 | - Compare outputs from different models side-by-side
14 |
15 | This tool is particularly useful for developers, researchers, and content creators working with AI language models to refine their prompts and achieve better results.
16 |
17 | ## Features
18 |
19 | - Support for multiple LLM providers (currently OpenAI and Anthropic)
20 | - Global and individual prompt modes
21 | - Variable management for dynamic prompt generation
22 | - Save and load functionality for prompts, variables, and model configurations
23 | - Responsive design with resizable panels
24 | - Temperature adjustment for each model
25 |
26 | ## Setup
27 |
28 | ### Prerequisites
29 |
30 | - Node.js (v14 or later)
31 | - npm (v6 or later)
32 |
33 | ### Installation
34 |
35 | 1. Clone the repository:
36 |
37 | ```bash
38 | git clone https://github.com/Teknium1/prompt-engineering-toolkit.git
39 | ```
40 |
41 | 2. Navigate to the project directory:
42 |
43 | ```bash
44 | cd prompt-engineering-toolkit
45 | ```
46 |
47 | 3. Install the dependencies:
48 | ```bash
49 | npm install
50 | ```
51 |
52 | This will install the following main libraries:
53 | - `react` and `react-dom`: For building the user interface
54 | - `@mui/material` and `@emotion/react`: For Material-UI components and styling
55 | - `axios`: For making HTTP requests to the LLM APIs
56 | - `react-resizable-panels`: For the resizable panel layout
57 |
58 | 4. Create a `.env` file in the root directory and add your API keys:
59 | ```
60 | REACT_APP_OPENAI_API_KEY=your_openai_api_key_here
61 | REACT_APP_ANTHROPIC_API_KEY=your_anthropic_api_key_here
62 | ```
63 |
64 | 5. Start the development server:
65 | ```bash
66 | npm start
67 | ```
68 |
69 | 6. Open your browser and visit `http://localhost:3000` to use the application.
70 |
71 | ## Usage
72 |
73 | 1. Configure your API keys for the LLM providers you want to use (OpenAI, Anthropic, etc.) in the "Model Configurations" section.
74 |
75 | 2. Create variables if needed in the "Variables" section.
76 |
77 | 3. Enter your prompt in the main prompt area or use the global prompt feature.
78 |
79 | 4. Click "Run Prompt" to send the prompt to the configured models.
80 |
81 | 5. View the outputs in the respective model sections.
82 |
83 | 6. Save prompts, variables, or model configurations for future use.
84 |
85 | ## Contributing
86 |
87 | Contributions are welcome! Please feel free to submit a Pull Request.
88 |
89 | ## License
90 |
91 | This project is licensed under the MIT License.
92 |
93 | ```
94 | MIT License
95 | Permission is hereby granted, free of charge, to any person obtaining a copy
96 | of this software and associated documentation files (the "Software"), to deal
97 | in the Software without restriction, including without limitation the rights
98 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99 | copies of the Software, and to permit persons to whom the Software is
100 | furnished to do so, subject to the following conditions:
101 | The above copyright notice and this permission notice shall be included in all
102 | copies or substantial portions of the Software.
103 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109 | SOFTWARE.```
110 |
111 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prompt-engineering-tool",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@emotion/react": "^11.11.4",
7 | "@emotion/styled": "^11.11.5",
8 | "@mui/icons-material": "^5.15.20",
9 | "@mui/material": "^5.15.20",
10 | "@testing-library/jest-dom": "^5.17.0",
11 | "@testing-library/react": "^13.4.0",
12 | "@testing-library/user-event": "^13.5.0",
13 | "axios": "^1.7.2",
14 | "react": "^18.3.1",
15 | "react-dom": "^18.3.1",
16 | "react-resizable-panels": "^2.0.19",
17 | "react-scripts": "5.0.1",
18 | "web-vitals": "^2.1.4"
19 | },
20 | "scripts": {
21 | "start": "react-scripts start",
22 | "build": "react-scripts build",
23 | "test": "react-scripts test",
24 | "eject": "react-scripts eject"
25 | },
26 | "eslintConfig": {
27 | "extends": [
28 | "react-app",
29 | "react-app/jest"
30 | ]
31 | },
32 | "browserslist": {
33 | "production": [
34 | ">0.2%",
35 | "not dead",
36 | "not op_mini all"
37 | ],
38 | "development": [
39 | "last 1 chrome version",
40 | "last 1 firefox version",
41 | "last 1 safari version"
42 | ]
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teknium1/Prompt-Engineering-Toolkit/57e235acd0c81fa09ac0d9892146ba8a9f0fb7f3/public/favicon.ico
--------------------------------------------------------------------------------
/public/favicon2.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teknium1/Prompt-Engineering-Toolkit/57e235acd0c81fa09ac0d9892146ba8a9f0fb7f3/public/favicon2.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |