mirror of
https://github.com/ewanc26/llm-analyser.git
synced 2026-07-21 15:33:16 +00:00
Mirror of github.com/ewanc26/llm-analyser
- Python 91.6%
- Nix 8.4%
| src/llm_analyser | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| AGENTS.md | ||
| flake.nix | ||
| LICENSE | ||
| main.py | ||
| Modelfile | ||
| README.md | ||
| requirements.txt | ||
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
.docxfiles - 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-docxto 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!