Skip to content

Repository files navigation

DocLLM logo

DocLLM

Chat with your documents using AI that runs entirely on your Mac.

No account. No cloud. No data ever leaves your computer.

getdocllm.com

License: MIT Platform: macOS Built with Tauri Powered by Ollama React


DocLLM demo


What is DocLLM?

DocLLM is a free, open-source macOS desktop app that lets you have AI conversations with your documents — PDFs, Word files, Markdown, and plain text. Every AI model runs locally on your Mac via Ollama. Your documents are never uploaded anywhere.

DocLLM vs cloud AI

DocLLM ChatGPT / Claude
Data stays on your device ✅ ❌ uploaded to cloud
Works completely offline ✅ ❌
Free forever ✅ ❌ usage limits / subscription
No account or login ✅ ❌
Open source ✅ MIT ❌ proprietary
Page-level citations ✅ ❌

Features

Core

  • Chat with any document — PDF, Word (.docx), plain text, Markdown
  • Page-level citations — every answer cites the exact page it came from; click to jump there in the built-in PDF viewer
  • Multi-document workspaces — group related files; ask questions across all of them at once
  • OCR for scanned PDFs — built-in Tesseract OCR handles documents with no text layer

Workspace

  • Resizable split-pane layout — sidebar, PDF viewer, and chat all freely resizable
  • Pinned notes — save important answers per workspace
  • Full-text history search — search across all past conversations (⌘F)
  • Export conversations — save chat as .txt or formatted HTML

Performance

  • Streaming responses — tokens appear in real time from Ollama
  • Parallel embedding — chunks embedded in batches of 3; reduces ingest time by ~3×
  • Model pre-warming — chat model loads into memory on startup for a fast first response
  • ETA progress bar — shows estimated time remaining during document indexing

Privacy

  • Zero telemetry — no analytics, no crash reporting, nothing phoned home
  • No accounts — no login, no email, no sign-up
  • Single outbound connection — only talks to localhost:11434 (your local Ollama)

How it works

You drop a document
        │
        ▼
  Extract text                  (pdfjs-dist for PDFs, Tesseract OCR fallback)
        │
        ▼
  Split into chunks             (400-word overlapping windows)
        │
        ▼
  Embed each chunk              (Ollama — nomic-embed-text, batched × 3)
        │
        ▼
  Store embeddings              (in-memory + localStorage, no database)

You ask a question
        │
        ▼
  Embed question                (same embedding model)
        │
        ▼
  Cosine similarity search      (across every chunk in the workspace)
        │
        ▼
  Top-6 chunks as context       (threshold 0.3, globally re-ranked)
        │
        ▼
  Stream answer from Ollama     (mistral:7b, with page citations in the reply)

Requirements

  • macOS (Apple Silicon or Intel)
  • Ollama — free, installs in 30 seconds
  • ~4.5 GB free disk space (for AI models, downloaded once)
  • 8 GB RAM minimum · 16 GB recommended for large documents

Installation

Download the app (easiest)

  1. Go to the Releases page
  2. Download the latest .dmg
  3. Drag DocLLM to Applications
  4. Launch it — the setup wizard guides you through everything

Build from source

Prerequisites: Node.js 22+ · Rust · Ollama

# 1. Clone
git clone https://github.com/yourusername/docllm.git
cd docllm

# 2. Install dependencies
nvm use 22
npm install

# 3. Run in development
export PATH="$HOME/.cargo/bin:$PATH"
npm run tauri dev

# 4. Or build a distributable .dmg
npm run tauri build

First-time setup

The setup wizard runs once on first launch:

Step What happens
1 — Install Ollama Open ollama.com if not installed
2 — Download models Pulls mistral:7b (~4.1 GB) and nomic-embed-text (~274 MB) with a live progress bar
3 — You're ready Drop any document to start chatting

After setup, the app always opens straight to the chat interface.


Usage

Add documents

  • Drag and drop a file onto the app window
  • ⌘ O — open file picker
  • + button in any workspace

Chat

  • Type your question and press Enter
  • Click any source badge in the answer to jump to that exact page in the PDF viewer
  • ⌘ K — focus the chat input from anywhere

Workspaces

  • ⌘ N — new workspace
  • Add multiple documents to a workspace and ask questions across all of them simultaneously
  • Each workspace has its own independent chat history and pinned notes

Keyboard shortcuts

Shortcut Action
⌘ N New workspace
⌘ O Open file
⌘ K Focus chat input
⌘ F Search chat history

Tech stack

Layer Technology Version
Desktop shell Tauri 2
Frontend React + TypeScript 19 / 5.8
Styling Tailwind CSS 4
State management Zustand 5
Build tool Vite 7
AI inference Ollama (local) —
Chat model Mistral 7B 7b
Embedding model nomic-embed-text latest
PDF extraction pdfjs-dist 5
OCR Tesseract.js 7
Word docs Mammoth.js 1.x
Testing Vitest + Testing Library —

