neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
Minimal Vercel app that stores encrypted Codex and Claude auth snapshots, issues per-user access tokens by company email, and serves a dashboard plus source-aware auth-pool APIs for local quota guards.查看完整 README ↗Minimal Vercel app that stores encrypted Codex and Claude auth snapshots, issues per-user access tokens by company email, and serves a dashboard plus source-aware auth-pool APIs for local quota guards.
The Hub has an independent token-usage.html page for authenticated team members. It defaults to the previous seven days, hourly buckets, grouping by Hub user, the Codex provider, and the Total counter. Queries can filter by time, Hub user, provider (codex or claude), model account, and the raw provider model name, then group by Hub user, provider, model account, or model. Per-user totals are shown in Breakdown rather than a duplicate side panel. Every figure is also priced in dollars: Spend leads the summary cards, is its own Breakdown column, and can be selected as the metric, in which case it ranks the per-user bars and the table. The price list is lib/model-tiers.js, the same one the fetch gate spends, so a model the pool does not pay for — an own-key DeepSeek, a self-hosted Qwen or MiniMax — shows its real tokens and $0 of demand. The page uses only GET /api/token-usage-query and caches each exact query for five minutes per login session.
The Token Usage Trend is a same-scale line chart by the selected group; missing collection buckets remain visible gaps. Breakdown is browser-paginated in 20-row pages and does not issue another query when you change pages.
Every quota guard cycle also scans usage records with a 10-second budget. A new installation starts from a fixed 72-hour cutoff; later cycles read only new bytes after the last acknowledged file position. Codex cumulative token_count records are converted to positive deltas and copied history is deduplicated. Claude final assistant-message counters are updated by message ID. Automatic quota-guard switches use the recorded pre-write boundary; manual switches use the account observed at report time, so a small interval of manual-switch attribution error is intentional.
Counters retain provider meaning. Total is the provider-reported total. Input and Output are components. Cache Read, Cache Write, and Codex Reasoning are displayed as subsets and must not be added to Total. Claude Total includes input, output, cache read, and cache creation/write according to the provider record. Raw model names such as future GPT or Claude variants are stored and rendered without a fixed allowlist.
Privacy boundary: the collector uploads numeric quarter-hour aggregates only—Hub user is derived from authentication, with provider, model account, raw model, bucket, and six counters. It never uploads prompts, responses, project names, conversation titles, tool content, local paths, session IDs, message IDs, record fingerprints, or file positions. Local checkpoints live in ~/.agents/auth/token-usage.sqlite3 with owner-only permissions. Pending batches are retried idempotently; a rejected invalid batch advances once so it cannot loop forever.
POST /api/token-usage ingests a bounded idempotent batch. GET /api/token-usage-query returns totals, bounded trend points, bounded four-dimension breakdown rows, and per-Hub-user reporter state. Fifteen-minute detail is accepted and queryable for 90 days. The protected daily /api/cron/token-usage-retention job compacts at most seven old UTC days per run into daily rollups and removes old receipts. Token usage tables are not read by the Accounts dashboard, revision polling, or quota ingestion/history. Two paths do read them, both as one bounded bucket_start range scan: the fetch gate, which prices each requester's demand share, and the Users page, which shows each member's spend over that same window beside the 80th-percentile demand line.
Vercel Functions are pinned to pdx1, matching the Turso database's AWS us-west-2 location. This keeps database-backed requests in one region while static pages continue to use Vercel's CDN.
Token analytics reads never run schema migrations during a serverless cold start. Authentication lookup/touch is one database batch, followed by one bounded analytics batch.
Reference sizing from the approved design benchmark was 95 files and about 2.9 GB of history: a full parse took 44.97 seconds and about 54 MB peak memory. Normal scheduled work is substantially smaller because it resumes from byte positions and stops at the per-cycle budget.
The dashboard: one primary availability state per cloud auth entry, with quota and authentication evidence available on demand. Codex is judged on its weekly window plus the 5-hour window when its tier meters one (Plus and Team do, Pro does not); Claude requires both. (Accounts shown are anonymized demo data.)
Chinese operations guidance: README.zh-CN.md.
This project is built for people who regularly switch between multiple coding agents and multiple accounts, and need a shared place to see remaining quota without manually checking each machine.
The default shared hub URL for this project is:
That hub now requires a valid personal access token to read dashboard data. Publishing the repo does not expose the live hub data by itself.
Typical examples:
This repo also publishes the reusable quota-reporter skill.
Install it with:
npx skills add https://github.com/callzhang/quota-report-hub --skill quota-reporter --agent codex -g -y
Keep --agent codex in the command. The generic global install target includes PromptScript, and PromptScript does not support global skill installation.
Skill files live under:
skills/quota-reporter/SKILL.mdskills/quota-reporter/README.mdskills/quota-reporter/scripts/quota_guard.pyskills/quota-reporter/scripts/install_quota_guard.pyskills/quota-reporter/scripts/trigger_remote_probe.pyskills/quota-reporter/scripts/claude_statusline_probe.pyskills/quota-reporter/scripts/quota_reporters.pyskills/quota-reporter/archive/After install, teammates can either:
quota_guard.pyinstall_quota_guard.pyThere is also a desktop launcher created/kept by the guard itself for manual runs:
~/Desktop/刷新code账号.command~/Desktop/刷新code账号.lnkRun the static dashboard frontend on the fixed local port:
npm run dev
The startup script listens on 127.0.0.1:6088 by default. If port 6088 is already occupied, startup fails with an error instead of switching to another port. Set FRONTEND_PORT only when you intentionally want a different fixed port:
FRONTEND_PORT=7000 npm run dev
This script serves the static dashboard files only. Use the deployed hub or vercel dev when you need local API routes.
The intended end-to-end flow inside Codex is:
quota-reporter skill.https://quota-report-hub.vercel.app/ unless the user provides a different hub URL.scripts/deploy_vercel.py with:
allowed domainmailgun api keysending emailPOST /api/auth/issue-tokenPOST /api/auth/uploadPOST /api/auth/fetch-bestauth_pool_urlauth_pool_user_emailauth_pool_user_token
into ~/.agents/auth/quota-reporter.jsonquota-reporter skill code and updates the local installed skill when main has changed~/.agents/auth/known_auth.json/api/auth/fetch-best for a strictly better same-source auth and installs itImportant runtime notes:
https://github.com/callzhang/quota-report-hub before probing, unless --skip-self-update is passed for debugging~/.agents/auth/known_auth.json20% remaining in the 5H window, or less than 5% remaining in the 1week window, the machine asks the cloud auth pool for a better auth of that source; each rule applies only to a window the probe actually reported — Plus-tier Codex accounts still meter a 5H window, while Codex tiers without a 5-hour limit report none and rotate on 1week alone/api/auth/fetch-best includes:
sourceaccount_id5H remaining percent when the source still reports one1week remaining percentrequester_id such as user@hostname, so machines sharing the same hub token are still spread across different replacement auths20% remaining in 5H and at least 5% remaining in 1week; a Codex candidate without a 5H window is held to the 1week threshold onlyknown_auth.json records the same uploaded account_id, auth refresh time, and digest, the guard reuploads the current auth so a missing cloud entry can be restored automaticallyThe dashboard now reflects the cloud auth pool, not arbitrary client report rows:
AVAILABLE, LOW QUOTA, WAITING FOR NEW QUOTA, QUOTA UNKNOWN, or UNAVAILABLE; this is the answer to "can the pool use this account now?", not a restatement of the last probe resultAVAILABLE means the required source-specific quota windows are current and above the rotation thresholds; LOW QUOTA means current evidence exists but is below a thresholdWAITING FOR NEW QUOTA means the prior window reset and no post-reset snapshot has arrived; QUOTA UNKNOWN means current quota evidence is missing, stale, partial, from a failed probe, or a migrated auth has not yet recorded refresh capability; UNAVAILABLE means the credential itself is rejected, invalidated, explicitly AT-only and expired, or ineligible. The pool stores only a true/false/unknown capability marker, never the refresh token itself. Re-uploading an identical legacy auth repairs an unknown marker without replacing the credentialCaptured is when that individual quota window was observed; Reset is the provider's reset boundary for that window. A historical value must not be treated as current quota, even when the latest probe says okqrr. ticket issued by an authenticated full-status response. The ticket is scoped to revision metadata and cannot call the full dashboard or auth-pool APIs, so routine checks do not read or update API-token rows/api/status: it is fetched for one exact source + account_id only when that account's details open, is bounded to 24 hours and 96 points, and is cached in that browser login session for five minutes; concurrent opens reuse the same in-flight requestAuth pool support:
/api/auth/issue-token./api/auth/upload with an explicit source.defer_codex_refresh:true; the Hub stores that account as refresh_handoff_state=pending, strips the local RT after read-back, and blocks upload verification, worker probes, refresh_current, and id-token refresh until the handoff completes. A changed local RT/AT generation completes the previous account before the new account is uploaded; the new account remains pending until its own generation changes or a safe idle handoff is confirmed.scripts/probe_auth_pool_worker.mjs./api/auth/quota. For Codex, the server accepts a complete weekly window or a hard invalidation so missing legacy 5H data cannot poison the hub or block fresh quota. A complete client report can replace stale effective windows that were previously preserved from worker data.auth_last_refresh still matches the auth pool entry./api/status and /api/auth/fetch-best candidate selection read metadata only; they do not read encrypted auth JSON for every account.fetch-best keeps read volume bounded by reading only the requested source and by using compact current-state assignment tables. It does not scan the full fetch log or quota event history to calculate active machine/account load.auth_pool_user_fetch_stats, which is updated when fetch events are written, instead of counting the full fetch audit log on each page load./api/status after unlock, then polls only /api/status-revision once per minute while visible. Hidden tabs do not poll, and unchanged revisions avoid full-status database reads.The installer is reboot-safe and runs every 15 minutes:
launchd with RunAtLoadcrontab with both @reboot and */15 * * * * entriesAtStartup trigger plus a 15-minute repeating triggerThe installer also performs a post-install verification by default:
launchd, crontab, or Task Schedulerquota_guard.py --skip-self-update --no-toast once immediately~/.agents/auth/quota-guard.log and ~/.agents/auth/quota-guard.error.log and fix the local environment before considering setup completeGET /api/status
dashboard_revision, and a scoped revision ticketGET /api/status-revision
qrr. revision ticket returned by /api/statusGET /api/quota-history?source=<source>&account_id=<account-id>
Probe answers whether the most recent attempt to contact the provider succeeded. Quota answers whether the hub has a complete, fresh quota snapshot whose reset time is still in the future. They are different evidence.
For example, a probe can be ok while availability is QUOTA UNKNOWN when the successful response did not include every required quota window, or when the report is older than the one-hour freshness boundary. It can be WAITING FOR NEW QUOTA when the last known window has reset but no new snapshot has arrived. Open the availability details and compare the exact probe time, each window's Captured time, and its Reset time. Do not diagnose this as a login failure unless the primary state is UNAVAILABLE and the detail identifies rejected or invalidated authentication.
AUTH_POOL_ENCRYPTION_KEYMAILGUN_API_KEYMAILGUN_DOMAINMAILGUN_FROMCRON_SECRETGITHUB_WORKFLOW_DISPATCH_TOKENTURSO_DATABASE_URLTURSO_AUTH_TOKENTIGRIS_STORAGE_ACCESS_KEY_IDTIGRIS_STORAGE_SECRET_ACCESS_KEYTIGRIS_STORAGE_BUCKETAUTH_POOL_ENCRYPTION_KEY must be either:
The Tigris variables are read automatically by @tigrisdata/storage. They are required for production auth-pool uploads if auth JSON should stay out of Turso read paths.
Use scripts/migrate_auth_blobs_to_object_storage.mjs to move existing inline encrypted auth payloads out of Turso rows and into object storage.
Modes:
scan: prepares schema and counts rows that still have inline encrypted auth payloads. It does not write objects or update rows.write-only: writes each encrypted payload envelope to object storage and reads it back for verification. It does not update rows.apply: writes and verifies each object, writes a JSONL backup of the encrypted envelopes, then clears the inline columns and stores auth_blob_key.Local rehearsal:
cp database-beige-bell.db /tmp/database-beige-bell-auth-blob-migration.db
AUTH_BLOB_STORAGE_DIR=/tmp/quota-auth-blob-local-test \
node scripts/migrate_auth_blobs_to_object_storage.mjs \
--db /tmp/database-beige-bell-auth-blob-migration.db \
--mode scan \
--limit 100
AUTH_BLOB_STORAGE_DIR=/tmp/quota-auth-blob-local-test \
node scripts/migrate_auth_blobs_to_object_storage.mjs \
--db /tmp/database-beige-bell-auth-blob-migration.db \
--mode write-only \
--limit 100
AUTH_BLOB_STORAGE_DIR=/tmp/quota-auth-blob-local-test \
node scripts/migrate_auth_blobs_to_object_storage.mjs \
--db /tmp/database-beige-bell-auth-blob-migration.db \
--mode apply \
--limit 100 \
--backup-path /tmp/quota-auth-blob-local-backup.jsonl
Remote execution:
node scripts/migrate_auth_blobs_to_object_storage.mjs --remote --mode scan --limit 10
node scripts/migrate_auth_blobs_to_object_storage.mjs --remote --mode write-only --limit 10
node scripts/migrate_auth_blobs_to_object_storage.mjs --remote --mode apply --limit 10 --backup-path /tmp/quota-auth-blob-remote-backup.jsonl
node scripts/migrate_auth_blobs_to_object_storage.mjs --remote --mode apply --limit 1000 --backup-path /tmp/quota-auth-blob-remote-backup.jsonl
Before remote apply, confirm these variables are available to the process:
TURSO_DATABASE_URLTURSO_AUTH_TOKENTIGRIS_STORAGE_ACCESS_KEY_IDTIGRIS_STORAGE_SECRET_ACCESS_KEYTIGRIS_STORAGE_BUCKETBefore remote rows are migrated, also configure the same three Tigris values as GitHub Actions secrets, because the scheduled probe worker reads object-backed auth rows.
Use the included deploy script to configure the auth-pool email settings on Vercel and trigger a production deploy:
python3 scripts/deploy_vercel.py \
--allowed-domain stardust.ai \
--mailgun-api-key YOUR_MAILGUN_API_KEY \
--sending-email [email protected]
What it does:
AUTH_ALLOWED_EMAIL_DOMAINMAILGUN_API_KEYMAILGUN_DOMAIN from the sending email domainMAILGUN_FROMAUTH_POOL_ENCRYPTION_KEY only if one does not already existproduction, preview, and developmentvercel deploy --prod --yesImportant:
AUTH_POOL_ENCRYPTION_KEY by default, because rotating it would make previously encrypted auth-pool rows unreadable--rotate-auth-pool-key only when you intentionally want to invalidate existing encrypted auth-pool entries--skip-deploy if you only want to update Vercel env values without deploying immediatelyThe hosted hub uses GitHub Actions for the Codex and Claude server probe loop, because the worker needs CLI tooling that does not belong in a Vercel function. Vercel Hobby projects cannot run 15-minute cron jobs, and GitHub scheduled workflows can start hours late, so the scheduled GitHub workflow starts once per hour and runs twelve probe cycles in the same runner, with a 12-minute wait between cycles. That keeps dashboard rows fresh without relying on high-frequency platform cron.
.github/workflows/probe-auth-pool.yml7, PROBE_CYCLES=12, PROBE_INTERVAL_SECONDS=720TURSO_DATABASE_URLTURSO_AUTH_TOKENAUTH_POOL_ENCRYPTION_KEY/api/cron/probe-auth-poolCRON_SECRETGITHUB_WORKFLOW_DISPATCH_TOKENGITHUB_WORKFLOW_DISPATCH_REPO, GITHUB_WORKFLOW_DISPATCH_WORKFLOW, GITHUB_WORKFLOW_DISPATCH_REF, AUTH_POOL_PROBE_MIN_INTERVAL_SECONDSpython3 skills/quota-reporter/scripts/install_quota_guard.py \
--email [email protected]
If you want to use a different hub URL, pass --auth-pool-url. The default is https://quota-report-hub.vercel.app/.
The installer emails a personal token to [email protected] and prompts you to paste it locally.
The installer validates behavior immediately. It verifies scheduler registration and runs one guard cycle before it exits successfully.
python3 skills/quota-reporter/scripts/quota_guard.py
By default this prints a compact human-readable summary. Use --json only when you need the full probe, sync, replacement, notification, and timing payload:
python3 skills/quota-reporter/scripts/quota_guard.py --json
You can still run one local check manually after login changes:
python3 skills/quota-reporter/scripts/quota_guard.py
known_auth.json0% snapshot from structured reset metadata before posting to the hubsource + current account + current quota to /api/auth/fetch-bestrepair_auth before considering any healthy shared replacement; the local guard installs the handback once, marks it repair_auth_from_auth_pool, and holds it stable at owner_relogin_required until an explicit login changes the credential digest. While repair is pending it is neither re-uploaded nor replaced, so its expected 401 cannot start an account-switch looprepair_auth return is also written to the audit log as repair_auth_returned and appears in the Users & Audit pagepython3 skills/quota-reporter/scripts/trigger_remote_probe.py
npm install
npm test
uploader_email records the Hub account authenticated on the most recent client upload. Re-uploading an account moves subsequent re-login notifications and “my uploaded auth” behavior to that latest uploader; internal worker refreshes retain the last client uploader.~/.agents/auth/quota-reporter.json should stay private because it contains the user's personal auth-pool token.codex app-server daemon restart or, only after an unmanaged-daemon refusal, sends SIGTERM to that exact listener PID and confirms it exited. Missing or ambiguous PID identity is fail-closed; it never stops an active or unknown app-server and never launches codex login./api/status returns 401 and the page stays locked./api/status cannot read the backing database, it returns 503 with hub_unavailable; when the reason is database_reads_blocked, the token is not rejected and the Turso plan/quota must be restored before the dashboard can unlock.401 with token_invalidated. The local guard requests a new token email once for that invalid local token, then waits for the user to paste the latest token.qrp_... tokens cannot be upgraded in-band because they do not carry a verifiable email; request a fresh token by email once on that machine.skills/quota-reporter/archive/login.html reuses that session instead of asking the user to log in again401 response shows the login panelverified, rejected, or not tested; uploads carrying a real RT perform an immediate refresh verification and persist the rotated credential, while AT-only uploads remain unverifiedauth_expires_at, the dashboard treats that expiry as stale metadata and keeps the fresh quota visible100% quota just because an old reset time passedready nowauth_blob_keyauth_pool_quota_events before the latest row is updated or an unusable auth is removed, so audit views can be reconstructed from Turso instead of GitHub Actions logs. The continuous invalidation window is maintained in auth_pool_invalidated_notifications as current state, so quota ingestion does not rescan event history.missing quota details probe failures are recorded as quota errors but do not delete the auth entry, because the saved refresh token may still be valid and should be available for later central refresh or a successful probe.auth failed (401 unauthorized) worker probes, because repeated 401 means the saved token cannot be reused by the pool./api/status every run and warns about managed auths uploaded by the current token user only after the cloud worker confirms refresh_token_rejected. If auto_relogin_owner_auth is enabled, it opens the matching local CLI login for that confirmed RT-rejected source; sources disabled with manage_<source>_auth: false, ordinary auth probe errors, and stale quota snapshots do not launch login.claude -p /usage against the restored CLI state and parsing the windows it prints. No inference turn is spent and no session is registered on the pooled account. The previous approach — driving the interactive UI and scraping its statusline snapshot — is kept as plan B behind --mode tui.ANTHROPIC_* credentials through ~/.claude/settings.json are skipped because their active provider is not the worker's official Claude login path.--mode tui) uses a short statusline refresh interval during probing so the snapshot is emitted before the worker timeout expires; the default usage-mode probe needs no snapshot at all./api/auth/fetch-best, but it must send the same explicit source./api/status also requires the same personal bearer token.5H and 1week together; a Codex account without a 5H window is judged on 1week alone, and Codex ties break weekly-first.source + account_id and records the authenticated Hub account from the latest client upload in uploader_email. A newer auth_last_refresh replaces the stored auth; an identical auth still updates changed uploader/machine metadata without replacing the encrypted credential.