AI-powered Android/AOSP log interpreter
Project description
AILog — AI-Powered Android/AOSP Log Interpreter
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/makewith real-time error interpretation - Logcat wrapper: Wraps
adb logcatwith 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 | install.sh |
| macOS | Yes | Yes | Yes | install.sh |
| Windows | Yes | Yes | No (AOSP builds are Linux/macOS only) | Manual |
Linux / macOS
git clone <repo-url> && 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
git clone <repo-url> && cd AILog
python ailog.py --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:3bis the default — fast and lightweight (~2 GB). For better results, tryqwen2.5-coder:7borcodellama:13b. Pull any model withollama pull <name>, then select it withailog 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
- TESTING.md — Step-by-step guide to test AILog with a real Android app
- UNINSTALL.md — How to completely remove AILog
- ARCHITECTURE.md — Technical architecture and design decisions
- CHANGELOG.md — Version history
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ailog_cli-2.0.0.tar.gz.
File metadata
- Download URL: ailog_cli-2.0.0.tar.gz
- Upload date:
- Size: 48.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a4827cdcbb758265fbd7236a3058dc87baf54b6f8b63d5569cd6f59737ea249
|
|
| MD5 |
b5e01fc9e5fd285bc880d5beb2cd54bf
|
|
| BLAKE2b-256 |
dc0d4ca48c8b3ade78d358267acbe216adf1d16004072d2ca7ddb638a3ec1628
|
Provenance
The following attestation bundles were made for ailog_cli-2.0.0.tar.gz:
Publisher:
release.yml on zoddiacc/AILog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ailog_cli-2.0.0.tar.gz -
Subject digest:
3a4827cdcbb758265fbd7236a3058dc87baf54b6f8b63d5569cd6f59737ea249 - Sigstore transparency entry: 1358516863
- Sigstore integration time:
-
Permalink:
zoddiacc/AILog@7de88f34eeb8728ac07bc1fef2e1c655fa429a62 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/zoddiacc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7de88f34eeb8728ac07bc1fef2e1c655fa429a62 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ailog_cli-2.0.0-py3-none-any.whl.
File metadata
- Download URL: ailog_cli-2.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbd732c14f90476034da812325b1b5e12694eeb7e83e001e124875037a9e8812
|
|
| MD5 |
ca49b1bf0358dd2e63f3b72d9e35d9e0
|
|
| BLAKE2b-256 |
a62b49ece900b285e12893efbefdac843ea469b86c38dce32f229560ae215c95
|
Provenance
The following attestation bundles were made for ailog_cli-2.0.0-py3-none-any.whl:
Publisher:
release.yml on zoddiacc/AILog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ailog_cli-2.0.0-py3-none-any.whl -
Subject digest:
cbd732c14f90476034da812325b1b5e12694eeb7e83e001e124875037a9e8812 - Sigstore transparency entry: 1358516934
- Sigstore integration time:
-
Permalink:
zoddiacc/AILog@7de88f34eeb8728ac07bc1fef2e1c655fa429a62 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/zoddiacc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7de88f34eeb8728ac07bc1fef2e1c655fa429a62 -
Trigger Event:
push
-
Statement type: