Safe4wiki converts local folders and private or public Git repositories into deep, citation-verified engineering wikis with auto-healed Mermaid diagrams, Hybrid RAG code chat, offline PDF/HTML exports, and 1-click subdomain publishing — running 100% on your own machine.
Quick Start · Node.js >= 18
Running locally in under two minutes.
Starts at http://localhost:4317 with two complete, bundled real-world wikis ready to browse immediately.
git clone https://github.com/Safe4ai-com/Safe4wiki.git
cd Safe4wiki
npm install
npm run build
npm startmicrosoft/vscode (60 pages, claude-haiku-4-5) · microsoft/playwright (49 pages, deepseek-v4.1-flash-free + claude-haiku-4-5)README Quick Start ↗Inside the Workspace
Built for engineers who read code, not marketing blurbs.
Explore the four core surfaces inside Safe4wiki running on 127.0.0.1:4317.
3-Level Wiki Tree
Scheduler & Rate-Limit Checkpointing
Every generated section links directly to verified repository files in a single deduplicated drawer per page. If a provider hits rate limits or a 5-hour CLI cap, completed pages stay safe in .state.json so generation resumes cleanly on the exact next page.
What's Inside
Six capabilities built for real repositories.
Every detail — from GPU scheduling to citation deduplication — is engineered to turn raw source trees into living documentation you completely own.
Deep multi-page wikis that survive rate limits.
Auto-scales from small libraries to 60+ page monorepos with 3-level nested trees, automatic Glossary & Design Docs, pause/resume & auto-pause on provider limits, smart parallel scheduling, and transactional incremental builds.
Code chat with line-level proof.
Combines BM25 lexical search over wiki sections and source chunks with optional background semantic embeddings (zero startup delay), clickable file & line-range citation chips, a Split-View Code Inspector, and file attachments.
Auto-healed architecture diagrams.
A line-anchored fenced-code parser and automatic Mermaid sanitizer + retry renderer handle tricky labels (parentheses, colons, inline fences) across sequence, flow, class, and state diagrams with pan/zoom lightbox and instant SVG caching.
Bring local weights, APIs, or Agent CLIs.
Configure independent models for wiki generation and chat across Ollama, LM Studio, llama.cpp/vLLM, direct .gguf files, OpenAI/Anthropic-compatible APIs, and coding CLIs with 1-click Terminal Auth and live model discovery.
Localhost-only with zero telemetry.
Runs strictly on 127.0.0.1:4317. Supports local folders and private Git via SSH or HTTPS tokens stored with chmod 600 and masked from the browser, skips Git LFS smudges, isolates CLI auth, and tags every page with model provenance.
Offline handbooks & 1-click subdomain publish.
Export single-file offline HTML (*-docs.html) that works via file://, print-quality PDFs with vector diagrams and numbered TOCs, static ZIP bundles, or publish straight to SSH/rsync, GitHub Pages, Cloudflare Pages, or Netlify.
Unified Model Hub
Run 100% offline, via APIs, or with your coding CLIs.
Assign separate models for deep wiki generation and fast RAG chat, and switch anytime without losing progress.
Local (100% Offline)
- Live installed model list discovery
- Automatic thinking-token stripping
- Configurable num_ctx & 15-min local timeout
- Single serialized GPU slot to avoid VRAM thrashing
Online APIs
- Parallel generation across multiple repositories
- Configurable concurrency per provider
- Masked chmod 600 credential storage
- Supports env:VAR_NAME secret references
Agent CLIs
- 1-click Terminal Auth inside the UI
- Per-CLI reasoning effort (low → max/ultra)
- Live model discovery (opencode models & Codex cache)
- Auto-pause & resume across 5-hour quota resets
Head-to-Head Benchmark
Safe4wiki (Local) vs DeepWiki.com (Hosted)
Tested on the exact same public repository and commit — genes8/open-repo-wiki @ dcfac26 (101 files) — auditing every generated page on disk and live in headless Chrome.
| Metric | Safe4wiki (Local) | DeepWiki.com (Hosted) |
|---|---|---|
| Pages generated | 34 (auto-scaled, incl. Glossary & 6 Design Docs) | 33 |
| Documentation depth | 36,540 words · 71 structured tables | ~300–450 words & 0 tables on core pages |
| Mermaid diagrams (live Chrome render) | 38 / 38 rendered (100%, 0 errors) | 3 broken diagrams across 4 inspected pages |
| Repository file coverage | 96 / 101 files (95.0%) | ~90% |
| Verified source citations | 661 / 662 (99.8%), deduplicated into 1 drawer/page | Mixed plain-text citations & repeated Sources: blocks |
| Rendering / formatting defects | 0 | Unrendered raw LaTeX (Node.js >= 18) + broken diagrams |
| Privacy & model choice | 100% local — Ollama, GGUF, BYO API, or Agent CLIs | Cloud-hosted only |
| Offline export & self-hosting | Single-file HTML, Print PDF, Static ZIP, 1-click Publish | Web viewer only |
Why Safe4wiki renders 100% of Mermaid diagrams: Safe4wiki ships with a line-anchored fenced-code parser plus an automatic Mermaid sanitizer and retry renderer so tricky labels (parentheses, colons, inline code fences) render cleanly as crisp SVGs.
Local Architecture
Every stage runs on your own machine.
Isolated workers, transactional staging under ~/.repowiki, and real-time SSE streaming to your browser.
React + Vite UI
wiki · diagrams · rag · publish
Local Server
127.0.0.1:4317 · sse
Parallel Scheduler
cloud parallel · 1 gpu slot
Isolated Worker
scan · plan · gen · verify
~/.repowiki Store
staged · .state.json
Hybrid RAG
bm25 · embeddings
Export & Publish
pdf · html · zip · ssh
From Individual Teams to Enterprise Rollouts
Use Safe4wiki free under Apache 2.0 — or partner with Safe4AI at scale.
Safe4wiki (Apache 2.0)
Ideal for developers, architects, and teams onboarding onto local or private repositories from their own workstation.
- Run free on macOS, Linux, or Windows (Node.js >= 18)
- Connect Ollama, LM Studio, GGUF, APIs, or Agent CLIs
- Hybrid RAG chat + Split-View Code Inspector
- Offline HTML, Print PDF, Static ZIP & 1-click publish
Enterprise AI & SafeSuite Deployment
When you need organization-wide automation, governance, or full-company knowledge systems built by our engineering team inside your perimeter.
- CI/CD automated wiki regeneration across private org repos
- Enterprise SSO / RBAC governance & audit logging
- Air-gapped VPC hosting, custom SafeSuite extensions & GPU sizing
- Combine codebases with regulated docs via Private·ai
Frequently Asked Questions
Safe4wiki is open-source under the Apache License, Version 2.0 (Copyright 2026 Safe4AI). You can clone, run locally, audit, modify, and self-host generated wikis freely. As noted in the repository NOTICE file, the wiki generation engine in server/engine/ incorporates code from open-repo-wiki under the MIT License.
No. The Safe4wiki server binds strictly to localhost (127.0.0.1:4317) with zero telemetry and stores state locally under ~/.repowiki. Your source code only leaves your machine if you explicitly configure an online API or cloud-backed CLI; running with Ollama, LM Studio, llama.cpp, or a local .gguf file keeps everything 100% offline.
Safe4wiki persists the accepted plan and every completed page incrementally to disk. You can pause manually anytime or let Safe4wiki auto-pause when a provider hits rate or 5-hour CLI limits, then resume from the exact next page — even after switching to another model or backend.
Safe4wiki is the flagship open-source developer tool (#01) in SafeSuite by Safe4AI, focused on turning local folders and Git repositories into verifiable engineering wikis. Private·ai is Safe4AI’s compliance-first enterprise RAG assistant for company-wide regulated documents with persistent Postgres audit trails, three-layer PII guards, and OpenTelemetry tracing.
SafeSuite #01 · Apache 2.0
Try Safe4wiki on your own repository today.
Star the repository, explore the bundled VS Code and Playwright demos locally, or reach out to bring SafeSuite and private AI into your organization.