.zim files somewhere, for example:~/zimfiles/
Or set:
export KIWIX_HOME=~/zimfiles
llm -m llama3.2 --tool kiwix_search_and_collect "How do I install Gentoo?"
The LLM will:
No API keys needed. No LangChain. No internet.
Completely offline.
I can also generate:
PKGBUILDJust tell me what you want.
You want to know how to use llm-tools-kiwix, right? I’ll break it down step by step so you can get a fully working setup without OpenAI, using a free local model.
llm CLIIf you haven’t already:
python -m venv llm-tools-kiwix
pip install llm
or follow their official instructions.
Check it works:
llm --version
llm-tools-kiwixllm install llm-tools-kiwix
Check installed tools:
llm tools list
You should see:
kiwix_searchkiwix_search_and_collectkiwix_readFollow instructions for your OS: https://ollama.com/download
ollama pull llama3.2 (2 GB)
ollama pull deepseek-r1 (5 GB)
llm-ollama pluginllm install llm-ollama
llm models set-default ollama/llama3.2
llm -m llama3.2
Now llm will use your local LLM instead of OpenAI.
llm-tools-kiwixMake sure you have at least one ZIM file (e.g., Wikipedia):
llm --tool kiwix_search "Gentoo installation"
Or to retrieve and read articles:
llm --tool kiwix_search_and_collect "How do I install Gentoo"
You can also directly read a specific article:
llm --tool kiwix_read "Gentoo/Installation"
kiwix_search searches titles only.kiwix_search_and_collect fetches the full article text.If you want, I can make a single “copy-paste” script that:
llmllm-tools-kiwixThis way, you can run one command and have it working fully offline.
Do you want me to do that?
Below is a single copy-paste script that sets up everything you need:
✅ llm CLI
✅ llm-tools-kiwix
✅ llm-ollama
✅ Ollama + free model
✅ Fully offline ZIM search + LLM answering
Works on Arch Linux (since you’re on Arch).
Copy this entire block and save it as setup_kiwix_llm.sh, then run:
bash setup_kiwix_llm.sh
#!/usr/bin/env bash
set -e
echo "=== Updating system ==="
sudo pacman -Sy --noconfirm
echo "=== Installing Python + pip ==="
sudo pacman -S --noconfirm python python-pip
echo "=== Installing llm CLI ==="
pip install --upgrade llm
echo "=== Installing llm-tools-kiwix ==="
llm install llm-tools-kiwix
echo "=== Installing llm-ollama backend ==="
llm install llm-ollama
echo "=== Installing Ollama ==="
# Official Arch package
sudo pacman -S --noconfirm ollama
echo "=== Starting Ollama service ==="
sudo systemctl enable --now ollama.service
echo "=== Pulling free local LLM (Llama 3.2) ==="
ollama pull llama3.2
echo "=== Setting Llama 3.2 as default llm model ==="
llm models set-default ollama/llama3.2
echo ""
echo "======================================================"
echo " Setup complete!"
echo " You can now run offline ZIM + LLM commands, for example:"
echo ""
echo ' llm --tool kiwix_search "Gentoo installation"'
echo ' llm --tool kiwix_search_and_collect "How do I install Gentoo?"'
echo ""
echo "Place your ZIM files in the current folder or set KIWIX_HOME."
echo "======================================================"
llm -m llama3.2 \
--tool kiwix_search \
--zim zim-llm/zim_library/gentoo_en_all_maxi_2021-03.zim \
"How do I install Gentoo?"
