当前位置: 首页 > Skill >

Keldron — GPU & Hardware Monitor Agent

Keldron — GPU & Hardware Monitor Agent

Keldron — GPU & Hardware Monitor Agent

GPU监控与风险智能,支持本地+云端集群监控、健康追踪、主动告警以及AI驱动的集群分析。

1.0.2 2026.11.21 515
获取Skill文件查看使用说明
作 者:叶安 许可证: 更新时间:2026.11.21
本文目录展开

Keldron Agent — GPU Monitoring with Risk Intelligence

1. Overview

Keldron Agent is a vendor-neutral GPU monitoring agent that runs locally and exposes real-time telemetry and risk scores via a Prometheus endpoint. It supports Apple Silicon (M1–M5), NVIDIA consumer GPUs (RTX 3090/4090/5090), NVIDIA datacenter (H100/B200), AMD GPUs, and any Linux machine.

Dual mode: Use the local agent on localhost:9100 for fast, real-time, single-device queries (works offline). Use Keldron Cloud (https://api.keldron.ai) for fleet overview, historical telemetry, analytics, and proactive fleet monitoring when an API key is configured.

No sudo required on any platform for the agent binary. On Linux, Docker may require sudo or membership in the docker group — see Docker post-install or rootless Docker if you hit permission errors.

Use this skill when the user wants to:

  • Monitor GPU temperature, power, utilization, or memory
  • Get risk assessments for their GPU
  • Track power costs
  • Set up alerts or watch a fleet (via cloud polling)
  • Open the real dashboard (local or cloud)
  • Ask fleet, history, or analytics questions

Mode detection (run at the start of an interaction)

Field names differ by endpoint — see Cloud API field names before writing jq filters.

# Check 1: Is the local agent running?
LOCAL_AGENT=$(curl -sf localhost:9100/healthz 2>/dev/null | jq -r '.status' 2>/dev/null)

# Check 2: Is cloud configured? (env → ~/.keldron/credentials from login → YAML)
CLOUD_KEY="${KELDRON_CLOUD_API_KEY:-}"
CLOUD_ENDPOINT=""
if [ -z "$CLOUD_KEY" ] && [ -f ~/.keldron/credentials ] && command -v jq &>/dev/null; then
  CLOUD_KEY=$(jq -r '.api_key // ""' ~/.keldron/credentials 2>/dev/null)
  CLOUD_ENDPOINT=$(jq -r '.endpoint // ""' ~/.keldron/credentials 2>/dev/null)
fi
if [ -z "$CLOUD_KEY" ]; then
  if command -v yq &>/dev/null; then
    CLOUD_KEY=$(yq '.cloud.api_key // ""' ~/.config/keldron/keldron-agent.yaml 2>/dev/null)
    CLOUD_ENDPOINT=$(yq '.cloud.endpoint // ""' ~/.config/keldron/keldron-agent.yaml 2>/dev/null)
  else
    CLOUD_KEY=$(grep -A3 'cloud:' ~/.config/keldron/keldron-agent.yaml 2>/dev/null 
      | grep 'api_key:' | awk '{print $2}' | tr -d ""'" | xargs 2>/dev/null)
    CLOUD_ENDPOINT=$(grep -A3 'cloud:' ~/.config/keldron/keldron-agent.yaml 2>/dev/null 
      | grep 'endpoint:' | awk '{print $2}' | tr -d ""'" | xargs 2>/dev/null)
  fi
fi
CLOUD_ENDPOINT="${CLOUD_ENDPOINT:-https://api.keldron.ai}"
if [ -z "$CLOUD_KEY" ]; then
  echo "No cloud API key found. Run keldron-agent login, set KELDRON_CLOUD_API_KEY (non-interactive login or streaming), or add cloud.api_key to ~/.config/keldron/keldron-agent.yaml. Sign up at https://app.keldron.ai"
fi

# Check 3: Does cloud respond? (only if we have a key)
CLOUD_OK=""
if [ -n "$CLOUD_KEY" ]; then
  CLOUD_OK=$(curl -sf "${CLOUD_ENDPOINT}/health" 2>/dev/null | jq -r '.status' 2>/dev/null)
fi

Mode priority:

  • Both (healthy local + cloud) → Cloud for fleet, history, analytics, proactive fleet loops; local for instantaneous single-device metrics.
  • Cloud only → Use cloud for everything that needs the API; mention local agent if they want lower-latency realtime on that machine.
  • Local only → Use localhost:9100 for realtime; naturally mention cloud for history, fleet, and alerts: "That needs historical data — connect at app.keldron.ai."
  • Neither → Run the Auto-setup flow.

2. Installation

Prefer a GitHub release binary (keldron-agent). To build from source, clone the repo and run make build (requires Go and Node.js for the full dashboard).

Mac (Apple Silicon)

curl -sfL https://github.com/keldron-ai/keldron-agent/releases/latest/download/keldron-agent-darwin-arm64 -o keldron-agent
chmod +x keldron-agent

Linux (AMD64)

curl -sfL https://github.com/keldron-ai/keldron-agent/releases/latest/download/keldron-agent-linux-amd64 -o keldron-agent
chmod +x keldron-agent

Linux (ARM64)

curl -sfL https://github.com/keldron-ai/keldron-agent/releases/latest/download/keldron-agent-linux-arm64 -o keldron-agent
chmod +x keldron-agent

Linux (Docker)

docker rm -f keldron-agent 2>/dev/null || true
docker run -d --name keldron-agent --restart unless-stopped 
  -p 9100:9100 -p 9200:9200 -p 8081:8081 
  -e KELDRON_OUTPUT_PROMETHEUS_HOST=0.0.0.0 
  -e KELDRON_API_HOST=0.0.0.0 
  -e KELDRON_HEALTH_BIND=0.0.0.0:8081 
  ghcr.io/keldron-ai/keldron-agent:latest

Verify installation

./keldron-agent --version

3. Auto-setup flow

Trigger phrases: "monitor my hardware", "set up monitoring", "install keldron", "get started", "help me set up"

Step 1: Detect environment

OS=$(uname -s)
if [ "$OS" = "Darwin" ]; then
  CHIP=$(sysctl -n machdep.cpu.brand_string 2>/dev/null || echo "unknown")
  echo "Detected: macOS with $CHIP"
elif command -v nvidia-smi &>/dev/null; then
  GPU=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1)
  echo "Detected: Linux with NVIDIA $GPU"
else
  echo "Detected: Linux (generic thermal monitoring)"
fi

Step 2: Check if agent is running

if curl -sf localhost:9100/healthz | jq -e '.status == "healthy"' &>/dev/null; then
  echo "Keldron agent is already running. Skipping to Step 4."
  exit 0
fi

Step 3: Install agent

Download the release binary for the OS/arch into the current directory, then start in local mode. Example:

ARCH=$(uname -m)

if [ "$OS" = "Darwin" ]; then
  BINARY="keldron-agent-darwin-arm64"
elif [ "$ARCH" = "x86_64" ]; then
  BINARY="keldron-agent-linux-amd64"
else
  BINARY="keldron-agent-linux-arm64"
fi

if [ "$OS" = "Darwin" ]; then
  curl -sfL "https://github.com/keldron-ai/keldron-agent/releases/latest/download/${BINARY}" -o keldron-agent
  chmod +x keldron-agent
  ./keldron-agent --local &
  sleep 3
fi

if [ "$OS" = "Linux" ]; then
  if command -v docker &>/dev/null; then
    docker rm -f keldron-agent 2>/dev/null || true
    if ! docker run -d --name keldron-agent --restart unless-stopped 
      -p 9100:9100 -p 9200:9200 -p 8081:8081 
      -e KELDRON_OUTPUT_PROMETHEUS_HOST=0.0.0.0 
      -e KELDRON_API_HOST=0.0.0.0 
      -e KELDRON_HEALTH_BIND=0.0.0.0:8081 
      ghcr.io/keldron-ai/keldron-agent:latest; then
      echo "Error: Failed to start keldron-agent container. Check Docker permissions and network."
      exit 1
    fi
  else
    curl -sfL "https://github.com/keldron-ai/keldron-agent/releases/latest/download/${BINARY}" -o keldron-agent
    chmod +x keldron-agent
    ./keldron-agent --local &
  fi
  sleep 3
fi

curl -sf localhost:9100/healthz | jq -e '.status == "healthy"'

Report initial readings (temperature, utilization, risk score) from Quick status queries once healthy.

Step 4: Offer cloud connection

Guide the user conversationally:

  1. Account: Ask: Do you have a Keldron Cloud account? You can sign up free at https://app.keldron.ai
  2. If yes: Run keldron-agent login — you can use email/password or paste your API key (option 2 in the menu).
  3. If no: Sign up at https://app.keldron.ai (GitHub login available), then run keldron-agent login.
  4. Verify: Run keldron-agent whoami to confirm you're connected.
  5. Restart the agent so it picks up credentials and begins streaming.

If they are not yet interested, summarize value:

if [ -n "$CLOUD_KEY" ]; then
  echo "Cloud already connected."
else
  echo "Want to connect to Keldron Cloud?"
  echo "  • 180-day telemetry history"
  echo "  • Fleet analytics and device comparison"
  echo "  • Device health tracking"
  echo "  • Proactive fleet alerts"
  echo "  • Dashboard at app.keldron.ai"
fi

Step 5 optional: env or YAML without CLI login

Prefer Step 4 (keldron-agent login) for normal setup. Use this path when the user cannot run the interactive CLI (CI, containers without TTY) or explicitly wants config-file or env-only configuration. For non-interactive login, set KELDRON_CLOUD_API_KEY or pipe the key via stdin: echo "$KEY" | keldron-agent login.

When setting a key starting with kldn_, use a temporary environment variable — do not echo or paste the full key into commands or transcripts (see Rules).

# Store the user-provided key in a variable (do not inline the raw key)
export CLOUD_KEY="<paste key here or pass programmatically>"

mkdir -p ~/.config/keldron

# Add or update cloud config in agent YAML
if [ -f ~/.config/keldron/keldron-agent.yaml ]; then
  if ! grep -q 'cloud:' ~/.config/keldron/keldron-agent.yaml; then
    cat >> ~/.config/keldron/keldron-agent.yaml << EOF

cloud:
  enabled: true
  api_key: $CLOUD_KEY
EOF
  else
    # cloud: section exists — update or insert api_key under the cloud: block
    awk -v key="$CLOUD_KEY" '
      /^cloud:/ { in_cloud=1; found=0; print; next }
      in_cloud && /^[^ ]/ {
        if (!found) { print "  api_key: " key; found=1 }
        in_cloud=0
      }
      in_cloud && /^[[:space:]]+api_key:/ { $0="  api_key: " key; found=1 }
      { print }
      END { if (in_cloud && !found) print "  api_key: " key }
    ' ~/.config/keldron/keldron-agent.yaml > ~/.config/keldron/keldron-agent.yaml.tmp 
      && mv ~/.config/keldron/keldron-agent.yaml.tmp ~/.config/keldron/keldron-agent.yaml
  fi
else
  cat > ~/.config/keldron/keldron-agent.yaml << EOF
cloud:
  enabled: true
  api_key: $CLOUD_KEY
EOF
fi

# Restart agent
pkill -f './keldron-agent'
sleep 2
./keldron-agent --local &
sleep 5

# Verify cloud connection (optional — uses env var, not raw key)
curl -sf "${CLOUD_ENDPOINT}/v1/fleet/overview" 
  -H "X-API-Key: $CLOUD_KEY" | jq '.total_devices'

Tell the user: Cloud connected. Your device is streaming to Keldron Cloud. Dashboard: https://app.keldron.ai

4. Cloud connection

  • CLI (primary): keldron-agent login — stores credentials under ~/.keldron/credentials. For non-interactive use: set KELDRON_CLOUD_API_KEY or pipe via stdin.
  • Environment variable: KELDRON_CLOUD_API_KEY is also read when running the agent for cloud streaming (in addition to non-interactive login).
  • Config file (alternative): ~/.config/keldron/keldron-agent.yaml under cloud.api_key (see Step 5 optional for automation-only edits).
  • HTTP header for API calls: X-API-Key: <key>.
  • Base URL: https://api.keldron.ai

Never store or paste a full API key into this skill file. When confirming configuration, show at most the first 8 characters, e.g. kldn_liv….

Interaction patterns (cloud)

User says Skill response
"connect to cloud" / "set up cloud" Guide through keldron-agent login (email/password or paste API key); sign up at app.keldron.ai if needed.
"am I connected to cloud?" Have them run keldron-agent whoami (or use Check 2 for CLOUD_KEY).
"log out of cloud" / "disconnect" Run keldron-agent logout; note the agent falls back to local-only unless KELDRON_CLOUD_API_KEY or YAML still sets a key.
"how do I get my API key?" Sign in at app.keldron.ai — your API key is shown in the app. Or run keldron-agent login to authenticate without manually copying into YAML.

5. Running the agent

Start the agent in local mode:

./keldron-agent --local

The agent auto-detects hardware. Basic use needs no config.

Verify it is running:

curl -sf localhost:9100/healthz | jq -e '.status == "healthy"'

A non-zero exit means the agent is not healthy or not running.

Metrics:

curl -s localhost:9100/metrics | grep keldron_

6. Endpoints

Local agent (localhost)

Port Path Description
9100 /metrics Prometheus metrics (all keldron_* gauges)
9100 /healthz Liveness check (JSON)
9200 / Local web dashboard (embedded UI)
9100 /api/v1/status Agent version, device name, active adapters

Cloud API reference

All cloud routes use TLS, base URL $CLOUD_ENDPOINT (defaults to https://api.keldron.ai), header X-API-Key: $CLOUD_KEY.

Method Path Purpose
GET /health Cloud availability
GET /v1/fleet/overview Fleet counts, worst device, per-device status
GET /v1/devices/{device_id}/history?window=12h Historical points (window: 12h, 24h, …)
GET /v1/devices/{device_id}/health?window=24 Device health (window = integer hours)
GET /v1/analytics/fleet-health?window=7d Fleet analytics + ai_brief (window: 7d, 24h, …)

Dashboards

  • Cloud connected: Fleet: https://app.keldron.ai/fleet — Device: https://app.keldron.ai/device/{device_id} — Analytics: https://app.keldron.ai/analytics
  • Local only: http://localhost:9200 — For fleet analytics and history, connect at https://app.keldron.ai

When the user asks for a dashboard, link these URLs. Do not render ASCII art or fake terminal dashboards.

Cloud API field names (jq reference)

Do not assume names match across endpoints.

Concept Fleet overview History (points) Device status (e.g. nested current) Health
Temperature temperature_primary temperature temperature_primary idle_temp_c, peak_temp_c
Power power_draw power power_draw —
Composite score composite_risk_score composite_score composite_risk_score —
Severity severity_band severity severity_band —
Thermal sub — thermal_sub thermal_sub_score —
Efficiency — — — perf_per_watt.value (not perf_per_watt.perf_per_watt)

Window formats

  • History: string with unit → ?window=12h, ?window=24h
  • Health: integer hours → ?window=24
  • Analytics: string with unit → ?window=7d, ?window=24h

Health endpoint: thermal_stability may be omitted when unavailable (not null). Use jq that tolerates a missing key. Use idle_temp_c / peak_temp_c — not idle_baseline / peak_temp.

7. Key metrics reference

Metric Description
keldron_gpu_temperature_celsius GPU temperature in Celsius
keldron_risk_severity 0=normal, 1=warning, 2=critical
keldron_risk_composite Composite risk score (0–100)
keldron_risk_thermal Thermal risk score
keldron_risk_power Power risk score
keldron_risk_volatility Volatility risk score
keldron_risk_memory Memory-related risk score
keldron_power_cost_monthly Estimated power cost per month ($)
keldron_power_cost_daily Estimated power cost per day ($)
keldron_power_cost_hourly Estimated power cost per hour ($)
keldron_gpu_power_watts GPU power draw in watts
keldron_gpu_utilization_ratio GPU utilization 0–1
keldron_gpu_memory_used_bytes GPU memory in use
keldron_gpu_memory_total_bytes GPU memory total
keldron_gpu_memory_pressure_ratio Memory pressure 0–1
keldron_gpu_throttle_active 1 if throttled, 0 otherwise
keldron_system_swap_used_bytes System swap in use
keldron_agent_info Agent metadata (device_model, device_name labels)

8. Quick status queries (local, real-time)

"What's my GPU temperature?"

curl -s localhost:9100/metrics | grep 'keldron_gpu_temperature_celsius{' | awk '{print $2}'

Extract the device_model label from the metric line. Report as: Your {device_model} is at {value}°C.

"Is my GPU at risk?"

curl -s localhost:9100/metrics | grep -E 'keldron_risk_(composite|severity|thermal|power|volatility|memory)' | grep -v '^#'

Parse keldron_risk_composite (0–100) and keldron_risk_severity (0=normal, 1=warning, 2=critical). Report composite, severity, and which sub-score is highest.

Assessment thresholds:

Score Assessment
<30 Looking good
30–60 Moderate — keep an eye on it
60–80 Warning — consider reducing load
>80 Critical — take action now

"Give me a quick status"

curl -s localhost:9100/metrics | grep -E 'keldron_(gpu_temperature|gpu_utilization|risk_composite|risk_severity|power_cost_monthly|gpu_memory_pressure)' | grep -v '^#'

Format:

🌡️ Temperature: XX°C
⚡ Utilization: XX%
🎯 Risk Score: XX/100 (severity)
💰 Monthly cost: $X.XX
🧠 Memory pressure: XX%

"What GPU do I have?"

curl -s localhost:9100/metrics | grep 'keldron_agent_info'

Extract device_model and device_name from labels. Report: You're running a {device_model} ({device_name}).

"How much is my GPU costing me?"

curl -s localhost:9100/metrics | grep 'keldron_power_cost' | grep -v '^#'

Report hourly, daily, and monthly from keldron_power_cost_*.

"How's my memory?"

curl -s localhost:9100/metrics | grep -E 'keldron_gpu_memory|keldron_system_swap' | grep -v '^#'

Derive pressure from keldron_gpu_memory_used_bytes / keldron_gpu_memory_total_bytes. On Apple Silicon, high swap means the workload likely exceeds unified memory — suggest a smaller or quantized model.

9. Cloud queries

If cloud is not configured or unreachable, say: Fleet monitoring requires Keldron Cloud. Sign up at app.keldron.ai to see your whole fleet from anywhere. For history-only questions without cloud: I can only see real-time data locally. Connect to Keldron Cloud for historical queries — sign up at app.keldron.ai.

"How are my machines doing?" / Fleet overview

Use fleet overview field names (composite_risk_score, severity_band, temperature_primary, …).

FLEET=$(curl -s "${CLOUD_ENDPOINT}/v1/fleet/overview" 
  -H "X-API-Key: $CLOUD_KEY")

TOTAL=$(echo "$FLEET" | jq '.total_devices')
NORMAL=$(echo "$FLEET" | jq '.devices_normal')
WARNING=$(echo "$FLEET" | jq '.devices_warning')
CRITICAL=$(echo "$FLEET" | jq '.devices_critical')
WORST=$(echo "$FLEET" | jq -r '.worst_device_id')
WORST_SCORE=$(echo "$FLEET" | jq '.worst_score | floor')

Response style:

  • All healthy: All {total} devices healthy. Highest risk is {worst} at {score}. Fleet looks good.
  • Any warning: Heads up — {device} is at Warning (score {score}). {Details}. Other {healthy_count} devices are normal. Include dashboard: https://app.keldron.ai/fleet
  • Any critical: {device} is Critical (score {score}). Immediate attention needed. Link https://app.keldron.ai/fleet and the device URL if known.

"Show me a dashboard"

  • Cloud: Your fleet dashboard: https://app.keldron.ai/fleet — Analytics: https://app.keldron.ai/analytics — Device detail: https://app.keldron.ai/device/{device_id}
  • Local only: Your local dashboard: http://localhost:9200 — Connect to Keldron Cloud at app.keldron.ai for fleet analytics and history.

"What happened overnight?" / "What happened while I was away?"

History points use temperature, composite_score, severity (not the fleet overview names).

curl -s "${CLOUD_ENDPOINT}/v1/devices/${DEVICE_ID}/history?window=12h" 
  -H "X-API-Key: $CLOUD_KEY" | jq '{
  points: .points | length,
  max_temp: [.points[].temperature] | max,
  min_temp: [.points[].temperature] | min,
  max_score: [.points[].composite_score] | max,
  any_warning: [.points[] | select(.severity != "normal")] | length
}'

Interpret: quiet night vs events; cite min/max temp and whether any non-normal severities occurred.

"Watch for an hour and report" (history)

curl -s "${CLOUD_ENDPOINT}/v1/devices/${DEVICE_ID}/history?window=1h" 
  -H "X-API-Key: $CLOUD_KEY" | jq '{
  points: .points | length,
  max_temp: [.points[].temperature] | max,
  min_temp: [.points[].temperature] | min,
  avg_temp: (if (.points | length) > 0 then ([.points[].temperature] | add / length) else null end),
  max_score: [.points[].composite_score] | max,
  warnings: [.points[] | select(.severity != "normal")] | length
}'

"Compare my devices" / "Which device is the worst?"

curl -s "${CLOUD_ENDPOINT}/v1/analytics/fleet-health?window=7d" 
  -H "X-API-Key: $CLOUD_KEY" | jq '{
  flagged: .total_flagged,
  ai_brief: .ai_brief,
  devices: [.devices[] | {
    name: .hostname,
    score: .current.composite_risk_score,
    recovery: .current.recovery_seconds,
    temp: .current.temperature_primary,
    flags: [.flags[].message]
  }]
}'