Project structure

docchat/
├── src/
│   ├── App.tsx                        # loading → onboarding → app state machine
│   ├── components/
│   │   ├── MainLayout.tsx             # Full layout + ingest pipeline
│   │   ├── Sidebar.tsx                # Workspace list + file upload
│   │   ├── ChatWindow.tsx             # Message thread with markdown + citations
│   │   ├── PdfViewer.tsx              # In-app PDF renderer (pdfjs, canvas)
│   │   ├── DropZone.tsx               # Drag-and-drop file target
│   │   ├── SettingsDrawer.tsx         # Model + Ollama URL settings
│   │   ├── Dashboard.tsx              # Usage stats modal
│   │   ├── NotesPanel.tsx             # Pinned notes per workspace
│   │   ├── HistorySearch.tsx          # Full-text conversation search
│   │   ├── ExportMenu.tsx             # Export chat as TXT / HTML
│   │   └── onboarding/                # 4-step setup wizard
│   ├── lib/
│   │   ├── pdf.ts                     # PDF text extraction + Tesseract OCR
│   │   ├── ollama.ts                  # Ollama REST client (health, pull, embed, chat)
│   │   ├── rag.ts                     # Embed → search → stream pipeline
│   │   ├── chunker.ts                 # 400-word overlapping chunker
│   │   ├── extractor.ts               # Routes files to correct extractor
│   │   └── vectorStore.ts             # Cosine similarity + localStorage persistence
│   └── store/
│       ├── appStore.ts                # Docs, workspaces, Ollama state
│       ├── settingsStore.ts           # Model selection, Ollama URL
│       └── usageStore.ts              # Per-workspace notes + usage counters
├── src-tauri/
│   ├── src/lib.rs                     # Rust: get_ram_gb command
│   ├── capabilities/default.json      # Tauri permissions
│   └── tauri.conf.json                # Window, CSP, bundle config
└── public/                            # Runtime deps (DO NOT DELETE)
    ├── pdf.worker.min.mjs             # pdfjs web worker
    └── tesseract/                     # Tesseract WASM engine + OCR model

Configuration

All settings are in the gear icon in the sidebar. They persist in localStorage.

Setting Default Notes
Chat model mistral:7b Any model you've pulled in Ollama
Embed model nomic-embed-text Any embedding model in Ollama
Temperature 0.3 (Precise) 0.1 = factual · 0.5 = balanced · 0.9 = creative
Ollama URL http://localhost:11434 Change if Ollama runs on a different host

The model dropdowns are populated live from Ollama — only models you've already pulled appear.


Data & privacy

  • No network requests except to localhost:11434 (your Ollama, running locally)
  • No telemetry — no analytics, no error reporting, nothing is tracked
  • No accounts — no login, no email address required
  • All data is yours — document text, embeddings, and chat history are stored in your browser's localStorage and Tauri's app data directory at ~/Library/Application Support/com.local.docllm/

Supported file formats

Format Extension Parser Notes
PDF .pdf pdfjs-dist Native text layer; Tesseract OCR fallback for scanned pages
Word .docx Mammoth.js Preserves paragraph structure
Plain text .txt Built-in Split into virtual pages by line count
Markdown .md Built-in Treated as plain text

RAG details

  • Chunk size: 400 words with 80-word overlap (sentence-aware splitting)
  • Similarity threshold: 0.3 — chunks below this are dropped even if they rank in top-K
  • Top-K per doc: 8 candidates per document, globally re-ranked, top 6 sent to the LLM
  • Zero-chunk fallback: if no chunks pass the threshold, the LLM answers from workspace metadata only
  • Multi-doc citations: source badges show document name + page when workspace has multiple files

Development

npm run tauri dev        # hot-reload dev mode
npm run build            # frontend only (tsc + vite)
npm run tauri build      # production app bundle
npx tsc --noEmit         # type check only
npm test                 # run test suite
npm run test:watch       # watch mode
npm run test:coverage    # with V8 coverage

Tests live in src/test/ and use Vitest + Testing Library + jsdom. See CLAUDE.md for architecture details and Tauri-specific constraints.


Contributing

All contributions welcome — bug fixes, new file format support, Windows/Linux ports, UI improvements.

  1. Fork the repo
  2. Create a branch: git checkout -b feature/your-feature
  3. Make your changes
  4. Type check: npx tsc --noEmit
  5. Run tests: npm test
  6. Open a pull request

Roadmap

  • Windows support
  • Linux support
  • In-app model manager (download/switch models without a terminal)
  • Image and diagram understanding
  • Custom system prompt per workspace
  • More embedding model options

License

MIT — free to use, modify, and distribute.


Built for people who want AI that respects their privacy.

Website · Download · Report a bug · Request a feature

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages