Lightweight benchmark collector + dashboard for Z.AI coding-plan inference performance.
script/: runs streaming benchmark prompts and writes results to MongoDB.dashboard/: Next.js UI for current KPIs and historical trends.script/MONGO.md: Mongo schema and query cheatsheet.
- Run collector
cd script
cp .env.example .env
pip install -r requirements.txt
python3 monitor_zai_inference.pyRequired env vars:
ZAI_API_KEYZAI_BASE_URL(default workflow useshttps://api.z.ai/api/coding/paas/v4)ZAI_MODELMONGODB_URI
- Run dashboard
cd dashboard
npm install
npm run devDashboard env:
MONGODB_URI- optional:
MONGO_DB(zaimonitor) - optional:
MONGO_COLLECTION(inference_runs)
GitHub Actions workflow (.github/workflows/zaimonitor.yml) runs every 40 minutes and collects:
glm-5glm-4.7glm-4.7-flash
Primary metrics:
ttft_msoutput_tokens_per_second_post_ttftprovider_output_tokens_per_second_end_to_endtokens.completion_tokens
See script/MONGO.md for full field details and queries.