{"id":50606360,"url":"https://github.com/helmcode/nan-benchmarks-agent","last_synced_at":"2026-06-05T23:03:50.219Z","repository":{"id":361445965,"uuid":"1254429699","full_name":"helmcode/nan-benchmarks-agent","owner":"helmcode","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-30T17:50:23.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T18:13:59.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helmcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T14:56:07.000Z","updated_at":"2026-05-30T17:50:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/helmcode/nan-benchmarks-agent","commit_stats":null,"previous_names":["helmcode/nan-benchmarks-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/helmcode/nan-benchmarks-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helmcode%2Fnan-benchmarks-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helmcode%2Fnan-benchmarks-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helmcode%2Fnan-benchmarks-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helmcode%2Fnan-benchmarks-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helmcode","download_url":"https://codeload.github.com/helmcode/nan-benchmarks-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helmcode%2Fnan-benchmarks-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33963021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-05T23:03:49.318Z","updated_at":"2026-06-05T23:03:50.211Z","avatar_url":"https://github.com/helmcode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nan-benchmarks-agent\n\nStateless Go agent that generates weekly and monthly performance reports for\nan AI inference cluster running vLLM + LiteLLM. Designed to run as a Kubernetes\nCronJob. Queries VictoriaMetrics in-cluster, asks an OpenAI-compatible chat\nendpoint for an executive narrative, renders a PDF and uploads it to Slack.\n\n## Pipeline\n\n```\ncollect  → vmclient runs PromQL queries against your VictoriaMetrics vmselect\ncompute  → report builder aggregates per-backend and per-fleet, computes deltas\nanalyze  → analysis client posts metrics JSON to a chat-completions endpoint\nrender   → html/template + chromedp produce a styled PDF\npublish  → slack uploader pushes the PDF to a target channel\n```\n\nThe agent is **stateless**: each run recomputes the previous window from\nVictoriaMetrics directly, no persistence layer.\n\n## Modes\n\n| Mode | Window | Comparison window |\n|---|---|---|\n| `--mode=weekly` | last 7 days | previous 7 days |\n| `--mode=monthly` | last 30 days | previous 30 days |\n\n## Required environment\n\n| Variable | Purpose |\n|---|---|\n| `VM_URL` | Base URL of your VictoriaMetrics select endpoint (cluster-internal Service) |\n| `NAN_API_KEY` | API key for the narrative LLM call |\n| `NAN_API_URL` | OpenAI-compatible chat-completions base URL (must end in `/v1`) |\n| `NAN_API_MODEL` | Model id used for the narrative, e.g. `deepseek-v4-flash` |\n| `SLACK_BOT_TOKEN` | Slack bot token with `files:write` (only required when not `--dry-run`) |\n| `SLACK_CHANNEL` | Channel ID (preferred) or name |\n| `BENCH_TEMPLATES_DIR` | Path to the HTML templates (`templates/` by default) |\n\n## Local run\n\n```bash\n# Port-forward your VictoriaMetrics vmselect to localhost\nkubectl -n \u003cmonitoring-namespace\u003e port-forward svc/\u003cvmselect-service\u003e 18481:8481 \u0026\n\nexport VM_URL=http://127.0.0.1:18481\nexport NAN_API_KEY=...\nexport NAN_API_URL=https://your.api.example/v1\nexport NAN_API_MODEL=deepseek-v4-flash\n\n# dry-run skips Slack upload and writes the PDF to disk\ngo run ./cmd/bench-agent --mode=weekly --dry-run --out /tmp/report.pdf\n\n# add --html to also dump the intermediate HTML for inspection\ngo run ./cmd/bench-agent --mode=weekly --dry-run --html --out /tmp/report.pdf\n\n# use --skip-llm to bypass the narrative entirely (debugging only)\ngo run ./cmd/bench-agent --mode=weekly --dry-run --skip-llm --out /tmp/report.pdf\n```\n\n## Deploy\n\nThe container image is published to `ghcr.io` by this repository's GitHub\nActions on every push that bumps `VERSION`. A separate Helm chart deploys it\nas a CronJob — see the operator's devops repository for the chart and the\nArgoCD Application.\n\n## How it discovers the cluster\n\nThe agent does **not** ship with hardcoded node names. On every run it\nqueries `vllm:num_requests_running` and reads the `job`, `node`, `model_name`\nand `instance` labels from the live metric series to enumerate the live\nbackends. Each backend is classified as `qwen3.6`, `gemma4`, `embedding` or\n`unknown` based on substring matching against `model_name`. The hardware-job\npairing is derived from the inference job's suffix (a job named\n`vllm-\u003csuffix\u003e` is paired with `nvidia_gpu-\u003csuffix\u003e`).\n\nAdding a new GPU backend requires no code change — once vmagent scrapes it,\nthe next benchmark picks it up automatically.\n\n## Repository layout\n\n```\ncmd/bench-agent/         entry point with CLI flags\ninternal/vmclient/       VictoriaMetrics PromQL client\ninternal/queries/        the catalogue of metric queries\ninternal/topology/       live auto-discovery + family classification\ninternal/report/         dataset builder with previous-window comparison\ninternal/analysis/       chat-completions client + few-shot examples + prompt\ninternal/render/         Go templates + chromedp for PDF generation\ninternal/slack/          Slack files.uploadV2 wrapper\ntemplates/               HTML/CSS for the PDF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelmcode%2Fnan-benchmarks-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelmcode%2Fnan-benchmarks-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelmcode%2Fnan-benchmarks-agent/lists"}