An AI-powered application that collects machine telemetry data from system sensors and performs intelligent analysis using machine learning techniques.
-
Comprehensive Telemetry Collection
- CPU metrics (usage, frequency, per-core stats)
- Memory metrics (virtual memory, swap)
- Disk usage and I/O statistics
- Network I/O and connections
- Temperature sensors
- Fan sensors
- Battery information (if available)
- Process metrics
-
AI-Powered Analysis
- Anomaly Detection: Uses Isolation Forest to identify unusual patterns
- Clustering Analysis: K-means clustering to identify system states
- Trend Analysis: Statistical analysis of metric trends over time
- Performance Insights: Real-time recommendations and warnings
- Anomaly Prediction: Forecasts future anomalies using machine learning models
-
Visualization
- Static matplotlib plots
- Interactive Plotly dashboards
- Anomaly visualization
- Create a virtual environment (recommended):
python3 -m venv .venv
source .venv/bin/activate # On Linux/Mac
# or
.venv\Scripts\activate # On Windows- Install dependencies:
pip install -r requirements.txt-
(Optional) Set up an LLM provider — see LLM Setup below.
-
Run the application:
python app.pyAIOS-experiment/
├── src/ # Source code modules
│ ├── __init__.py
│ ├── app.py # Main CLI application
│ ├── gui_app.py # Gradio GUI application
│ ├── telemetry_collector.py
│ ├── ai_analyzer.py
│ ├── llm_analyzer.py # LLM integration (Docker, Ollama, OpenAI, Anthropic, llama-cpp)
│ ├── config_manager.py # User preferences and configuration
│ ├── visualizer.py
│ ├── anomaly_predictor.py
│ ├── os_integration.py
│ ├── data_archive.py
│ └── system_logs.py
├── models/ # Local model files (GGUF format)
│ └── .gitkeep
├── scripts/ # Utility scripts
│ └── download_gemma3_1b.py # Download Gemma 3 1B from Hugging Face
├── telemetry_archive/ # Archived telemetry sessions
├── app.py # Entry point for CLI
├── gui.py # Entry point for GUI
├── Dockerfile # Container build for the app
├── docker-compose.yml # Docker Compose orchestration
├── config.json # Runtime configuration
├── requirements.txt
└── README.md
# Collect data and analyze (default: 60 seconds)
python app.py
# Collect data for 120 seconds with 2-second intervals
python app.py --duration 120 --interval 2.0
# Real-time monitoring mode
python app.py --mode monitor --duration 300
# Save collected data and analysis
python app.py --save-data --save-analysis
# Enable anomaly prediction (forecasts future anomalies)
python app.py --predict --duration 120
# Predict 20 steps ahead with visualization
python app.py --predict --prediction-steps 20 --visualize
# Enable desktop notifications and system logging
python app.py --notifications --system-logging
# Export data to different formats
python app.py --export-csv telemetry.csv --export-json telemetry.json
# Generate systemd service file for background monitoring
python app.py --generate-systemd-
--mode: Operation modecollect: Only collect dataanalyze: Only analyze existing datamonitor: Real-time monitoringfull: Collect and analyze (default)
-
--duration: Collection duration in seconds (default: 60) -
--interval: Collection interval in seconds (default: 1.0) -
--save-data: Save collected telemetry data to JSON file -
--save-analysis: Save analysis results to JSON file
The app can predict when anomalies might occur in the future:
# Enable predictions (requires at least 20 data points)
python app.py --predict --duration 120
# Predict further ahead (20 steps)
python app.py --predict --prediction-steps 20
# Full analysis with predictions and visualization
python app.py --predict --visualize --duration 120The prediction system:
- Trains Random Forest models on historical telemetry patterns
- Forecasts future metric values (CPU, Memory, Disk)
- Predicts anomaly likelihood for each future step
- Identifies historical patterns (e.g., most common hour for anomalies)
- Provides risk assessments (high/medium/low)
from telemetry_collector import TelemetryCollector
from ai_analyzer import TelemetryAnalyzer
from visualizer import TelemetryVisualizer
from anomaly_predictor import AnomalyPredictor
# Collect data
collector = TelemetryCollector()
data = collector.collect_continuous(duration=60, interval=1.0)
# Analyze with predictions
analyzer = TelemetryAnalyzer()
analysis = analyzer.comprehensive_analysis(data, include_predictions=True, prediction_steps=10)
# Use predictor directly
predictor = AnomalyPredictor()
train_result = predictor.train_forecast_models(data)
future_predictions = predictor.predict_future_values(data, steps_ahead=10)
# Visualize
visualizer = TelemetryVisualizer()
visualizer.plot_basic_metrics(data, save_path='metrics.png')
visualizer.plot_interactive_dashboard(data, analysis, save_path='dashboard.html')telemetry_data_YYYYMMDD_HHMMSS.json: Raw telemetry dataanalysis_results_YYYYMMDD_HHMMSS.json: Analysis resultstelemetry_dashboard.html: Interactive dashboardmetrics.png: Static plots
- Python 3.8+
- Cross-platform support: Works on Linux, Windows, and macOS
- Linux: Full sensor support (temperature, fans, RAPL power)
- Windows: Core metrics + WMI for hardware info (requires
wmipackage) - macOS: Core metrics via psutil
- psutil for system metrics
- scikit-learn for ML analysis
- matplotlib/plotly for visualization
On Windows, install additional packages for full hardware information:
pip install wmi pywin32Note: Some features may be limited on Windows:
- Fan speeds (if not exposed via psutil)
- RAPL power monitoring (Linux only)
- Some temperature sensors (depends on hardware/drivers)
The app supports multiple LLM providers for natural language analysis. Choose the one that fits your setup.
Use Docker Desktop's built-in Model Runner to serve models locally via an OpenAI-compatible API.
- Install Docker Desktop (v4.40+).
- Enable Model Runner: Settings > AI > Enable Docker Model Runner.
- Pull a model:
docker model pull ai/gemma3:latest- Run the app — it auto-detects Docker Model Runner on
localhost:12434:
python gui.pyTroubleshooting on laptops with limited GPU VRAM: If the model fails to load with a Vulkan or CUDA memory error, rename the Vulkan DLL to force pure CPU inference:
# Windows — disable Vulkan so llama.cpp falls back to CPU
Rename-Item "$env:USERPROFILE\.docker\bin\inference\ggml-vulkan.dll" "ggml-vulkan.dll.disabled"To re-enable Vulkan later, rename it back.
Download a quantized GGUF model from Hugging Face and run it locally with llama-cpp-python (no server needed).
- Get a Hugging Face access token and accept the Gemma license.
- Set your token:
# Windows PowerShell
$env:HF_TOKEN="hf_your_token_here"
# Linux / macOS
export HF_TOKEN="hf_your_token_here"- Run the download script:
python scripts/download_gemma3_1b.pyThis downloads gemma3-1b-it-Q8_0.gguf (~1.1 GB, best quality for the 1B model) into the models/ directory. Other quantizations are available from the bartowski/google_gemma-3-1b-it-GGUF repo (Q4_K_M ~700 MB, Q6_K_L ~900 MB, F16 ~2 GB).
- Run the app with the local model:
python gui.py --llm-provider llamacpp --llm-model gemma3-1b-it-Q8_0.ggufOr configure it once in the GUI Settings tab (Provider: llamacpp, Model: gemma3-1b-it-Q8_0.gguf). The app also auto-detects .gguf files in the models/ directory.
- Install Ollama and pull a model:
ollama pull llama3.2- Run the app:
python gui.py --llm-provider ollamaSet your API key as an environment variable and specify the provider:
# OpenAI
export OPENAI_API_KEY="sk-..."
python gui.py --llm-provider openai
# Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
python gui.py --llm-provider anthropicThe app includes a web-based GUI with chat interface:
python gui.pyThis launches a web interface at http://localhost:7860 with:
- Real-time Monitoring: Live telemetry collection and visualization
- Chat Interface: Ask AI questions about your system status
- Interactive Dashboard: Real-time plots and metrics
- AI Analysis: One-click analysis with recommendations
You can ask the AI chat:
- "What's my CPU usage?"
- "How's my memory?"
- "Are there any anomalies?"
- "What's the temperature?"
- "Give me recommendations"
- "Show me system status"
The app supports safe OS-level integrations:
Enable desktop notifications for alerts and anomalies:
python app.py --notificationsLog events to system logs (syslog/journald on Linux):
python app.py --system-loggingExport telemetry data to various formats:
# CSV format
python app.py --export-csv data.csv
# JSON format
python app.py --export-json data.json
# Prometheus format
python app.py --export-prometheus metrics.promGenerate a systemd service file for background monitoring:
python app.py --generate-systemd
sudo cp aios-telemetry.service /etc/systemd/system/
sudo systemctl enable aios-telemetry
sudo systemctl start aios-telemetryEnable automatic archiving with system log correlation:
# Enable archiving (30 day retention by default)
python app.py --archive
# Custom retention period
python app.py --archive --retention-days 60 --archive-dir my_archive
# Query archived sessions
python app.py --list-sessions
python app.py --query-archive session_20240103_120000
# View archive statistics
python app.py --archive-statsThe archiving system:
- Automatic compression: Sessions older than 7 days are compressed
- Retention policy: Old sessions are automatically deleted after retention period
- System log correlation: Automatically correlates telemetry anomalies with system logs
- Query interface: Search and retrieve historical sessions
- Database indexing: Fast queries by time range, anomaly count, etc.
The app can read and correlate with system logs:
- Linux: journald (systemd) and syslog
- Windows: Event Log
- macOS: Unified logging system
Logs are automatically correlated with telemetry anomalies within a 5-minute window, helping identify what system events occurred during anomalies.
- Some sensors (temperature, fans) may not be available on all systems
- Requires appropriate permissions to access system metrics
- The anomaly detector needs at least 10 data points to function effectively
- GUI requires Gradio (automatically installed with requirements)
- OS notifications require
notify-sendon Linux,osascripton macOS, orwin10toaston Windows
MIT License