Bannin
番人 (Japanese for "watchman") — a universal monitoring agent for your machine, your LLMs, and your cloud notebooks.
You hit run. You walk away. Then what?
What It Does
Bannin runs on your machine (or inside a cloud notebook) and monitors everything: CPU, RAM, GPU, disk, running processes, LLM conversation health, API usage, and cloud session health. It predicts out-of-memory crashes before they happen, scores your AI conversation quality, fires smart alerts, and gives you plain-English summaries of how your system is doing.
It also works as an MCP server — meaning AI coding tools (Claude Code, Cursor, Windsurf) can query your system health through natural conversation.
Install
pip install bannin
With GPU monitoring and MCP server support:
pip install "bannin[all]"
Quick Start
Start the agent:
bannin start
Open the dashboard:
Visit localhost:8420 in your browser.
Use with Claude Code (MCP):
Add to your .mcp.json:
{
"mcpServers": {
"bannin": {
"command": "python",
"args": ["-m", "bannin.mcp"]
}
}
}
Then ask Claude things like:
- "How's my system doing?"
- "What processes are using the most memory?"
- "Am I going to run out of RAM?"
- "How healthy is this conversation?"
Features
System Monitoring
- CPU, RAM, disk, network -- real-time with 30-minute history
- GPU monitoring (NVIDIA via pynvml)
- Top processes by resource usage with friendly names and category badges
- Process descriptions and tooltips for 97 common applications
- Plain-English system health summaries
Intelligence
- OOM (out-of-memory) prediction with confidence scores and time-to-crash estimates
- Smart alerts with cooldowns (17+ configurable rules)
- Training progress detection (tqdm interception, stdout parsing)
- ETA estimation for long-running tasks
- L2 recommendations -- actionable suggestions from cross-signal analysis (12 rules)
- Built-in chatbot for natural language system health queries
LLM Health Monitoring
- Conversation health scoring (7 signals, 0-100 score) across Claude Code, Cursor, Windsurf, Ollama
- Real Claude Code session data via JSONL transcript reading (actual token counts)
- MCP session tracking with fatigue scoring and token estimation
- Ollama local LLM monitoring -- auto-detect, VRAM tracking, model load/unload
- LLM connection scanner -- detects 9 AI tool types running on your system
- Per-source health breakdown with combined worst-of scoring
LLM API Tracking
- Wrap OpenAI, Anthropic, and Google API clients to track token usage and cost
- Context window exhaustion prediction
- Latency degradation detection
- Cost calculation across 30+ models and 7 providers
Cloud Notebooks
- Google Colab: session time, GPU type changes, VRAM, storage, tier detection
- Kaggle: GPU quota tracking, session limits, output size, internet detection
Persistent Analytics
- Event pipeline with SQLite + FTS5 full-text search
- Query history by type, severity, or keyword
- 30-day retention with automatic pruning
- Separate analytics dashboard at port 8421
MCP Server (9 Tools)
get_system_metrics-- full system snapshot (CPU, RAM, disk, network, GPU)get_running_processes-- top processes by CPU/memory with friendly namespredict_oom-- memory exhaustion prediction with confidenceget_training_status-- tracked task progress and ETAsget_active_alerts-- current monitoring alertscheck_context_health-- conversation health score with component breakdownget_recommendations-- L2 actionable recommendationsquery_history-- search analytics event historysearch_events-- full-text search across stored events
Live Dashboard
- Real-time metrics with color-coded gauges (cyan/amber/red)
- Visual urgency indicators (amber glow at 60%, red pulse at 80%+)
- Conversation health accordion with per-source breakdown
- Connection badges for auto-detected LLM tools
- Memory trend chart (5-minute rolling)
- Process table with friendly names and hover tooltips
- OOM prediction display
- Alert banner with severity indicators
- Built-in chatbot ("Ask Bannin") with 15 intents
- Loading eye animation
API
The agent exposes a local REST API at localhost:8420:
| Endpoint | Method | Purpose |
|---|---|---|
/health |
GET | Agent alive check |
/status |
GET | Agent identity (hostname, OS, version, uptime) |
/metrics |
GET | Full system snapshot (CPU, RAM, disk, network, GPU) |
/processes |
GET | Top processes with friendly names and categories |
/summary |
GET | Plain-English system health summary |
/chat |
POST | Chatbot (natural language system health assistant) |
/alerts |
GET | Full alert history for this session |
/alerts/active |
GET | Currently active alerts |
/predictions/oom |
GET | OOM prediction with confidence |
/history/memory |
GET | Memory usage history over last N minutes |
/tasks |
GET | Tracked tasks (training progress, ETAs) |
/recommendations |
GET | L2 actionable recommendations |
/llm/usage |
GET | LLM session health and usage summary |
/llm/calls |
GET | Recent LLM API call history |
/llm/health |
GET | Unified conversation health score (combined + per-source) |
/llm/context |
GET | Context window exhaustion prediction |
/llm/latency |
GET | Response latency trend analysis |
/llm/connections |
GET | Auto-detected LLM tools running on system |
/ollama |
GET | Ollama local LLM status and loaded models |
/mcp/session |
POST | Receive MCP session health push |
/mcp/sessions |
GET | List all live MCP sessions |
/analytics/stats |
GET | Analytics store statistics |
/analytics/events |
GET | Query stored events with filters |
/analytics/search |
GET | Full-text search across events |
/analytics/timeline |
GET | Event timeline |
/platform |
GET | Cloud notebook platform info (Colab/Kaggle) |
/stream |
GET | Server-Sent Events for live dashboard updates |
Python API
import bannin
# Monitor system during a block of code
with bannin.watch():
train_model()
# Wrap an LLM client to track tokens and cost
import openai
client = bannin.wrap(openai.OpenAI())
# Track a specific scope
with bannin.track("my-experiment"):
response = client.chat.completions.create(...)
CLI
bannin start # Start the agent (dashboard at localhost:8420)
bannin start --port 9000 # Start on a custom port
bannin mcp # Start the MCP server (stdio transport)
bannin analytics # Start the analytics dashboard (port 8421)
bannin history # Query stored event history
bannin history --since 2h # Events from the last 2 hours
bannin history --search "OOM" # Full-text search
bannin history --json # Raw JSON output
What's Coming
- Phone alerts (push notifications when tasks finish or systems need attention)
- Browser extension for ChatGPT, Claude.ai, and Gemini monitoring
- Context transfer -- carry conversation state to a fresh chat when health degrades
- macOS Apple Silicon GPU support
- Shareable dashboards via bannin.dev
Requirements
- Python 3.9+
- Works on Windows, macOS, and Linux
License
Metadata
Release files for bannin 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bannin-0.1.1.tar.gz | 204.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bannin-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 398.6 kB
Release files / bannin-0.1.1.tar.gz
| Download URL | bannin-0.1.1.tar.gz |
|---|---|
| Size | 204.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b15eb34fb86df6ab3189442bc894748ca54cbaec3a660a81f7a62bd146b258f0
|
|
BLAKE2b-256 checksum How to use checksums |
45c90d2f28850f44302378ad7d7ec20258e3211581ca89009b6ca530b5545088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|
Release files / bannin-0.1.1-py3-none-any.whl
| Download URL | bannin-0.1.1-py3-none-any.whl |
|---|---|
| Size | 194.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a33ff36bb7a7d618349d7d206123581b00159e4ea0ad2737155f41ab424a042
|
|
BLAKE2b-256 checksum How to use checksums |
fb30c3a2e669e682fc5721447de440203d62d14833ba442e10865d510766db30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|
Security for bannin 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.