Add /jobs page (CI-style UI) + /community v0 stub

#1
by ArthurZ HF Staff - opened
SlyFox org

What this adds

A second route on the Space — /jobs — exposes two operations powered by HfApi.run_uv_job:

  • Request a new model: extracts emotion direction vectors for a target HF model via AidanZach/EmotionScope, writes them to hf://buckets/HF-slyfox/emotion-vectors/<model_id>/.
  • Analyze traces: replays N session jsonls through a model, projects each turn's residual stream onto the emotion vectors, writes per-session parquet to <source>/trace-analysis/<run_id>/.

UI is GitHub-Actions-style: colored status dots (queued/running/success/failed), live elapsed time, click-to-expand log viewer with 3 s refresh on expanded rows, 5 s poll on the list, cancel button while a job is running.

Existing /api/chats/* routes are unchanged.

Community v0

  • /community page placeholder + /api/community/runs stub reading from HF-slyfox/community-index/runs/*.json. Empty until the publish-side flow in hf upload-traces --share community lands.
  • COMMUNITY.md design doc: consent tiers (private / org / community / training), phased rollout (catalog → remix → leaderboard → training-export → org governance).

API surface

POST /api/models/extract            { model_id, flavor? }
POST /api/analyses                  { source, prefix?, n_traces, model_id, flavor? }
GET  /api/jobs                      list slyfox-submitted jobs + live status
GET  /api/jobs/{job_id}             one job's record + live status
GET  /api/jobs/{job_id}/logs        tail of stdout/stderr
POST /api/jobs/{job_id}/cancel      cancel
GET  /api/community/runs            opt-in public catalog
GET  /jobs                          serves jobs.html
GET  /community                     serves community.html

New files

  • jobs.html — CI-style jobs UI (428 lines, vanilla JS, no deps)
  • community.html — v0 catalog placeholder
  • COMMUNITY.md — design doc

UV scripts referenced via raw GitHub URL live in huggingface/slyfox on the arthur-work branch under jobs_scripts/.

Notes

  1. Reads SLYFOX_JOBS_REF from env (defaults to arthur-work since slyfox main is not yet promoted). Switch to main once Arthur pushes.
  2. huggingface_hub>=1.7 already in requirements; jobs API is on HfApi directly so no new deps.
stevhliu changed pull request status to open
stevhliu changed pull request status to merged

Sign up or log in to comment