Skip to content

Latest commit

 

History

212 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Training Dashboard

A full-stack control plane for running, monitoring, and comparing ML training experiments locally or on Hugging Face Jobs.

Training Dashboard

What This Project Provides

  • A FastAPI backend for job orchestration, logs, trial indexing, and real-time websocket updates.
  • A SvelteKit frontend with dedicated pages for:
    • Home command center (job submission + quick status)
    • Live logs and job controls
    • Trial leaderboard
  • A run.ps1 execution bridge that supports both local execution and Hugging Face job submission.

Repository Structure

  • backend/: API service, orchestration logic, training script, and runtime output files.
  • frontend/: SvelteKit dashboard.
  • docs/: project notes, architecture flow, and implementation guidance.

Component documentation:

Prerequisites

  • Python 3.12+
  • Node.js 18+ and npm
  • PowerShell (pwsh recommended on Windows)
  • uv package manager for Python dependency sync
  • Optional for cloud jobs: Hugging Face CLI (hf)

Environment Configuration

Create a .env file in the repository root (recommended) using .env.example.

Required for Hugging Face flows:

  • HF_TOKEN: Hugging Face token.

Optional:

  • ANANA_RESULTS_REPO: Hugging Face dataset repository in owner/repo format, used by training sync logic.
  • VITE_API_BASE: frontend API base URL (default is http://localhost:8000).

Notes:

  • backend/run.ps1 reads .env from both backend/.env and the repository root .env.
  • The FastAPI app attempts to load .env files when python-dotenv is available.

Quick Start

1. Start Backend (FastAPI)

cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
uv sync
uv run uvicorn main:app --reload --port 8000

Backend health check:

Invoke-RestMethod http://127.0.0.1:8000/health

2. Start Frontend (SvelteKit)

cd frontend
npm install
npm run dev -- --port 5173

Open: http://localhost:5173

Runtime Output Locations

Generated runtime artifacts are stored under backend/.anana-results/:

  • configs/: generated JSON config payloads for started jobs.
  • logs/: per-job log files (<job_id>.log).
  • anana_v3/tune/: trial JSON outputs (trial_*.json) consumed by leaderboard endpoints.

Frontend Pages

  • /: Command Center + quick trial table + status footer.
  • /logs: live log monitoring, websocket spawner, stop controls.
  • /leaderboard: sorted trial leaderboard.

API Summary

Health and Status

  • GET /health: backend state, HF token availability, and active job count.

Job Lifecycle

  • POST /jobs/start: low-level job submission endpoint.
  • POST /api/jobs/start: UI-compatible form endpoint (maps form fields to CLI args).
  • GET /jobs: list tracked jobs.
  • GET /jobs/{job_id}: get one job.
  • POST /jobs/{job_id}/stop: request graceful stop/termination.

Logs and Streaming

  • GET /jobs/{job_id}/logs?since=<cursor>&limit=<n>: incremental log polling.
  • WS /ws/logs/{job_id}: live log stream for one tracked job.
  • WS /ws/train: spawn and stream a run command over websocket.

Trials and Sync

  • GET /trials: raw trial result listing.
  • GET /api/trials: flattened/sorted leaderboard rows.
  • WS /ws/trials: push notification when trial_*.json files change.
  • POST /api/sync: force pull/sync from Hugging Face results (when configured).

Running Jobs From PowerShell

From backend/:

# Local run
.\run.ps1 train.py --local -- tune --n-trials 5

# Hugging Face run
.\run.ps1 train.py --flavor a10g-small --timeout 3h -- tune --n-trials 10

Current Limitations

  • Job metadata is tracked in memory and cleared when backend restarts.
  • Runtime artifacts are local filesystem based (no database persistence layer).
  • Cloud execution behavior depends on external Hugging Face service/CLI availability.

Security Notes

  • Never commit real tokens to source control.
  • If a token is exposed, rotate it immediately in Hugging Face settings.
  • Keep .env out of version control and use .env.example as the template.

About

Lightweight control plane for running and observing training jobs (local or Hugging Face Jobs).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages