Skip to main content

AI-powered Android/AOSP log interpreter

Project description

AILog — AI-Powered Android/AOSP Log Interpreter

Tests PyPI Python 3.8+ License: MIT

Stop drowning in 50,000 lines. Let AI find what matters.

AILog is a CLI tool that interprets Android build logs, logcat output, and AOSP compilation errors using AI. It filters noise first (free, instant), then sends only important lines to an AI model for root cause analysis and fix suggestions.

Features

  • Two-stage filtering: Rule-based noise filter removes ~70% of lines before AI, saving tokens and time
  • Multi-provider AI: Ollama (local, free), OpenAI-compatible APIs, Anthropic Claude
  • Build wrapper: Wraps m/make with real-time error interpretation
  • Logcat wrapper: Wraps adb logcat with noise filtering and batch AI analysis
  • File analyzer: Batch analyze saved log files with chunked processing
  • Automotive-aware: Special patterns for VHAL, CarService, CarAudio, EVS

Requirements

  • Python 3.8+ (stdlib only — no pip packages needed)
  • adb (for ailog cat) — included with Android SDK Platform Tools
  • For local AI: Ollama with a model pulled
  • For cloud AI: API key from OpenAI, Anthropic, Groq, Together, etc.

Installation

Platform analyze cat build Install method
Linux Yes Yes Yes pip install ailog-cli
macOS Yes Yes Yes pip install ailog-cli
Windows Yes Yes No (AOSP builds are Linux/macOS only) pip install ailog-cli

pip (Recommended)

pip install ailog-cli

Linux / macOS (from source)

git clone https://github.com/zoddiacc/AILog.git && cd AILog
bash install.sh

If ~/.local/bin is not in your PATH:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc   # Bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc     # Zsh

Windows

pip install ailog-cli
ailog --help

Quick Start

Ollama (Local, Free — Default)

# 1. Install Ollama from https://ollama.com, or:
brew install ollama              # macOS
curl -fsSL https://ollama.ai/install.sh | sh   # Linux

# 2. Start the server and pull a model
ollama serve                     # keep running in background
ollama pull qwen2.5-coder:3b    # in another terminal (~2 GB)

# 3. Verify and select a model
ailog config --list-models       # list all pulled models
ailog config --model qwen2.5-coder:3b   # select the model to use

# 4. Test it
ailog analyze examples/build_error.log

Model tips: qwen2.5-coder:3b is the default — fast and lightweight (~2 GB). For better results, try qwen2.5-coder:7b or codellama:13b. Pull any model with ollama pull <name>, then select it with ailog config --model <name>.

Cloud Providers

# OpenAI / Groq / Together / etc.
ailog config --provider openai
ailog config --api-key sk-...
ailog config --model gpt-4o-mini
ailog config --base-url https://api.groq.com/openai/v1   # for non-OpenAI providers

# Anthropic Claude
ailog config --provider anthropic
ailog config --api-key sk-ant-...

Usage

# Analyze a saved log file
ailog analyze build.log
ailog analyze logcat.txt --focus CarService
ailog analyze build.log --output report.md

# Live logcat with AI
ailog cat --explain                              # AI explains each error inline
ailog cat -p com.example.myapp --explain         # Filter to your app only
ailog cat -s DEVICE_SERIAL --explain             # When multiple devices connected
ailog cat --focus VHAL --noise-level high        # Focus + aggressive filtering

# Wrap an AOSP build
ailog build
ailog build -- -j16 framework

Commands

ailog analyze <file>

Flag Description
--type build|logcat|auto Log type (default: auto-detect)
--full Disable noise filtering
--output <path> Save report to file
--focus <keyword> Focus AI on specific component

ailog build [-- make args]

Flag Description
--no-filter Show all logs
--summary-only Hide raw logs, show AI summary only
--module <name> Module hint for better AI context

ailog cat [adb logcat args]

Flag Description
-s, --device <serial> Target device when multiple are connected
-p, --package <pkg> Filter by app package name (resolves PID automatically)
--noise-level low|medium|high Filtering aggressiveness
--focus <tag/keyword> Focus AI attention
--explain Inline AI explanations for each error
--batch-interval <seconds> AI summary interval (default: 5)

ailog config

ailog config --show              # Show current config
ailog config --provider ollama   # Switch provider
ailog config --api-key sk-xxx    # Set API key
ailog config --model <name>      # Set model
ailog config --base-url <url>    # Custom base URL
ailog config --list-models       # List available Ollama models
ailog config --reset             # Reset to defaults

Configuration

Config file: ~/.config/ailog/config.json

Key Default Description
provider ollama AI provider: ollama, openai, anthropic
ollama_url http://localhost:11434 Ollama server URL
ollama_model qwen2.5-coder:3b Ollama model
openai_url https://api.openai.com/v1 OpenAI-compatible base URL
openai_model gpt-4o-mini OpenAI model
anthropic_model claude-sonnet-4-20250514 Anthropic model
noise_level medium Default noise filter level
batch_interval 5 Seconds between AI batches
max_ai_calls 5 Max AI calls per session

API keys can also be set via environment variables: OPENAI_API_KEY, ANTHROPIC_API_KEY.

How It Works

Input (log file, adb logcat, or make output)
         |
Stage 1: Rule-Based Noise Filter (instant, free)
         |
Stage 2: AI Analysis (only if errors detected, max 5 calls/session)
         |
Terminal Display (color-coded lines, boxed AI analysis, stats bar)

Development

Testing: AILog has 136 unit tests covering all major modules. Tests run in CI across Python 3.8, 3.9, 3.10, 3.11, and 3.12 via GitHub Actions, with ruff linting.

python3 -m unittest discover -s tests -v

Further Reading

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ailog_cli-2.0.2.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ailog_cli-2.0.2-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file ailog_cli-2.0.2.tar.gz.

File metadata

  • Download URL: ailog_cli-2.0.2.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ailog_cli-2.0.2.tar.gz
Algorithm Hash digest
SHA256 b6331ed9fc382b5e034434185f09aebae8e7b0435d2d50703c29679b79ad2161
MD5 449bd43f22ecca535273df859111e3dc
BLAKE2b-256 54a4cd91cd70fb6b4aa2272a4dd38086cee865b4dccb06fa00348694e1275259

See more details on using hashes here.

Provenance

The following attestation bundles were made for ailog_cli-2.0.2.tar.gz:

Publisher: release.yml on zoddiacc/AILog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ailog_cli-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: ailog_cli-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ailog_cli-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfdef4531bc4da216a01a4257cfa7e30c18bc41bddd8bc2d58982ea8803bebff
MD5 7458f8af938d012476caa515ca64fe6a
BLAKE2b-256 04f0cc1895a803f37b45960fb8edce5de1ef2aebc5b457ecb9f9ecd6606fbca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ailog_cli-2.0.2-py3-none-any.whl:

Publisher: release.yml on zoddiacc/AILog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page