Small Streamlit app for rewriting and summarizing text with the OpenAI API.
The goal of this project is to show how I structure a simple AI feature:
- separate prompts, service layer, and UI
- keep API secrets in a local .env file
- present a clean, minimal interface
- Python 3.10
- Streamlit for UI rendering
- OpenAI API for rewrite and summary generation
- Modular service layer for clean separation of logic
- Environment variables for API security
-
Rewrite text into a target tone:
- Friendly
- Confident
- Concise
- Playful
-
Summarize text into:
- Short summary
- Medium summary
- Detailed summary
-
Streamlit front end with a two column layout
-
Uses the official OpenAI Python SDK
git clone https://github.com/Dhudson-AI/rewrite-studio.git
cd rewrite-studioCreate a virtual environment:
python -m venv venvActivate it on macOS or Linux:
source venv/bin/activateActivate it on Windows:
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtCreate your environment file:
cp .env.example .envAdd your OpenAI API key inside the new .env file.
streamlit run app.pyThis opens Rewrite Studio in your browser.
Paste text into the left column.
Choose a tone or summary type.
View the rewritten output on the right.
rewrite-studio/
│
├── app.py
├── services/
│ ├── tone_rewriter.py
│ ├── summarizer.py
│ ├── client.py
├── ui/
│ ├── layout.py
│ ├── components.py
├── .env.example
├── requirements.txt
└── README.md
The project follows a simple separation of concerns.
- The ui folder handles layout and presentation
- The services folder contains prompt templates and API logic
- The client module manages model configuration and request handling
Tone rewriting uses structured prompts for clarity and consistency.
Summaries use proportional compression to preserve important ideas.
Rewrite Studio demonstrates practical skills required for real AI powered features:
- Designing clear and controlled prompts
- Organizing a small but complete codebase
- Handling environment variables securely
- Creating a minimal and functional UI
- Writing code that can be extended without major rewrites
Possible improvements:
- Additional tone options
- More summary modes
- Export rewritten text as PDF or Markdown
- History view for previous rewrites
- Light authentication support
- Python 3.10 or newer
- Streamlit
- OpenAI Python SDK
- python-dotenv
All dependencies are listed in requirements.txt.
MIT License. You may use or modify this project with attribution.
Created by Dillon Hudson
GitHub profile: https://github.com/Dhudson-AI


