Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation


🧠 Apertus 8B Multimodal Auditor

License: Apache 2.0 Model: Apertus 1.5 8B Framework: Transformers Multimodal: Image+Audio+Text Context: 262K Tokens

Enterprise Multimodal Incident & Risk Audit System powered by Swiss AI Apertus 1.5 8B.
Ingests interleaved visual evidence, 24 kHz audio witness logs, and telemetry text into a 262,144-token context window. Leverages Apertus's native Thinking Mode (enable_thinking=True) to execute chain-of-thought verification and automated audit report synthesis (outputs.md).


📌 Table of Contents


🌐 Overview

Apertus 8B Multimodal Auditor solves the critical challenge of triaging complex engineering, insurance, and compliance incidents where single-modality models fall short.

Traditional audit systems require separate OCR, audio transcription, and NLP pipelines, creating context gaps and high integration latency. Apertus 1.5 8B natively unifies Images, 24 kHz Audio, and Text into a single 262,144-token context window with native chain-of-thought deliberation (<|inner_prefix|> ... <|inner_suffix|>).

This project provides a concise, single-script pipeline (apertus_auditor.py) that feeds multi-source incident evidence directly to Apertus 8B, evaluates cross-modal discrepancies, and exports standardized markdown audit reports (outputs.md).


⚡ Key Features

  • 👁️ Native Vision Processing: Directly ingests damage photos, thermal scans, structural blueprints, and telemetry charts.
  • 🎙️ Native 24 kHz Audio Understanding: Processes voice notes, emergency call recordings, and acoustic sensor streams at 40 tokens per second.
  • 🧠 Deep Thinking Mode Reasoning: Uses Apertus 1.5's native deliberation mechanism (enable_thinking=True) to audit root causes before issuing final verdicts.
  • 🌍 Swiss Multilingual Capability: Analyzes mixed-language logs (German, French, Italian, English) seamlessly across European standard compliance frameworks.
  • 📄 Automated Report Generation: Exports clean executive audit reports directly to outputs.md.

💻 Tech Stack

  • Core Model: swiss-ai/Apertus-v1.5-8B (Multimodal LLM with xIELU activation & AdEMAMix optimizer)
  • Deep Learning: PyTorch (torch), Hugging Face transformers (swiss-ai release)
  • Runtime Environment: Python 3.10+ on Windows / Linux / macOS

🛠️ Installation & Setup

1. Clone & Set Up Environment

Open PowerShell terminal in Windows and create a clean environment:

python -m venv venv
.\venv\Scripts\Activate.ps1

2. Install Dependencies

Install the custom Swiss AI branch of transformers along with PyTorch:

pip install -r requirements.txt

3. Run the Auditor

Execute the main auditor script to process evidence and export the audit report:

python apertus_auditor.py

📦 Hugging Face Transformers Model Loading

The full model inference and download pipeline is contained within apertus_auditor.py:

import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor

MODEL_ID = "swiss-ai/Apertus-v1.5-8B"

# Load Processor & Multimodal Model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID, 
    torch_dtype="auto", 
    device_map="auto"
).eval()

# Interleaved Multimodal Input with Thinking Mode
messages = [
    {
        "role": "system",
        "content": "You are Apertus 8B Multimodal Safety Auditor. Reason step-by-step in thinking mode."
    },
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "Analyze turbine vibration log and inspect flange damage photo."},
            {"type": "image", "url": "https://example.com/damage.png"},
            {"type": "audio", "url": "https://example.com/acoustic_log.mp3"}
        ]
    }
]

inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    enable_thinking=True,
    return_tensors="pt"
).to(model.device)

with torch.inference_mode():
    output_ids = model.generate(**inputs, max_new_tokens=2048)

response = processor.decode(output_ids[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=False)
print(response)

📁 Project File Structure

Apertus/
├── README.md            # Project documentation & GitHub showcase
├── requirements.txt     # Python dependencies (swiss-ai transformers, torch)
├── apertus_auditor.py   # Single Python script (<150 lines) for HF model inference & report export
└── outputs.md           # Generated multimodal audit report showcase

🎯 5 Real-World Use Cases

  1. 🏭 Industrial Plant Safety Auditing: Cross-analyzing acoustic motor hums and thermal imaging to detect catastrophic turbine failure before shutdown.
  2. 🚗 Automotive Insurance Claims Assessment: Combining vehicle collision photos, driver voice notes, and blackbox telemetry to automate fraud risk scoring.
  3. 🏗️ Civil Infrastructure Inspection: Evaluating bridge vibration audio logs and drone fracture photography against Swiss SIA structural codes.
  4. 🩺 Medical Emergency Triage: Synthesizing patient monitor sounds, X-ray imaging, and paramedic telemetry into high-confidence clinical urgency reports.
  5. Smart Grid Power Substation Monitoring: Auditing high-voltage arc sound recordings and visual transformer leaks across German/French power grids.

🔮 5 Future Features

  1. 🌐 vLLM Serving Integration: Add vLLM backend support with --tensor-parallel-size 2 for enterprise sub-second API latency.
  2. 🎥 Video Frame Extractor: Ingest keyframes from 60fps security streams into Apertus vision input.
  3. 🛠️ Native Tool-Calling Auto-Remediation: Trigger emergency valve shutoff APIs automatically based on audit risk scores.
  4. 🔒 EU AI Act Automated Compliance: Export PDF filings adhering to EU AI Act Annex IV requirements.
  5. 📱 Edge Quantization: Quantize model to GGUF/ONNX for offline field auditor handhelds.

📊 Output Showcase

The pipeline saves a structured report directly to outputs.md:

Incident Module Input Modalities Thinking Deliberation Audit Status Risk Score
Hydroelectric Dam Valve #4 Photo (Vis) + Acoustic (24kHz) + Log (Text) Analyzed acoustic harmonic shift & fissure progression ACTION REQUIRED 88/100 (HIGH)
Solar Inverter Array B2 Thermal Image + Maintenance Voice Note Verified thermal gradient; no structural short circuit PASS 12/100 (LOW)

Built with ❤️ using Swiss AI Apertus 1.5 8B Multimodal Foundation Model.


🏷️ Keywords & SEO

apertus-ai swiss-ai apertus-1.5-8b multimodal-llm open-source-ai huggingface-transformers pytorch audio-processing vision-language-model thinking-mode ai-safety-auditor offline-ai

About

Apertus 1.5 Dropped: FINALLY A Transparent Offline Multimodal AI - Multimodal incident auditor powered by Swiss AI Apertus 1.5 8B model.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages