Upload a PDF or image, get an Anki deck. Pages go through GLM-OCR for markdown extraction, Qwen turns the markdown into flashcards, you review and edit them in a Streamlit UI, then export a .apkg.
upload → GLM-OCR (per page) → markdown → Qwen → JSON cards → edit → .apkg
Both models run locally via vLLM; the Streamlit app talks to them over OpenAI-compatible HTTP endpoints.
conda create -n qwenki python=3.12 -y
conda activate qwenki
pip install -r requirements.txtRequires an NVIDIA GPU with the container toolkit installed. Models are pulled on first start and cached under ~/.cache/huggingface.
cd hosting
docker compose up -dThis starts two services:
| Service | Port | Model |
|---|---|---|
qwen_llm |
8002 | cyankiwi/Qwen3.5-4B-AWQ-4bit |
glm_ocr |
8003 | zai-org/GLM-OCR |
Tail logs while warmup happens (first run downloads weights):
docker compose logs -fFrom the repo root:
streamlit run app.pyOpen the URL Streamlit prints. If your vLLM containers run on a different host or port, adjust the endpoints in the sidebar under Settings → Endpoints (or set OCR_BASE_URL / LLM_BASE_URL).
- Drop one or more PDFs / images into the uploader.
- Pick a generation mode in the sidebar:
- Single call: one LLM request, best coherence, slower on long docs.
- Parallel per page: concurrent requests, faster, card count is approximate.
- Hit Extract & generate, review the cards, edit as needed.
- Build .apkg → Download .apkg → import in Anki.
app.py Streamlit UI
pipeline.py OCR + card generation (sync + parallel)
anki_export.py genanki → .apkg
system_prompt.txt editable prompt for the card author
hosting/ Docker Compose + Dockerfiles for the vLLM servers
- Initial Release
- [] Model Customization
- [] ARM Support
This project is made possible thanks to the following incredible open-source models and tools. Please note that while the core logic and integration of this tool are licensed under the PolyForm Noncommercial 1.0.0 license, the underlying models remain under their respective licenses.
-
GLM-OCR: Developed by Z.ai (Zhipu AI). Used for high-precision, multimodal document layout analysis and text extraction.
-
Qwen3.5-4B-AWQ-4bit: The base model was developed by Alibaba Cloud (Qwen team), with this specific 4-bit AWQ quantized version provided by cyankiwi for efficient local inference.