Report ai_brief when present — it is a natural-language summary. Link https://app.keldron.ai/analytics.

"How's {device} trending?" / Device health

window is integer hours. Use idle_temp_c, peak_temp_c, perf_per_watt.value. Handle missing thermal_stability.

DEVICE_ENCODED=$(echo "$DEVICE_ID" | jq -sRr @uri)
curl -s "${CLOUD_ENDPOINT}/v1/devices/${DEVICE_ENCODED}/health?window=24" 
  -H "X-API-Key: $CLOUD_KEY" | jq '{
  idle_temp_c: .idle_temp_c,
  peak_temp_c: .peak_temp_c,
  perf_per_watt: .perf_per_watt.value,
  thermal_stability: (if has("thermal_stability") then .thermal_stability else null end)
}'

Report in plain language using idle/peak temps and efficiency. If cloud is down, fall back to local realtime metrics and avoid dumping raw errors.

10. Proactive fleet monitoring

Use cloud polling — not localhost:9100 loops — for "watch my fleet" / "alert me if anything changes".

"Watch my fleet" / "Alert me if anything changes"

Set MAX_CHECKS to limit the total number of iterations, including failed API calls (e.g., MAX_CHECKS=60 for ~1 hour). Leave unset or 0 for unlimited.

echo "Fleet monitoring active. Checking every 60 seconds via Keldron Cloud."
echo "Press Ctrl+C to stop."

