A Flask web application that generates jokes using various Large Language Models (LLMs) through the Groq API. Users can select their preferred language model, choose between English and Portuguese languages, and specify a theme for the joke.
- Multiple LLM model selection (llama-3.3-70b-versatile, deepseek-r1-distill-llama-70b, gemma2-9b-it, mixtral-8x7b-32768)
- Bilingual support (English and Portuguese)
- Theme-based joke generation
- Mobile-responsive interface
- Clean and user-friendly UI using Bootstrap
- Python 3.x
- Groq API key
- Clone the repository:
git clone https://github.com/yourusername/ai-joke-generator.git
cd ai-joke-generator- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate- Install the required dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory and add your Groq API key:
GROQ_API_KEY=your_api_key_here
- Start the Flask development server:
python app.py- Open your web browser and navigate to:
http://localhost:5001
-
Select your preferred:
- Language model
- Language (English or Portuguese)
- Enter a theme for the joke
-
Click "Generate Joke" to get your customized joke
The application includes Gunicorn in its dependencies for production deployment. You can deploy it to platforms like Heroku, DigitalOcean, or any other Python-compatible hosting service.
├── templates/
│ ├── index.html # Main page with joke generation form
│ └── result.html # Page displaying the generated joke
├── .gitignore # Git ignore file
├── app.py # Main Flask application
├── LICENSE # MIT License
├── README.md # Project documentation
└── requirements.txt # Python dependencies
- Flask: Web framework
- Groq: API client for LLM interactions
- python-dotenv: Environment variable management
- gunicorn: Production WSGI server
- Additional dependencies listed in
requirements.txt
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Built with Flask framework
- Styled with Bootstrap
- Powered by Groq API and various LLM models
Made with ❤️ by Augusto Souza and with assistance from ChatGPT (click here to access the main used chat)