Mirror of github.com/ewanc26/llm-analyser
  • Python 91.6%
  • Nix 8.4%
Find a file
2026-07-16 18:22:46 +01:00
src/llm_analyser docs: add comments to source files 2026-06-29 22:00:16 +01:00
.gitignore Initial commit 2025-07-17 04:25:54 +01:00
.pre-commit-config.yaml chore: add pre-commit config with black and isort 2026-04-13 18:42:12 +01:00
AGENTS.md docs: correct agent guidance after source audit 2026-07-16 18:22:46 +01:00
flake.nix feat: add nix flake 2026-04-29 22:43:42 +01:00
LICENSE Initial commit 2025-07-17 04:25:54 +01:00
main.py docs: add comments to source files 2026-06-29 22:00:16 +01:00
Modelfile Initial commit 2025-07-17 04:25:54 +01:00
README.md Update README with Tangled mirror link and current project details 2026-04-25 00:06:13 +01:00
requirements.txt Initial commit 2025-07-17 04:25:54 +01:00

LLM Analyser

This project analyses one or more .docx files and uses Ollama to generate Markdown essays about them.

🧶 Also available on Tangled

Requirements

  • Python 3.x
  • Ollama installed locally
  • Python packages from requirements.txt

Install the Python dependencies with:

pip install -r requirements.txt

Then create the custom Ollama model defined by the bundled Modelfile:

ollama create document-analyser -f ./Modelfile

Usage

Run the analyser against a directory of .docx files:

python main.py <directory_to_analyse>

Optional flags:

python main.py <directory_to_analyse> -m llama3.2
python main.py <directory_to_analyse> -o ./my-output
  • -m, --model — Ollama model name to use
  • -o, --output — output directory for generated essays

If no output directory is supplied, the script writes essays into a folder named <directory-slug>_essays next to main.py.

What it does

  • Scans the target directory recursively for .docx files
  • Reads both paragraphs and tables from each document
  • Builds a Markdown essay for each file using the configured Ollama model
  • Processes files concurrently for faster batch runs

Project structure

main.py        # CLI entry point and analysis orchestration
Modelfile      # Ollama model definition and prompt
requirements.txt

Modifying the model

Modelfile contains the model instructions and parameters. Edit it if you want to change the prompt, temperature, or base model, then recreate the model with ollama create.

Notes

  • The script uses python-docx to read Word documents.
  • Empty or unreadable documents are still reported, but the generated output will note that no readable content was found.

Support

If you found this useful, consider buying me a ko-fi!