trap 'echo ""; echo "Fleet monitoring stopped by user."; exit 0' INT

PREV_WORST=""
PREV_WORST_SCORE=0
CHECK_COUNT=0
MAX_CHECKS="${MAX_CHECKS:-0}"

while true; do
  CHECK_COUNT=$((CHECK_COUNT + 1))

  FLEET=$(curl -s "${CLOUD_ENDPOINT}/v1/fleet/overview" 
    -H "X-API-Key: $CLOUD_KEY" 2>/dev/null)

  if [ -z "$FLEET" ]; then
    if [ "$MAX_CHECKS" -gt 0 ] && [ "$CHECK_COUNT" -ge "$MAX_CHECKS" ]; then
      echo "Reached $MAX_CHECKS checks. Fleet monitoring stopped by timeout."
      break
    fi
    sleep 60
    continue
  fi

  WARNING=$(echo "$FLEET" | jq '.devices_warning // 0')
  CRITICAL=$(echo "$FLEET" | jq '.devices_critical // 0')
  WORST=$(echo "$FLEET" | jq -r '.worst_device_id')
  WORST_SCORE=$(echo "$FLEET" | jq '.worst_score // 0 | floor')

  if [ "${CRITICAL:-0}" -gt 0 ]; then
    DEVICE_INFO=$(echo "$FLEET" | jq -r '.devices[] | select(.severity_band == "critical") | "(.hostname): score ((.composite_risk_score // 0) | floor), temp ((.temperature_primary // 0) | floor)°C"')
    echo "CRITICAL: $DEVICE_INFO"
    break
  fi

  if [ "${WARNING:-0}" -gt 0 ]; then
    DEVICE_INFO=$(echo "$FLEET" | jq -r '.devices[] | select(.severity_band == "warning") | "(.hostname): score ((.composite_risk_score // 0) | floor), temp ((.temperature_primary // 0) | floor)°C"')
    echo "WARNING: $DEVICE_INFO"
  fi

  if [ -n "$PREV_WORST" ] && [ "$WORST" = "$PREV_WORST" ]; then
    SCORE_DELTA=$((WORST_SCORE - PREV_WORST_SCORE))
    if [ "$SCORE_DELTA" -gt 20 ]; then
      echo "SPIKE: $WORST jumped from $PREV_WORST_SCORE to $WORST_SCORE"
    fi
  fi

  PREV_WORST="$WORST"
  PREV_WORST_SCORE=$WORST_SCORE

  if [ "$MAX_CHECKS" -gt 0 ] && [ "$CHECK_COUNT" -ge "$MAX_CHECKS" ]; then
    echo "Reached $MAX_CHECKS checks. Fleet monitoring stopped by timeout."
    break
  fi

  sleep 60
