- Anki 25.x or newer (Qt 6, PyQt 6, Python 3.10+).
- An account/key for at least one supported AI provider.
The easiest way to install is through AnkiWeb:
- Open Anki.
- Go to Tools → Add-ons → Get Add-ons….
- Paste the code
2119980872and press OK. - Restart Anki.
Or install directly: https://ankiweb.net/shared/info/2119980872
The repo is https://github.com/athulkrishna2015/AI-Hints. The packaged add-on lives in addon/, the user docs in docs/, and the regression tests in tests/. For the full code map, see Architecture & Code; for runtime files see Data Storage, Files & State.
When cloning for the first time, initialize the ai-latex-fixer Git submodule so addon/latex_fixer/ is populated:
git clone https://github.com/athulkrishna2015/AI-Hints.git
cd AI-Hints
git submodule update --initThe fastest way to test changes is to symlink the addon/ folder directly into your Anki add-ons directory so Anki loads your live code on every restart.
Linux / macOS:
ln -s "$(pwd)/addon" ~/.local/share/Anki2/addons21/ai_hints_devWindows (Admin PowerShell):
New-Item -ItemType SymbolicLink -Path "$env:APPDATA\Anki2\addons21\ai_hints_dev" -Target "$pwd\addon"If you modify addon/web/template.js, sync it to your Anki profile's media folder as _ai_hints_template.js for the changes to take effect in the reviewer. The add-on syncs it automatically on startup (delayed), but manual sync is faster during development.
Linux example:
cp addon/web/template.js ~/.local/share/Anki2/default/collection.media/_ai_hints_template.js && echo "Synced successfully"For the runtime globals, data contract, and pycmd protocol the script uses, see Frontend (JavaScript) Reference.
AI-Hints vendors third-party libraries and configurations directly in the addon/ tree to stay self-contained (no pip install required for users).
json_repair(addon/json_repair/) — robust AI response JSON parser.latex_fixer(addon/latex_fixer/) — LaTeX/MathJax normalization engine.
To refresh every vendored dependency to its latest GitHub master/main:
python3 update_deps.pyWhile
latex_fixeris initially set up as a Git submodule,update_deps.pysyncs its core files without managing submodule pointers manually.
# Auto-bump patch version and build:
python make_ankiaddon.py
# Set an explicit version:
python make_ankiaddon.py 1.6.1
# Remove older local packages before building:
python make_ankiaddon.py --cleanThis produces a timestamped file like AI_Hints_v7.0.5_202608280017.ankiaddon in the repo root. Existing .ankiaddon packages are preserved by default; pass --clean to remove them.
What gets included in the package (all Python source under addon/, addon/latex_fixer/, addon/json_repair/, addon/config.json, VERSION, manifest.json).
What is excluded (__pycache__/, .pyc, .md, .png, meta.json, ai_hints.log*, tests/, and anything matched by .gitignore).
To bump the version without building:
python bump.py # patch
python bump.py minor # minor
python bump.py major # majorbump.py follows major.minor.patch semver (e.g. 7.0.4 → 7.0.5).
The project includes a regression suite covering core logic, UI behavior, and network integrations.
Mocks the Anki / Qt environment. No API keys or internet required.
python3 -B scratch/local_verify.pyTargeted unit tests for core internal engines.
python3 -B tests/test_latex_fixer.py
python3 tests/test_json_repair_integration.py
python3 tests/test_card_parser.py
python3 tests/test_sanitization_regex.pyVerifies the orchestration of background processes and UI states.
python3 tests/test_generation_cycle.py
python3 tests/test_local_ai.pyRequires real API keys configured in addon/config.json or a local meta.json.
python3 scratch/live_test.py
python3 tests/test_raw_local.pyRequires the AnkiConnect add-on (https://ankiweb.net/shared/info/2055492159) enabled and Anki running with the plugin listening on localhost:8765. These scripts talk to the live collection, so run them on a disposable profile / deck:
python3 tests/test_ankiconnect_live.py
python3 tests/test_live_ankiconnect.pyRun all discovery-compatible tests using Python's standard unittest runner:
python3 -B -m unittest discover -s tests -p "test_*.py"(The two AnkiConnect scripts above are __main__-driven and are not auto-discovered here, so the full suite needs no live Anki running.)
-
Make changes; commit on
master(this repo does not use branches for releases). -
Bump + build:
python3 make_ankiaddon.py
This auto-bumps the patch version in
addon/VERSION+addon/manifest.jsonand writesAI_Hints_v<version>_<timestamp>.ankiaddonin the repo root. -
Add a
## <version> (YYYY-MM-DD)entry tochangelog.md(move anything in## Unreleasedinto the new version section). -
Commit:
release: AI-Hints vX.Y.Z. -
Tag and push:
git tag -a vX.Y.Z -m "AI-Hints vX.Y.Z" git push origin master git push origin vX.Y.Z -
Create the GitHub release with the
.ankiaddonasset:gh release create vX.Y.Z AI_Hints_vX.Y.Z_*.ankiaddon \ --title "AI-Hints vX.Y.Z" \ --notes "<release notes>"
-
Upload the same
.ankiaddonto AnkiWeb: https://ankiweb.net/shared/upload.
AI-Hints is provider-agnostic. Get a key from one (or more) of the supported providers:
| Provider | Key page |
|---|---|
| Google Gemini | https://aistudio.google.com/app/apikey |
| OpenAI | https://platform.openai.com/api-keys |
| Anthropic | https://console.anthropic.com/ |
| Groq | https://console.groq.com/keys |
| SambaNova | https://cloud.sambanova.ai/apis |
| Hugging Face | https://huggingface.co/settings/tokens |
| OpenRouter | https://openrouter.ai/keys |
| DeepSeek, Grok (xAI), NVIDIA, Mistral, Cerebras | visit each provider's developer portal |
- Open Anki.
- Go to Tools → Add-ons → AI-Hints → Config.
- Open the AI Providers tab.
- Select a provider, paste your API key into its field, pick a model, and click Test to verify connectivity.
Each provider key field supports multiple keys for automatic rotation and fallback:
name:key— a named keykey (name)— a named key- Separate multiple keys with commas, semicolons, or newlines.
You can also click the 🔑 button next to a provider to open the Manage Multiple API Keys dialog, where keys can be labeled, individually enabled/disabled, and rotated.
You can add any OpenAI-compatible endpoint (Ollama, LM Studio, vLLM, AIHubMix, etc.):
- In the AI Providers tab, click Add under Custom Providers.
- Fill in a Provider Name, Endpoint URL, and optionally an API Key.
- Click Fetch to load models, then select one.
Local endpoints without authentication can leave the API key blank.
After entering a key:
- Click Test on the provider row. A ✅ status means the connection works.
- Optionally click Test All to check every configured provider.
- Review a card and click the Generate button (or use a shortcut) to confirm hints and options appear.
If you run into issues, see Troubleshooting.