troed/tagger
1
0
Fork
You've already forked tagger
0
A Nextcloud application to import existing EXIF tags to Nextcloud collaborative tags as well as creating new ones using an LLM.
  • Python 94.2%
  • Dockerfile 2.5%
  • JavaScript 1.2%
  • Shell 1.1%
  • Makefile 1%
Troed Sångberg 6e4e35d15b Add build-tgz target to create project archives
- New Makefile target 'build-tgz' creates a tar.gz archive with proper structure
- Archive contains single top directory 'tagger' with all project files
- Includes appinfo/, ex_app/, and root files (CHANGELOG.md, Dockerfile, etc.)
- Automatically cleans up unwanted files (__pycache__, .pyc, .gitignore)
- Updated APP_VERSION to 1.0.0 to match release tag
2026年04月22日 18:30:22 +02:00
appinfo Implement HaRP compliance and prepare for release 2026年04月22日 18:24:50 +02:00
ex_app Implement HaRP compliance and prepare for release 2026年04月22日 18:24:50 +02:00
tests Major development: Implement Nextcloud translation architecture and comprehensive test suite 2026年04月22日 13:13:05 +02:00
.gitattributes Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
.gitignore Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
AGENTS.md Major development: Implement Nextcloud translation architecture and comprehensive test suite 2026年04月22日 13:13:05 +02:00
CHANGELOG.md Implement HaRP compliance and prepare for release 2026年04月22日 18:24:50 +02:00
Dockerfile Implement HaRP compliance and prepare for release 2026年04月22日 18:24:50 +02:00
healthcheck.sh Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
LICENSE Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
Makefile Add build-tgz target to create project archives 2026年04月22日 18:30:22 +02:00
pyproject.toml Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
README.md Major development: Implement Nextcloud translation architecture and comprehensive test suite 2026年04月22日 13:13:05 +02:00
requirements.txt Initial commit: Tagger project 2026年04月17日 21:16:03 +02:00
start.sh Implement HaRP compliance and prepare for release 2026年04月22日 18:24:50 +02:00
tagger.png docs: update AGENTS.md and add tagger.png 2026年04月18日 12:52:54 +02:00

WORK IN PROGRESS

This repo is in the process of being cleaned up and conformant to Nextcloud app guidelines

Tagger

An automated image tagging application for Nextcloud that uses AI (LLM) and EXIF metadata to organize your photos.

Features

  • AI-Powered Tagging: Automatically generates descriptive tags and descriptions using a configurable LLM service (e.g., llama.cpp).
  • EXIF Integration: Extracts existing keywords from image metadata and can write new tags/descriptions back into the EXIF data.
  • Automated Workflow:
    • Listens for new file uploads via Nextcloud Webhooks.
    • Processes files through a persistent priority queue.
  • Manual Control: Allows users to trigger tagging via the Nextcloud file dropdown menu.
  • Persistence: Uses a priority queue that survives application restarts, ensuring no task is lost.
  • Smart Prevention: Uses a specialized marker (AutoTaggedByTagger) to prevent redundant processing.

Architecture

The application follows a producer-consumer model:

  1. Producers:
    • Webhook Listener: Captures NodeCreatedEvent from Nextcloud.
    • UI Actions: Captures manual requests from the Nextcloud user interface.
  2. Queue: A PersistentQueue stores QueueItem objects, prioritizing manual requests over automated ones.
  3. Consumer: A background worker processes the queue, performing:
    • EXIF extraction.
    • LLM analysis.
    • Tag application (to both Nextcloud and EXIF).

Development

#* AI-Powered Tagging: Automatically generates descriptive tags and descriptions using a configurable LLM service (e.g., llama.cpp).

Prerequisites

  • Python 3
  • exiftool (required for EXIF operations)
  • A running LLM service (e.g., llama-server)

Running llama-server Example

To run a compatible server, you can use the following command:

llama-server -fa on -c 32768 -cram 0 --no-cache-prompt --models-max 1 --mmproj-auto --media-path /tmp --no-webui --host 0.0.0.0 --port 11434 --jinja

Key Parameters:

  • -cram 0: Disables cache to prevent host memory exhaustion.
  • --mmproj-auto: Enables automatic multi-modal projection, which is necessary for the model to parse images.
  • --media-path /tmp: By mounting this path in the container, you can minimize data transfers between the app and the server.

Setup

  1. Clone the repository.
  2. Install dependencies:
    pip install -r requirements.txt
    

Running the App

To start the application for development:

make run

Testing

To verify the LLM integration and tag generation, run the test script with a sample image:

python3 test_tagging.py <path_to_image>

Viewing Results

The best way to see the added EXIF tags and descriptions within Nextcloud is by using the Memories app. Memories provides a beautiful gallery view that displays:

  • EXIF Tags: All the automatically extracted and added keywords
  • Descriptions: The AI-generated image descriptions
  • Smart Organization: Photos organized by tags, dates, and locations

Install the Memories app from the Nextcloud App Store to get the full benefit of the Tagger's automatic tagging features.

Quality Assurance

Before committing, ensure code quality by running:

# Check Python syntax
python3 -m py_compile ex_app/lib/main.py
# Run linter
pylint ex_app/lib/main.py

License

This project is dedicated to the public domain under CC0 1.0 Universal.