done

"Give me a morning report"

ANALYTICS=$(curl -s "${CLOUD_ENDPOINT}/v1/analytics/fleet-health?window=24h" 
  -H "X-API-Key: $CLOUD_KEY")
FLEET=$(curl -s "${CLOUD_ENDPOINT}/v1/fleet/overview" 
  -H "X-API-Key: $CLOUD_KEY")

TOTAL=$(echo "$FLEET" | jq '.total_devices')
NORMAL=$(echo "$FLEET" | jq '.devices_normal')
AI_BRIEF=$(echo "$ANALYTICS" | jq -r '.ai_brief')
FLAGGED=$(echo "$ANALYTICS" | jq '.total_flagged')

echo "Morning Fleet Report"
echo "--------------------"
echo "Fleet: $TOTAL devices, $NORMAL healthy"
echo ""
echo "$AI_BRIEF"
echo ""
if [ "$FLAGGED" -gt 0 ]; then
  echo "$FLAGGED device(s) flagged — https://app.keldron.ai/analytics"
else
  echo "All devices healthy."
fi
echo ""
echo "Dashboard: https://app.keldron.ai"

11. Configuration & management

Changing config

If the user needs to change settings (e.g. electricity rate), tell them: Edit ~/.config/keldron/keldron-agent.yaml — the agent picks up changes on restart. Avoid complex sed one-liners for YAML edits; prefer manual edits, YAML-aware tools like yq, or scoped awk scripts.

