AI-powered Apache Spark job analyzer and configuration advisor
Project description
spark-advisor-cli
AI-powered Apache Spark job analyzer and configuration advisor. Standalone CLI tool.
Stop guessing Spark configs. Let data and AI tell you what's wrong.
Install
pip install spark-advisor-cli
Quick Start
# Analyze from event log file (rules-only, free)
spark-advisor analyze /path/to/event-log.json.gz --no-ai
# Analyze with AI recommendations
export SA_ANALYZER_AI__API_KEY=sk-or-...
spark-advisor analyze /path/to/event-log.json.gz
# Analyze from History Server
spark-advisor analyze app-20250101120000-0001 -hs http://yarn:18080
# Agent mode (multi-turn AI analysis)
spark-advisor analyze /path/to/event-log.json.gz --agent
Commands
analyze — analyze a Spark job
# From event log file
spark-advisor analyze /path/to/event-log.json.gz
# From History Server
spark-advisor analyze app-20250101120000-0001 -hs http://yarn:18080
# With AI analysis (default if SA_ANALYZER_AI__API_KEY is set)
spark-advisor analyze /path/to/event-log.json.gz
# Without AI (rules only)
spark-advisor analyze /path/to/event-log.json.gz --no-ai
# Agent mode (multi-turn AI with tool use)
spark-advisor analyze /path/to/event-log.json.gz --agent
# Verbose mode (per-stage breakdown)
spark-advisor analyze /path/to/event-log.json.gz --verbose
# JSON output
spark-advisor analyze /path/to/event-log.json.gz --format json
# Save suggested config to file
spark-advisor analyze /path/to/event-log.json.gz -o spark-defaults.conf
# Use specific LLM model
spark-advisor analyze /path/to/event-log.json.gz --model qwen/qwen3-coder:free
| Flag | Short | Default | Description |
|---|---|---|---|
source |
required | App ID (with -hs) or path to event log file |
|
--history-server |
-hs |
None |
Spark History Server URL |
--no-ai |
False |
Disable AI analysis (rules only) | |
--agent |
False |
Use agent mode (multi-turn AI with tool use) | |
--model |
-m |
qwen/qwen3-coder:free |
LLM model for AI analysis |
--output |
-o |
None |
Write suggested config to file |
--format |
-f |
text |
Output format: text or json |
--verbose |
-v |
False |
Show per-stage breakdown |
scan — list recent jobs from History Server
spark-advisor scan -hs http://yarn:18080 --limit 20
version
spark-advisor version
# spark-advisor v0.1.10
What it detects
11 deterministic rules: data skew, disk spill, GC pressure, shuffle partitions, executor idle, task failures, small files, broadcast join threshold, serializer choice, dynamic allocation, memory overhead.
All thresholds are configurable via Thresholds model.
See also
- Full documentation and architecture
- MCP Server setup (Claude Desktop / Cursor)
- Rules engine
- Analyzer
- Contributing
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
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 spark_advisor_cli-0.1.20.tar.gz.
File metadata
- Download URL: spark_advisor_cli-0.1.20.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4453663ceb1b7d7c5f184d4a060ae030afa6de8ee7ce783a0a24d8e7669255d2
|
|
| MD5 |
a6053a14d9d050be5ad65360af8ef159
|
|
| BLAKE2b-256 |
8737e83738e1b0bdfcf8638dc01e8b67ed30bbc37f19d01f222ec881ae6d880e
|
File details
Details for the file spark_advisor_cli-0.1.20-py3-none-any.whl.
File metadata
- Download URL: spark_advisor_cli-0.1.20-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5247af2ea602177f1345970efba22b8973e1dc08dbf3ad98c32d6319138487a4
|
|
| MD5 |
804554589284aa672102c8aaadbe9a5c
|
|
| BLAKE2b-256 |
938a1512c3f8e27694435b7a991af3bedc18f06a4ffd7f7f75b130bb8790e010
|