This is a fully offline Flashcard Generator powered by Phi-3 using the Ollama runtime. It lets you:
- Input text or upload PDFs
- Generate flashcards in Q/A format using phi3
- Export to CSV or directly as .apkg (Anki Deck)
- No API keys, no internet needed — all runs locally on your system
- Text or PDF-based input
- Use local LLM (phi3) via Ollama
- Export to
.csvfor spreadsheets or.apkgfor Anki - Option to choose how many flashcards to generate
- Simple web UI using Streamlit
Make sure the following are installed:
git clone git@github.com:but-pixelated/flashcard-generator.git
cd flashcard-generatorMac/Linux:
python3 -m venv virtualenv
source virtualenv/bin/activateWindows:
python -m venv virtualenv
virtualenv\Scripts\activatepip install -r requirements.txtThe requirements.txt includes:
- streamlit
- pymupdf
- pandas
- genanki
- ollama
Follow the instructions here:
https://ollama.com/download
Then run:
ollama pull phi3This will download the phi3 model locally (~2GB+)
python -m streamlit run app.py (recommended, so it does not run the global venv)
or
streamlit run app.pyVisit in browser:
http://localhost:8501
- Choose Input Mode: Text or PDF
- Enter content or upload a PDF
- Choose number of flashcards to generate
- Click ** Generate Flashcards**
- View them in the app
- Download:
- as
.csv - or as Anki
.apkg
- as
Q: What is the powerhouse of the cell?
A: The mitochondria, which generates energy (ATP) through cellular respiration.
- CSV: Opens in Excel/Google Sheets
- Anki .apkg: Importable directly into the Anki app
-
No flashcards found?
→ Try reducing input size or making input clearer -
App feels slow?
→ Phi3 runs on CPU — be patient! -
Mac permission issues?
→ Trychmod +xor allow Terminal access to documents
flashcard-generator/
├── app.py # main Streamlit app
├── requirements.txt # python3 dependencies
├── README.md # this file
├── virtualenv/ # your Python env (not tracked in git)
MIT License – free to use, fork, and improve.
Made with 💙 by @but-pixelated
Powered by:
- OpenAI’s Phi-3
- Ollama
- Streamlit
- genanki