Skip to main content

AILog — AI Log Triage for AOSP & Android Automotive

Tests PyPI Python 3.9+ License: MIT

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

AILog reads your AOSP build errors, adb logcat, and full bugreports — and tells you what actually broke and how to fix it. It's built for AOSP and Android Automotive (AAOS) platform developers debugging VHAL, CarService, HALs, and native crashes in a terminal.

  • 🔒 Local-first — runs on Ollama by default, so your logs never leave your machine
  • 🚗 Automotive-aware — ships a knowledge pack of VHAL, SELinux, tombstone & CarService facts
  • 🪶 Zero dependencies — pure Python standard library, installs anywhere
  • Works offline — instant rule-based triage even with no AI model at all
pip install ailog-cli

Note: the PyPI package is ailog-cli, but the command you run is ailog. (The name ailog on PyPI belongs to an unrelated project — don't install that one.)


See it in action

Turn a 100 MB bugreport into a ranked list of real problems — instantly, with no model needed:

$ ailog bugreport bugreport-car-2026.zip --no-ai

═════════════════ AILog — Bugreport Triage ═════════════════
ℹ️  Build fingerprint: Android/car_x86_64/emu:14/UQ1A.240101
   java crashes: 1  │  native crashes: 1  │  ANRs: 1  │  SELinux: 1

▶ 1. [NATIVE] Native crash — signal 6 (SIGABRT)
   ↳ [Native crash] SIGABRT means abort() — often a failed CHECK/assert.
     Read the 'abort message:' line first, then symbolize the backtrace.

▶ 2. [ANR] ANR in com.oem.telemetry
   ↳ App Not Responding: com.oem.telemetry

▶ SELinux denials (1 unique)
   ↳ [SELinux] Denied — add an allow rule to the domain's .te file
     u:r:hal_vehicle_default:s0 → u:object_r:sysfs:s0 : file { read }

Add a model and it explains each crash in depth. Point it at a live device (ailog cat --explain) or your AOSP build (ailog build) for the same treatment.


Get started in 60 seconds

1. Install — the package is ailog-cli, the command is ailog:

pip install ailog-cli

2. Try it with zero setup — the knowledge pack works with no AI at all:

ailog bugreport your-bugreport.zip --no-ai

3. Turn on AI — pick one:

Option A · Local & private (recommended, free)
# Install Ollama once: https://ollama.com
ollama pull qwen2.5-coder:3b     # ~2 GB, one-time download

That's it — AILog uses Ollama by default. Nothing leaves your machine.

Option B · Cloud (OpenAI / Anthropic / Groq / …)
ailog config --provider openai --api-key sk-...
# or
ailog config --provider anthropic --api-key sk-ant-...
# or any OpenAI-compatible endpoint:
ailog config --provider openai --base-url https://api.groq.com/openai/v1 --api-key ...

Secrets in your logs are redacted before anything is sent. See Privacy.

4. Use it

ailog analyze build.log          # analyze a saved log
ailog cat --explain              # live logcat, explained inline
ailog build                      # wrap an AOSP build
ailog bugreport report.zip       # triage a bugreport

Run ailog --help or ailog <command> --help for everything.


Why AILog is different

Most people run a small local model (the default is qwen2.5-coder:3b) that knows almost nothing about VHAL, CarService, SELinux, or tombstones. A generic "pipe the log to an LLM" tool gives weak or wrong answers for automotive internals as a result.

AILog keeps the domain intelligence in curated data it ships, not the model's weights. A built-in knowledge pack maps log signatures to verified facts — so even a tiny local model gives genuinely good answers, and the common cases are explained instantly with no AI at all.


What you can do

Command What it does Needs
ailog analyze <file> Analyze a saved build/logcat file a file
ailog bugreport <file> Triage an adb bugreport (.zip/.txt) a file
ailog cat AI-filtered live adb logcat adb + device
ailog build Wrap an AOSP m/make build AOSP tree (Linux/macOS)
ailog config Configure provider, model, keys
# Analyze
ailog analyze logcat.txt --focus CarService      # focus the AI on a component
ailog analyze build.log --output report.md       # save a markdown report

# Bugreport triage
ailog bugreport report.zip --no-ai               # instant, offline, no model
ailog bugreport report.zip --focus com.oem.app   # only issues touching a package

# Live logcat
ailog cat --explain                              # explain each error inline
ailog cat --focus VHAL --noise-level high        # focus + aggressive filtering
ailog cat -p com.example.app --explain           # filter to one app

# AOSP build (run from a lunch'd shell)
ailog build
ailog build -- -j16 framework

# Machine-readable output for CI
ailog --json bugreport report.zip --no-ai | jq '.issue_counts'
All flags (per command)

Global (place before the subcommand, e.g. ailog --json analyze x.log)

Flag Description
--json Machine-readable JSON output (analyze, bugreport)
--redact / --no-redact Force secret redaction on/off (on by default for cloud)
--dry-run Show the AI call without sending it
--show-tokens Print estimated token counts
--no-color Disable colored output

ailog analyze <file>--type build\|logcat\|auto, --full (no filtering), --output <path>, --focus <keyword>

ailog bugreport <file>--no-ai (offline triage), --focus <keyword>, --output <path>

ailog cat-s/--device <serial>, -p/--package <pkg>, --noise-level low\|medium\|high, --focus <tag>, --explain, --no-source, --batch-interval <sec>

ailog build--no-filter, --summary-only, --module <name>


Configuration

AILog works out of the box with Ollama — you only need config to switch providers or tune behavior.

ailog config --show                       # see current settings
ailog config --provider anthropic         # switch provider
ailog config --model qwen2.5-coder:7b     # pick a model
ailog config --list-models                # list installed Ollama models
ailog config --set noise_level=high       # set any option (below)
ailog config --reset                      # back to defaults

Config lives at ~/.config/ailog/config.json (created with 0600 permissions). API keys can also come from OPENAI_API_KEY / ANTHROPIC_API_KEY env vars, which take precedence.

All config keys
Key Default Description
provider ollama ollama, openai, or anthropic
ollama_model qwen2.5-coder:3b Local model (try :7b for better results)
ollama_url http://localhost:11434 Ollama server URL
openai_model gpt-4o-mini OpenAI model
openai_url https://api.openai.com/v1 OpenAI-compatible base URL
anthropic_model claude-sonnet-5 Anthropic model
noise_level medium Filter aggressiveness: low/medium/high
batch_interval 5 Seconds between AI batches (live cat)
max_ai_calls 5 Max AI calls per session
timeout 30 AI request timeout (seconds)
system_prompt "" Override the AI system prompt

Set any of these with ailog config --set key=value.

Privacy

With local Ollama (the default) nothing leaves your machine — ideal for OEM and Tier-1 environments. When you use a cloud provider, secrets (API keys, tokens, passwords, JWTs, …) are redacted from log content and source files by default before anything is sent. Pass --no-redact only if you understand the implications.


Requirements

Platform analyze · bugreport cat build
Linux / macOS
Windows ❌ (AOSP builds are Linux/macOS only)

analyze and bugreport need only a file — no device or adb.

Install from source
git clone https://github.com/zoddiacc/ailog-cli.git && cd ailog-cli
bash install.sh                 # installs to ~/.local/bin
# or run directly without installing:
python3 run.py --help

If ~/.local/bin isn't on your PATH:

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

How it works

Input (log file, adb logcat, bugreport, or build output)
        │
Stage 1 · Rule-based noise filter    → drops ~70% of lines (instant, free)
        │
Stage 2 · Knowledge-pack lookup      → instant hint (no AI) + facts for the AI
        │
Stage 3 · AI analysis (if needed)    → explains the rest, grounded in Stage 2
        │
Terminal output (color-coded lines, boxed analysis, stats)

The knowledge pack

The heart of AILog. It maps log signatures to verified AOSP/Automotive facts (what a VHAL property means and which Car.PERMISSION_* it needs, how to read an avc: denied line, what a SIGABRT tombstone implies), used two ways:

  1. Instant hints, no AI — a matching line gets an always-correct one-liner immediately. This is why ailog bugreport --no-ai is genuinely useful offline.
  2. Grounded AI answers — the matching facts are injected into the prompt as authoritative context, so a small local model summarizes known-good knowledge instead of guessing.

It currently covers 50+ error signatures and 120+ VHAL properties (powertrain, energy/EV, HVAC, body, lights, wipers, ADAS, power/user HAL, watchdog, cluster, diagnostics). It's pure data, so it grows without code changes — and tools/gen_vhal_knowledge.py can generate VHAL entries straight from a VehicleProperty.aidl in an AOSP tree.


Contributing

Contributions are welcome — especially new knowledge-pack entries (VHAL properties, SELinux/CarService/build signatures), which are pure data and a great first PR. See CONTRIBUTING.md for setup, and SECURITY.md to report vulnerabilities privately.

python3 -m unittest discover -s tests -v     # run the test suite
ruff check src/ tests/ tools/                # lint

Tests run in CI across Python 3.9–3.14 with ruff linting.

Further reading

License

MIT

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.2.0.tar.gz (92.1 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.2.0-py3-none-any.whl (74.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ailog_cli-2.2.0.tar.gz
Algorithm Hash digest
SHA256 b880109658c529f5b974ba446d834734de8e07bbbdc2cd6dbd4dcf5659abc121
MD5 d4b54fb1fe8656d61b976dff2e152931
BLAKE2b-256 d97805891833a2683f1c7cd797ded0dbae0e30a53b8fe88ca4fa02ebf54797c3

See more details on using hashes here.

Provenance

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

Publisher: release.yml on zoddiacc/ailog-cli

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.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ailog_cli-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 113643cfe16198b264c7accb70ae2aa596698d5e03ea623cf3af83eb16d338a8
MD5 b5011d552b6de4c07e8ab8058caa40eb
BLAKE2b-256 6131c3600077b1185517ca8d8d39ac96b7dd41f9a91b7b12b5412b6894fe5378

See more details on using hashes here.

Provenance

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

Publisher: release.yml on zoddiacc/ailog-cli

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

Release history Release notifications | RSS feed

2.2.1

2 files

This release

2.2.0 This release

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

Supported by

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