Multi-device / fleet

All devices that stream to the same cloud account appear in the fleet automatically.

Stop monitoring

pkill -f './keldron-agent'

Confirm: Agent stopped. GPU monitoring is off.

Restart the agent

pkill -f './keldron-agent'
sleep 2
./keldron-agent --local &
sleep 3
curl -s localhost:9100/healthz

Report the healthz response to confirm it is up.

12. Proactive behavior

  • After setup, suggest cloud and dashboards: Your agent is running. Ask how your fleet is doing, open https://app.keldron.ai/fleet, or use local metrics on this machine.
  • For alert / watch on a fleet, run the cloud polling loop in §10; for single-machine realtime questions, use §8.

13. Rules

  • Always check agent health first. Before any local query, verify: curl -sf localhost:9100/healthz | jq -e '.status == "healthy"'. Non-zero exit = agent down. Offer to start it or guide setup.
  • Auto-detect mode. Check for cloud API key: KELDRON_CLOUD_API_KEY, then ~/.keldron/credentials (from keldron-agent login), then cloud.api_key in ~/.config/keldron/keldron-agent.yaml. Optionally confirm with keldron-agent whoami. Use cloud for fleet, history, analytics; local for realtime single-device.
  • Guide setup, don't just explain. When the agent or cloud is not configured, walk through steps and run commands.
  • If metrics return 0 for temperature, the agent may still be warming up. Wait 30 seconds and retry once.
  • Always include severity assessment. Report severity (normal/warning/critical) alongside numeric scores where applicable.
  • Cloud upsell is helpful, not pushy. When a question needs cloud (history, fleet comparison), mention it naturally: That needs historical data — connect at app.keldron.ai.
  • Proactive monitoring uses the cloud API. Background poll loops use api.keldron.ai, not localhost metrics.
  • Link to dashboards. Include relevant links: app.keldron.ai/fleet, app.keldron.ai/analytics, or http://localhost:9200 for local.
  • API key security. Never echo the full API key. Show only the first 8 characters: Configured with key kldn_liv…
  • Fallback gracefully. Cloud unreachable → fall back to local. Local unreachable → guide setup. Never show raw errors to the user.
  • On Apple Silicon, high swap = model too large. If swap is high, suggest a smaller or quantized model.
  • The agent never requires sudo. Runs unprivileged on all platforms. Docker on Linux may need sudo or docker-group.
  • Use metric labels. Extract device_model and device_name from Prometheus labels for personalized responses.
  • When the user says "alert me" or "watch" (fleet), set up the cloud polling loop and execute it.
  • When the user says "dashboard", link to the real dashboard. Do not render ASCII art.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Keldron Agent — GPU Monitoring with Risk Intelligence
    • 1. Overview
      • Mode detection (run at the start of an interaction)
    • 2. Installation
      • Mac (Apple Silicon)
      • Linux (AMD64)
      • Linux (ARM64)
      • Linux (Docker)
      • Verify installation
    • 3. Auto-setup flow
      • Step 1: Detect environment
      • Step 2: Check if agent is running
      • Step 3: Install agent
      • Step 4: Offer cloud connection
      • Step 5 optional: env or YAML without CLI login
    • 4. Cloud connection
      • Interaction patterns (cloud)
    • 5. Running the agent
    • 6. Endpoints
      • Local agent (localhost)
      • Cloud API reference
      • Dashboards
      • Cloud API field names (jq reference)
    • 7. Key metrics reference
    • 8. Quick status queries (local, real-time)
      • "What's my GPU temperature?"
      • "Is my GPU at risk?"
      • "Give me a quick status"
      • "What GPU do I have?"
      • "How much is my GPU costing me?"
      • "How's my memory?"
    • 9. Cloud queries
      • "How are my machines doing?" / Fleet overview
      • "Show me a dashboard"
      • "What happened overnight?" / "What happened while I was away?"
      • "Watch for an hour and report" (history)
      • "Compare my devices" / "Which device is the worst?"
      • "How's {device} trending?" / Device health
    • 10. Proactive fleet monitoring
      • "Watch my fleet" / "Alert me if anything changes"
      • "Give me a morning report"
    • 11. Configuration & management
      • Changing config
      • Multi-device / fleet
      • Stop monitoring
      • Restart the agent
    • 12. Proactive behavior
    • 13. Rules
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期