Generate high-quality question-answer flashcards from your study materials using the power of Large Language Models (LLMs).
LLM Flashcard Generator is a modern Streamlit web app that transforms any educational content—be it textbook excerpts, lecture notes, or even a single word—into effective, editable flashcards. Powered by Google Gemini, it is designed for students, educators, and lifelong learners who want to supercharge their revision and teaching.
Traditional flashcard creation is time-consuming and repetitive. With the rise of LLMs, we can automate this process, ensuring high-quality, diverse, and context-aware Q&A pairs for any subject or topic—instantly.
- Flexible Input: Upload
.txtfiles or paste any text - Subject Selection: Guide flashcard style by subject (Biology, History, etc.)
- LLM-Powered: Uses Google Gemini for accurate, context-rich flashcards
- Robust: Works even with a single word as input
- Review & Edit: Interactive table for editing and refining flashcards
- Export: Download as CSV or JSON for use in Anki, Quizlet, etc.
- Modern UI: Clean, responsive Streamlit interface
- No-code: Runs locally in your browser
- Frontend/UI: Streamlit
- Backend/LLM: Google Gemini API
- Helpers: Python, pandas, dotenv
LLM/
├── app.py # Main Streamlit app
├── gemini_utils.py # LLM API integration (Gemini)
├── requirements.txt # Python dependencies
├── .env # Environment variables (your API key)
├── README.md # This file
├── streamlit_debug.py # (Optional) Debugging helpers
├── test_gemini_flashcards.py # (Optional) Test script for Gemini API
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo -
Install dependencies:
pip install -r requirements.txt
-
Set up your API key:
Create a file named
.envin the project root:GEMINI_API_KEY=YOUR_GEMINI_API_KEY
(Get your Gemini API key from Google AI Studio)
-
Run the app locally:
streamlit run app.py
The app will open in your browser at http://localhost:8501
This project is designed to be run from any terminal environment, including Git Bash, Windows Command Prompt, PowerShell, Mac Terminal, and Linux shell. Follow these professional, step-by-step instructions to ensure a smooth setup and launch:
Clone the repository from GitHub using your preferred terminal:
git clone https://github.com/yourusername/your-repo.git
cd your-repoInstall all required Python packages:
pip install -r requirements.txt- If you have multiple Python versions, use:
python -m pip install -r requirements.txt
- If you encounter permission errors, try:
pip install --user -r requirements.txt
Create a .env file in the project root directory and add your Gemini API key:
GEMINI_API_KEY=YOUR_GEMINI_API_KEY- Replace
YOUR_GEMINI_API_KEYwith your actual key from Google AI Studio.
Start the Streamlit app using one of the following commands:
streamlit run app.py- If
streamlitis not recognized, use:python -m streamlit run app.py
After running the command, open your browser and navigate to http://localhost:8501 to use the app.
- All commands above work in Git Bash, Command Prompt, PowerShell, Mac Terminal, and Linux shell.
- If you see a
ModuleNotFoundError, ensure you are installing packages for the same Python interpreter that runs Streamlit. - For advanced troubleshooting, consult the Streamlit documentation or your terminal’s help resources.
Make sure your .env and requirements.txt are present, then run:
streamlit run app.py- Create a new GitHub repo:
- Go to github.com/new
- Push your code:
git init git remote add origin https://github.com/yourusername/your-repo.git git add . git commit -m "Initial commit" git push -u origin main
- (Optional) Deploy on Streamlit Cloud:
- Go to streamlit.io/cloud
- Connect your GitHub repo and follow their deployment steps
- Add your
GEMINI_API_KEYin the Streamlit Cloud secrets manager
- Upload your educational material or paste text
- Select a subject (optional, but improves results)
- Click Generate Flashcards
- Review and edit the generated flashcards
- Export as CSV or JSON
Q: What file types are supported?
A: You can upload .txt 'docx' files or paste any text.
Q: Is my data private? A: Yes, all processing happens locally—your data is never stored or shared.
Q: Can I use my own LLM or API key?
A: Yes! Just set your API key in the .env file.
Q: Can I deploy this on the web? A: Absolutely! Use Streamlit Cloud for one-click deployment.
For major changes, please open an issue first to discuss what you would like to change.
Thank you for using LLM Flashcard Generator! If you have any questions or need support, please open an issue or email urjagjeetsingh@gmail.com.
