{
  "kind": "recipe",
  "id": "docs",
  "title": "Chat with your files",
  "what": "Ask questions about your PDFs, notes and documents.",
  "html": "https://insidethemachine.ai/do/docs",
  "md": "https://insidethemachine.ai/do/docs.md",
  "json": "https://insidethemachine.ai/do/docs.json",
  "memory": {
    "min_gb": 16,
    "good_gb": 32
  },
  "minutes": 20,
  "platform_priority": [
    "macos-apple-silicon",
    "linux",
    "windows"
  ],
  "tools": [
    {
      "slug": "ollama",
      "name": "Ollama",
      "md": "https://insidethemachine.ai/setups/ollama.md"
    },
    {
      "slug": "open-webui",
      "name": "Open WebUI",
      "md": "https://insidethemachine.ai/setups/open-webui.md"
    },
    {
      "slug": "docling",
      "name": "Docling",
      "md": "https://insidethemachine.ai/setups/docling.md"
    }
  ],
  "placeholders": {
    "{MODEL}": "ollama tag from model_by_memory_gb for the machine's RAM",
    "{WHISPER}": null
  },
  "model_by_memory_gb": {
    "8": {
      "name": "Qwen3.5 4B",
      "tag": "qwen3.5:4b",
      "gb": 5.8,
      "aa": 13.1,
      "maker": "Alibaba Qwen"
    },
    "16": {
      "name": "Gemma 4 12B",
      "tag": "gemma4:12b",
      "gb": 11.2,
      "aa": 14.2,
      "maker": "Google"
    },
    "24": {
      "name": "Gemma 4 12B",
      "tag": "gemma4:12b",
      "gb": 11.2,
      "aa": 14.2,
      "maker": "Google"
    },
    "32": {
      "name": "Qwen3.8 27B",
      "tag": "qwen3.8:27b",
      "gb": 22.7,
      "aa": 33.7,
      "maker": "Alibaba Qwen"
    },
    "48": {
      "name": "Qwen3.8 27B",
      "tag": "qwen3.8:27b",
      "gb": 22.7,
      "aa": 33.7,
      "maker": "Alibaba Qwen"
    },
    "64": {
      "name": "Qwen3.8 27B",
      "tag": "qwen3.8:27b",
      "gb": 22.7,
      "aa": 33.7,
      "maker": "Alibaba Qwen"
    },
    "96": {
      "name": "Qwen3.8 27B",
      "tag": "qwen3.8:27b",
      "gb": 22.7,
      "aa": 33.7,
      "maker": "Alibaba Qwen"
    },
    "128": {
      "name": "Qwen3.8 27B",
      "tag": "qwen3.8:27b",
      "gb": 22.7,
      "aa": 33.7,
      "maker": "Alibaba Qwen"
    },
    "192": {
      "name": "Qwen3.8-Flash-Next (125B-A6B)",
      "tag": "qwen3.8-flash-next:125b-a6b",
      "gb": 140,
      "aa": 39.8,
      "maker": "Alibaba Qwen"
    },
    "256": {
      "name": "Qwen3.8-Flash-Next (125B-A6B)",
      "tag": "qwen3.8-flash-next:125b-a6b",
      "gb": 140,
      "aa": 39.8,
      "maker": "Alibaba Qwen"
    },
    "512": {
      "name": "Qwen3.8-Flash-Next (125B-A6B)",
      "tag": "qwen3.8-flash-next:125b-a6b",
      "gb": 140,
      "aa": 39.8,
      "maker": "Alibaba Qwen"
    }
  },
  "frontier": {
    "name": "Claude Opus 5.5",
    "aa": 57.6
  },
  "tested": "Install steps run on an Apple M4 Mac with 16 GB on 2026-10-15. File upload and the first Docling run are checked against the docs only.",
  "recipe": {
    "id": "docs",
    "get": "A private chat that answers questions about your own PDFs, notes and documents.",
    "model": "chat",
    "steps": [
      {
        "title": "Install Ollama",
        "body": "Ollama downloads AI models and runs them on your computer. Open the Terminal app and paste this. It may ask for your Mac password.",
        "cmds": [
          {
            "run": "curl -fsSL https://ollama.com/install.sh | sh",
            "note": "Or download the app from ollama.com/download"
          }
        ],
        "expect": "Run `ollama --version`. It prints a version number. If it also says “could not connect”, open Ollama from your Applications folder, wait a few seconds, then go on."
      },
      {
        "title": "Download your model",
        "body": "This is the AI itself. It is one big file, so it takes a few minutes.",
        "cmds": [
          {
            "run": "ollama pull {MODEL}"
          }
        ],
        "expect": "The download finishes with “success”."
      },
      {
        "title": "Add a ChatGPT-style window",
        "body": "Open WebUI gives you a chat app in your browser. It needs Homebrew (brew.sh) for Python.",
        "cmds": [
          {
            "run": "brew install python@3.11"
          },
          {
            "run": "python3.11 -m venv ~/.venvs/openwebui && source ~/.venvs/openwebui/bin/activate"
          },
          {
            "run": "pip install open-webui"
          },
          {
            "run": "open-webui serve",
            "note": "Keep this window open while you use it"
          }
        ],
        "expect": "Open http://localhost:8080. Make a local account (it stays on your computer) and pick your model at the top."
      },
      {
        "title": "Add your files",
        "body": "In a chat, click + and attach a file, then ask about it. For a whole folder, go to Workspace → Knowledge, make a collection and upload your files. Then type # in a chat to use it.",
        "expect": "The answer quotes your document."
      },
      {
        "title": "Messy PDF? Clean it first",
        "body": "Scanned or complex PDFs give bad answers. Docling turns them into clean text you can upload instead.",
        "cmds": [
          {
            "run": "python3 -m venv ~/.venvs/docling && source ~/.venvs/docling/bin/activate"
          },
          {
            "run": "pip install docling"
          },
          {
            "run": "docling yourfile.pdf",
            "note": "Writes yourfile.md next to it"
          }
        ],
        "expect": "A Markdown file appears. Upload that one."
      }
    ],
    "alt": {
      "slug": "anythingllm",
      "title": "Prefer one app? Use AnythingLLM.",
      "body": "AnythingLLM is a desktop app for chatting with your documents. Download it from anythingllm.com and choose Ollama as the model provider.",
      "href": "/setups/anythingllm"
    },
    "undo": [
      {
        "run": "ollama rm {MODEL}",
        "note": "Removes the model file"
      },
      {
        "run": "rm -rf ~/.venvs/openwebui ~/.venvs/docling",
        "note": "Removes Open WebUI and Docling"
      },
      {
        "run": "rm -rf ~/Library/Caches/pip",
        "note": "Removes saved downloads"
      }
    ],
    "know": [
      "Check your free disk space first. You need room for the model plus about 4 GB for Open WebUI and 2 GB for Docling.",
      "The first Docling run downloads its own small models.",
      "Answers are only as good as the text it can read. Clean files give better answers."
    ],
    "fix": [
      {
        "q": "“could not connect to ollama app, is it running?”",
        "a": "Ollama is not running. Open Ollama from your Applications folder, or run `ollama serve` in a new Terminal window and leave it open."
      },
      {
        "q": "“command not found: ollama”",
        "a": "Close the Terminal window and open a new one. If it still fails, run the install command again."
      },
      {
        "q": "“model requires more system memory”",
        "a": "The model is too big for your memory. Pick a smaller memory size at the top of this page and use that model. Close other big apps too."
      },
      {
        "q": "“file does not exist” when you download",
        "a": "The model name is wrong, or Ollama is too old. Copy the command again from this page. Then update Ollama: run the install command again."
      },
      {
        "q": "It is very slow",
        "a": "Run `ollama ps`. PROCESSOR should say 100% GPU. If it shows CPU, the model does not fit in memory. Pick a smaller model."
      },
      {
        "q": "The computer freezes, or the fan is loud",
        "a": "The model uses all your memory. Stop it with `ollama stop {MODEL}`. Then use a smaller one."
      },
      {
        "q": "“address already in use” when Open WebUI starts",
        "a": "Another app uses port 8080. Run `open-webui serve --port 8081`, then open http://localhost:8081."
      },
      {
        "q": "No models in the list at the top of Open WebUI",
        "a": "Ollama is not running. Start it, then reload the page."
      },
      {
        "q": "The answer ignores your file",
        "a": "Check that the file shows in the chat. Scanned PDFs have no real text; clean them with Docling (step 5) and upload the .md file."
      }
    ],
    "after": [
      "Try it: upload a manual and ask “how do I reset it?”. Upload notes and ask “what did we decide?”.",
      "Make a Knowledge collection per topic, so answers only use the right files.",
      "See every model you have: `ollama list`.",
      "Try a different model: copy any `ollama run` name from the Models page.",
      "Update your model: run `ollama pull {MODEL}` again. It only downloads what changed.",
      "Free disk space: `ollama rm {MODEL}` deletes a model you no longer use."
    ],
    "win": {
      "body": "Install Ollama with this PowerShell command, or the installer from ollama.com/download. On Linux, the install command above works as it is. After that, every `ollama` command on this page is the same. Open WebUI and Docling also run on Windows; their pages have the steps.",
      "cmds": [
        {
          "run": "irm https://ollama.com/install.ps1 | iex",
          "note": "Windows: paste in PowerShell. Or get the installer from ollama.com/download"
        }
      ]
    },
    "tested": "Install steps run on an Apple M4 Mac with 16 GB on 2026-10-15. File upload and the first Docling run are checked against the docs only."
  }
}