An AI-powered workout planner built with Python, Streamlit, and the OpenAI API.
The application generates personalized workouts based on a user's height, weight, age, gym experience, fitness goal, workout duration, and selected muscle group. Rather than allowing the AI to invent exercises, it first filters a curated exercise database and then asks the AI to create a structured workout using only those exercises.
- Personalized AI-generated workout plans
- Experience-based exercise selection
- Goal-specific training (Muscle Gain, Fat Loss, Strength, Endurance)
- Muscle group selection
- Adjustable workout duration
- Curated exercise database
- Structured AI outputs using Pydantic
- Clean Streamlit interface
- Python 3.12+
- Streamlit
- OpenAI API
- Pydantic
- python-dotenv
- JSON exercise database
- uv
Clone the repository:
git clone https://github.com/your-username/gym-ai-planner.git
cd gym-ai-plannerInstall dependencies:
uv syncCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_api_keyRun the application:
uv run streamlit run app.py-
Enter your height, weight, age, gym experience, goal, workout duration, and today's workout.
-
The app filters a curated exercise database for relevant exercises.
-
The filtered exercises and user profile are sent to the AI.
-
The AI returns a structured workout plan containing:
- Warm-up
- Exercises
- Sets
- Repetitions
- Rest periods
- Cool-down
-
The workout is displayed in the Streamlit interface.
This project is licensed under the MIT License.