This guide explains how to register the "Kiwix Search" tool in your local Open WebUI instance. This allows models to search your offline ZIM files (Wikipedia, StackOverflow, etc.).
- Open WebUI running (
http://localhost:3000) - Kiwix Server running (
http://localhost:8080) - At least one ZIM file in
/opt/civilization/library/zims/(and container restarted)
-
Access Open WebUI Open your browser and navigate to http://localhost:3000.
-
Open Workspace Click on the Workspace icon in the sidebar (usually 4th icon down).
-
Create New Tool
- Click Tools tab.
- Click the + (Plus) button to create a new tool.
-
Fill Details
- Name:
Kiwix Library - ID:
kiwix_search - Description:
Search offline Wikipedia and documentation.
- Name:
-
Paste Code Copy the content of
kiwix_tool.pyand paste it into the code editor area.Note: Open WebUI tools run inside the Open WebUI container. The hostname
civ_libraryused in the code resolves correctly because both containers share thecivilization_netnetwork. -
Save Click Save & Update.
- Enable Tool: When starting a new chat, click the + (Plus) button next to the message input.
- Select Tool: Toggle Kiwix Library on.
- Prompt:
- "Search the offline library for the history of the internet."
- "Find python documentation for list comprehensions in the local wiki."
Error: "Connection refused"
- Ensure the Kiwix container is running:
docker ps - Ensure
civ_libraryis the correct container name indocker-compose.yml.
Error: "No results found"
- Verify you have ZIM files mounted:
ls /opt/civilization/library/zims - Restart Kiwix if you added files recently:
docker restart civ_library