Open-source Python app for generating flashcards from learning materials using open LLMs, developed as part of GSoC 2026, with AnkiDroid as mentoring organization.
- Takes learning materials as input: supports .txt, .PDF, and .md/.markdown.
- Uses a local Ollama model for generation: users may pick their model of choice.
- Generates basic-style flashcards: Q&A format, atomic, concise, grounded.
- Writes the generated cards to disk: exports them as JSON or CSV.
- Shares the cards with AnkiDroid via the companion Android app (coming soon).
Optional but recommended, for shorter commands, install just:
uv tool install rust-justIf you don't install it, replace just with uv run just in the commands below.
- Run the app with
just runand open it in the browser. - Upload learning materials, pick a model, and start generation.
- Download the cards or share them with AnkiDroid via the companion app (coming soon).
flashcard-generator-demo.mov
For now, the app has the following constraints:
- Supports only UTF-8-encoded text and Markdown files.
- Supports only PDFs with highlightable text, not scanned PDFs.
- PDFs with images require a vision-capable model, such as
gemma4. - Requires the companion Android app for pushing cards to AnkiDroid.
- Generated flashcards in Q&A format only, i.e. basic notes.
The justfile contains useful development commands. Here's a selection:
just # Show all commands
just format # Format the code
just lint # Lint the code
just typecheck # Typecheck the code
just test # Run all tests
just fix # Run all mutable QA: auto-fix issues
just check # Run all non-mutable QA: signal issuesThe app is structured as a pipeline with the following components:
The project is broken down into the following modules, which roughly correspond to each step in our pipeline.
.
├── LICENSE
├── README.md
├── justfile
├── pyproject.toml
├── src
│ └── flashcard_generator
│ ├── app.py # UI and app flow
│ ├── card.py # Pydantic card models
│ ├── clean.py # Document cleaning
│ ├── export.py # Card exporting
│ ├── extract.py # Document extracting
│ ├── generate.py # Card generation
│ ├── pipeline.py # Pipeline orchestration
│ ├── prompt.py # Prompt definitions
│ └── share.py # Card sharing
├── tests
│ └── ...
└── uv.lockThis software is distributed with an AGPL licence. Refer to LICENSE for more details.