Offline AI knowledge base: read, search and ask your ZIM library (Wikipedia and the Kiwix catalog) with a local or hosted model, and serve it to LLM apps over MCP.
pip install zim-pro==0.5.1 Copy PIP instructions
An offline AI knowledge base. Zim Pro turns a folder of ZIM files (offline Wikipedia, Stack Exchange, DevDocs, iFixit and the rest of the Kiwix catalog) into a library you can read, search and question, on your own machine.
Ask AI: an answer written from your books, with citations and the sources beside it
The screenshots are in screenshots/. The articles and pictures shown in them come from Wikipedia and Appropedia, which publish them under Creative Commons licences. The links and feeds shown on the Create and Feeds pages are public sites used as examples.
The image is published at ghcr.io/magicstack-llp/zim-pro for amd64 and arm64. It needs two folders: your ZIM files, mounted at /data, and a folder for its database, mounted at /state. The container runs as the user you give it, who must be able to write to both (to /data because that is where downloads and updates go).
mkdir -p zims state # create them yourself, or Docker creates them as root docker run -d --name zim-pro \ --restart unless-stopped \ --user "$(id -u):$(id -g)" \ -p 8083:8080 \ -v "$PWD/zims:/data" \ -v "$PWD/state:/state" \ --add-host host.docker.internal:host-gateway \ ghcr.io/magicstack-llp/zim-pro:latest Then open http://localhost:8083. --add-host is only needed for Ask AI to reach a model server on the same machine (Ollama, LM Studio, llama.cpp).
services: zim-pro: image: ghcr.io/magicstack-llp/zim-pro:latest container_name: zim-pro restart: unless-stopped user: "1000:1000" # your own uid:gid, from `id -u` and `id -g` ports: - "8083:8080" extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./zims:/data # your folder of .zim files - ./state:/state # environment: # KIWIX_ADMIN_TOKEN: change-me # required for changes and /mcp when set mkdir -p zims state docker compose up -d Ready-made files The docker/ folder has complete compose files for each setup, with their values in one .env file. Copy the folder, pick a file, and start it:
cd docker cp .env.example .env # then edit it mkdir -p zims state docker compose -f compose.vpn.yml up -d docker/README.md says which to choose.
Everything Zim Pro can use, in one file. Only the zim-pro service is required: delete the parts you do not want. The comments say which setting each part goes with, and Sites that block or check visitors and Browser capture explain them.
If Gluetun already runs somewhere else (its own compose file, or docker run): leave the gluetun and flaresolverr services out of this file, remove depends_on, and uncomment the two networks: blocks, so that Zim Pro joins the network Gluetun is on. Without that, Test connection answers that gluetun cannot be found. Keep default in the list: it is what the container uses for everything else.
Then fill in Settings → Network and press Test connection there. Nothing leaves through the VPN or the solver until their addresses are saved in Settings.
Removing the container loses nothing: the books are in zims and the settings, chats and download progress are in state. A download in progress when the container stops carries on from where it was when it starts again.
To stay on one version, use a version tag in place of latest, such as :0.5.0 or :0.5.
The compose.yml in this repository builds the image from source. It is the full setup (VPN, captcha solver and browser capture), so it needs the VPN values in .env; see docker/.env.example. To build and run Zim Pro alone:
mkdir -p zims state docker compose up -d --build --no-deps zim-pro # http://localhost:8083 It mounts /mnt/storage/Media/Kiwix/data as the library; change that path to your own folder of ZIM files.
Each release has two other ways to run it, with the web app included in both.
Standalone executable for Linux (x86-64 and arm64). One file, no Python needed:
tar -xzf zim-pro-0.5.0-linux-x86_64.tar.gz cd zim-pro-0.5.0-linux-x86_64 KIWIX_DATA_DIR=/path/to/zims KIWIX_STATE_DIR=./state ./zim-pro # http://localhost:8080 Python package, for Python 3.13 on Linux or macOS:
pip install zim-pro # or: uvx zim-pro KIWIX_DATA_DIR=/path/to/zims KIWIX_STATE_DIR=./state zim-pro # http://localhost:8080 SHA256SUMS in the release lists the checksum of every file.
(cd web && npm ci && npm run build) KIWIX_DATA_DIR=/path/to/zims KIWIX_STATE_DIR=./state uv run zim-pro For UI work, run npm run dev in web/ (set KIWIX_BACKEND if the server is not on 127.0.0.1:8080).
Download limits, the update schedule and policies are set in the web UI under Settings.
The project was first called Kiwix Updater. The KIWIX_* variables and the database file (kiwix-updater.sqlite3) keep that name so existing installs carry on unchanged, and the kiwix-updater command still works alongside zim-pro.
The Create page makes ZIM files that land in your library and work everywhere else in the app, including Ask AI and MCP. Each build runs in the background as a job: queued, then processing (fetching, converting, writing, checking), then finished or failed. A build can be paused while it waits or works and resumed from where it stopped; paused builds have their own tab on the Jobs list and give their place to the next build in the queue.
Add a web address, choose what to save, and press Create ZIM. Each link makes one ZIM; Update fetches it again and replaces the old one. A link can also rebuild itself every so many days.
Many links at once: Import CSV. Only a url column is required; title, scope (page, path, site), subdomains, engine (builtin, zimit), mode (clean, full), images, video (yes, no), max_pages, sitemaps (addresses separated by spaces), robots_url, rate_limit, rate_unit (second, minute), feeds and feed_minutes are optional. The file is checked first and shows which rows are new, already there, or unreadable, and nothing is added until you confirm. Export CSV writes the same format back.
url,title,scope,images https://example.org/guide/,Example guide,path,yes https://example.org/faq.html,,page,no The built-in crawler asks a site what it wants before fetching its pages:
Keeping a site current without crawling it again. A link has two schedules:
Articles that came in through a feed stay in the ZIM when the whole site is rebuilt, even after they have dropped off the end of the feed. To follow feeds from several sites in one ZIM, without saving a site, use the Feeds page.
What you save and how you use it is your responsibility: check a site's terms before copying it.
Drop a PDF, EPUB, MOBI or AZW3 file on the Uploads tab. It is converted to readable, searchable pages (an EPUB by chapter, a PDF by page) and the original file is kept inside the ZIM, linked from its first page. A ZIM file is checked and added as it is.
Every link, uploaded book and feed collection has a Category and a Picture.
Pages are fetched several at a time, cleaned and converted on worker threads, and compressed and indexed on libzim's own threads (Settings → Create and Feeds sets how many). Before a ZIM enters the library it is opened again and compared with what was prepared: the page count, every file, and a sample of pages byte for byte. Each job keeps a list of anything that failed or was skipped, with the reason. Only real pages are marked as articles and the full-text index is built from their cleaned text, so search and Ask AI match what a reader sees. The files pass openZIM's zimcheck.
Zimit records pages in a real browser. It runs as a separate container, so Zim Pro needs access to Docker to start it: mount the Docker socket and let the container's user use it.
volumes: - /var/run/docker.sock:/var/run/docker.sock group_add: - "999" # the gid of the docker group on your host: getent group docker Mounting the Docker socket gives the container control of Docker on the host, which is equivalent to root there. Leave it out unless you need browser capture and trust what runs in the container. Without it, the option is shown as unavailable and everything else works. The first capture downloads the Zimit image (about 1.5 GB).
Two optional helper containers come with the compose files in docker/: compose.solver.yml has the solver, compose.vpn.yml the VPN with the solver inside it. They apply to pages fetched by the built-in crawler and by Feeds, not to Zimit captures, the catalog or ZIM downloads. Each has its own section in Settings (VPN and Captcha solver), with a switch to turn it off without losing its addresses. Once set up, both also appear at the foot of the menu: a status light each (green working, amber busy, red not answering, grey off), the same switches, and an i that opens the details: the VPN's address, country and network, and Change IP.
Captcha solver (FlareSolverr). Some sites answer a plain request with a "checking your browser" page (Cloudflare's "Just a moment…", DDoS-Guard). With a solver set, Zim Pro hands such a page to FlareSolverr, which opens it in a real browser, and then carries on with the clearance it earned, so pictures and later pages are fetched the normal way. Without one, such pages are listed as failed with a note saying why.
VPN (Gluetun). Gluetun connects to your VPN provider and offers an HTTP proxy. Set Proxy address to http://gluetun:8888 and every page fetched for a link or a feed leaves through the VPN, while the web interface and everything else keep using your own connection.
Test connection, in both sections, tries the addresses as typed, before you save them. For the VPN it asks the control server for its state and fetches a page through the proxy (from cloudflare.com, which answers with the address it was asked from), then says whether the two agree. For the solver it asks whether FlareSolverr is there and ready.
Seeing and changing the VPN's address. Gluetun has a control server on port 8000. Give Zim Pro its address and Settings and the menu show whether the VPN is connected, the public IP address it has, and its country, region and network.
Getting past a site's checks does not change what you are allowed to copy: its terms still apply.
The Feeds page keeps ZIMs up to date from RSS and Atom feeds. It is separate from the Create page: its own engine, its own queue (so a long crawl never holds up the news), its own schedule and its own settings.
A collection is one or more feed addresses kept as a single ZIM. Its first page lists every article, newest first, by month.
Settings → Create and Feeds has the master switch for scheduled syncing, how many syncs run at once, and the defaults for new collections. The VPN and captcha solver under Settings → Network apply to feeds too.
Feed ZIMs appear in the library under "My ZIMs" and are searched and cited by Ask AI like any other book.
Add one or more providers under Settings → AI, then pick a default model. Any server with the OpenAI /chat/completions API works: OpenAI, Google Gemini, Perplexity, OpenRouter, Groq, Ollama, LM Studio, llama.cpp, vLLM. The model can be switched per message in the chat box.
Each provider has a switch: turned off, it is kept with its key but not used or offered.
Two providers that need no account or key are added on first start, so Ask AI works straight after installing: OVHcloud AI Endpoints (Llama 3.3 70B, Qwen, Mistral, gpt-oss; about two requests a minute per model) and Kilo Gateway's free models (about 200 requests an hour; Kilo may log free-tier prompts for training). Both are rate-limited per IP address and can be removed under Settings; a removed one is not added back.
For a model server on the Docker host, use http://host.docker.internal: /v1 (Ollama: 11434, LM Studio: 1234), not localhost, and make the server listen on all interfaces (for Ollama, OLLAMA_HOST=0.0.0.0).
How a question is answered (see src/zim_pro/retrieval.py):
Articles reach the model as Markdown (library/article.py), not HTML: navigation, pictures and their captions, citation markers, reference lists, "See also" and "External links" sections and licence footers are removed and links are flattened to their text, so the tokens go on prose. Each passage is sent under the heading of the section it came from.
The pictures, videos and recordings on each source's page are listed with the source and shown as thumbnails under it; they are not sent to the model.
Every prompt carries formatting rules, and answers are passed through a repair step before they are shown (unclosed code blocks, leaked reasoning, malformed lists, tables and citations), since small models often get Markdown wrong. Your own standing instructions can be added under Settings → AI.
Web search (off by default) is used when the library has no good match, or for every question while the Internet button in the chat box is on. Either:
Read aloud adds a listen button to answers, using the browser's built-in voice or a provider's speech model (OpenAI, Gemini, Groq, or a local /audio/speech server).
Settings has three sections for seeing what the server is doing, and changing it.
Queues shows downloads, builds and feed syncs side by side. For each: what is running (progress, how long, and when it last moved), what is waiting and in which order, what is held, and what failed in the last day with the reason. You can pause and resume a whole queue (running jobs finish, nothing new starts), change how many run at once, move a waiting job to the top or bottom or one place up or down, retry everything that failed, and cancel everything waiting. Figures for the last day: jobs done and failed, the average wait and run time, how long 95% took, and an hour-by-hour chart.
The queues work with nothing more than the database. With KIWIX_REDIS_URL set, the order of each queue and whether it is paused are kept in Redis instead: a sorted set zimpro:queue: (downloads, builds, feeds; the lowest score starts first) and a key zimpro:queue: :paused, which you can read and change with redis-cli or any other tool; Zim Pro follows within five seconds. The database still keeps the record of every job, so if Redis stops the queues carry on from it, and Redis is filled again when it is back. docker/compose.redis.yml runs the two together.
Monitoring runs health checks (free disk space for the library and the state folder, the database, how promptly the server answers, memory, Redis, the VPN, the captcha solver, the catalog, jobs that have stopped moving, recent failures and errors) and charts the last hour or day: CPU and memory of Zim Pro and the machine, responsiveness, requests to the server, pages and files fetched, download speed, jobs, and errors logged. Tables show each part of the API (requests, failures, average and 95th-percentile time), the sites builds and feeds fetch from (with the last problem each one gave), and the AI providers. A job that has not moved for ten minutes is flagged there and in the logs.
Logs gathers every line from every part of the server in one list: downloads, builds, feeds, the network, AI, MCP, the queues, requests that failed or were slow, and the server itself. Each line says which part wrote it and, when it was written for a job, which one (feed 12, download 3): click the job to follow just it. Filter by level, part, job or text; the list updates live. Lines are written to logs/zim-pro.log in the state folder (five files of 5 MB are kept, one JSON object per line), read back after a restart, sent to the Redis stream zimpro:logs when Redis is used, and can be downloaded. Keys, tokens and passwords are blanked out before a line is kept. Choose how much is kept: errors only up to every web request.
claude mcp add --transport http zim-pro http://localhost:8083/mcp Tools: list_books, search, suggest, get_article, get_article_outline, list_updates, and start_update (off until enabled in Settings).
For a stdio client, run zim-pro mcp with KIWIX_DATA_DIR and KIWIX_STATE_DIR set.
API keys. With no key and no admin token, anyone who can reach the server can use /mcp. To lock it, open Settings → MCP and press Generate key:
The keys guard /mcp only. The web interface and its API are guarded by KIWIX_ADMIN_TOKEN: without it, anyone who can open the web interface can also make keys, so set the token if the server is reachable by people you do not trust.
Python 3.13, FastAPI and python-libzim on the server, SQLite for state, and React, Vite and Tailwind for the web app. Zim Pro is an independent project and is not affiliated with Kiwix.
Pushing a tag of the form v1.2.3 runs .github/workflows/release.yml:
The package version comes from the tag, and the release notes from that version's section of CHANGELOG.md, so move the entries under "Unreleased" to a new version heading before tagging.
git tag v0.5.0 && git push origin v0.5.0 Every push to master and every pull request runs .github/workflows/ci.yml: Python lint (ruff check), formatting check and tests, and the web app's type check, tests and build.
Zim Pro is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the licence for details.
Both files in this release have provenance metadata.
zim kiwix offline wikipedia mcp rag knowledge-base
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




