Go to file
MODELBEAST 810400fb60 Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot
Phase 1 — multi-user auth:
- server/auth.py: bcrypt passwords, itsdangerous signed-cookie sessions, sha256
  bearer tokens, FastAPI current_user/require_owner deps, login rate limit
- users + api_tokens tables + jobs/assets.user_id (additive migrations)
- HARD RULE enforced server-side: guests are local-only — /api/operators filters
  out requires_env operators, POST /api/jobs 403s cloud ops for non-owners (proven
  via direct POST in smoke.sh, not just UI). Settings owner-only. auth_secret
  hidden from the settings API. Per-user active-job cap (owner exempt). Own-asset/
  own-job checks. WS auth via cookie or ?token=. Owner bootstrap prints pw once.
- mb-ready: bearer MB_TOKEN; scripts/users.py for out-of-band management
- Frontend: Login gate, header user chip + logout, guest note, username on jobs,
  Users panel in Settings (owner)

Phase 2 — dashboard:
- server/sysinfo.py: psutil CPU/RAM/disk + macmon Apple GPU (util/power/temp, no
  sudo), computed lane occupancy, 24h job summary, recent jobs w/ output thumbs;
  all cached (5s stats, 5min du). /api/system + /api/jobs/recent.
- Dashboard.jsx: snapshot-on-refresh (no polling) — stat cards, per-core strip,
  lane strip, running/queued, recent grid.

tests/smoke.sh rewritten for auth: 28 checks passing incl. all guest-security
rules. Browser-verified owner + guest + dashboard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 12:06:52 +10:00
.claude Phase 0 baseline: FastAPI+SQLite operator pipeline, React/three.js UI, ffprobe/ffmpeg_frames/blender_convert operators 2026-07-12 21:05:22 +10:00
docs docs: CUDA worker — add Win11 + WSL2 path (recommended, no reinstall) 2026-07-13 11:01:36 +10:00
scripts Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00
server Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00
tests Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00
web Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00
.gitignore Phase 1 + framework: settings/secrets, queue lanes, job mgmt, inbox, 8 new operators 2026-07-12 21:42:27 +10:00
AGENTS.md AGENTS.md: real fal prices from owner billing (trellis2 $0.05, hunyuan mv $0.017); fal+openrouter keys set 2026-07-13 09:50:02 +10:00
BENCHMARKS.md BENCHMARKS: TRELLIS.2 local working — 289s/~4.8min gen, SOTA quality 2026-07-13 10:23:37 +10:00
HANDOFF2.md HANDOFF2: execution brief — multi-user auth (guests local-only), dashboard, VPS hosting 2026-07-13 11:10:27 +10:00
HANDOFF.md fal panel: 5 new operators, image outputs, grouped UI, no-input ops + review fixes 2026-07-12 21:51:16 +10:00
mb Headless control: mb CLI, AGENTS.md handover, serve scripts; verified-current image models 2026-07-12 22:38:52 +10:00
PLAN.md Phase 0 baseline: FastAPI+SQLite operator pipeline, React/three.js UI, ffprobe/ffmpeg_frames/blender_convert operators 2026-07-12 21:05:22 +10:00
pyproject.toml Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00
README.md Headless control: mb CLI, AGENTS.md handover, serve scripts; verified-current image models 2026-07-12 22:38:52 +10:00
uv.lock Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00

MODELBEAST

Local-first web app that turns videos, images, and 3D files into meshes, splats, mocap, and rigged characters on the M3 Ultra. See PLAN.md for the full verified tool matrix and roadmap, and HANDOFF.md for the agent build brief (phases 14 instructions).

Run

/opt/homebrew/bin/uv run uvicorn server.main:app --host 0.0.0.0 --port 8777

Open http://localhost:8777 (or http://<tailscale-ip>:8777 from any device on the tailnet).

Drag/drop/paste any video, image, or 3D file; or drop files into data/inbox/ for auto-ingest. Pick an operator, tune its parameters, run. Add API keys / HuggingFace token under ⚙ Settings. Use ⊞ Compare to view several outputs side by side.

Headless / agents

Everything is driveable without the UI via the zero-dependency mb CLI (works from any tailnet machine with MB_HOST=http://100.89.131.57:8777) or raw REST. AGENTS.md is the complete handover brief — endpoints, mb reference, operator catalog, recipes, job semantics, etiquette. Server ops: scripts/serve.sh (start/restart headless), scripts/install_launchagent.sh (optional boot persistence, owner-run).

./mb run fal_trellis2 --file photo.jpg -p resolution=1024 --wait --download out/

Develop

  • Backend: server/ — FastAPI + SQLite (data/modelbeast.db), job runner runs operators as subprocesses across concurrency lanes (gpu=1, cpu=3, net=6). Settings/secrets in server/settings.py (env-injected, log-redacted).
  • Frontend: web/ — React + Vite + three.js + @mkkellogg/gaussian-splats-3d. After editing: cd web && npm run build (the server serves web/dist).
  • Data: data/assets/ (store), data/jobs/ (job workdirs), data/inbox/ (watch folder). Delete data/ to reset. Tests use MODELBEAST_DATA=<tmp>.
  • Tests: ./tests/smoke.sh (12 framework checks). Benchmarks in BENCHMARKS.md.
  • Heavy tools live in vendor/ (repos) + venvs/ (per-tool envs), both gitignored. Reinstall with scripts/install_*.sh.

Setup for the local mesh generators (one-time)

sf3d and trellis_mac are installed but their weights are HuggingFace-gated. Accept the licenses (stabilityai/stable-fast-3d, facebook/dinov3-vitl16-pretrain-lvd1689m, briaai/RMBG-2.0), then huggingface-cli login or paste an HF token in Settings. Cloud fal_* operators need FAL_KEY in Settings.

Operators

Each subfolder of server/operators/ with a manifest.json is an operator. The UI auto-renders its parameter form from params_schema (JSON Schema) and filters by the selected asset's kind (accepts).

Contract: the runner invokes <python> run.py --input <asset> --outdir <jobdir> --params '<json>'. Write outputs into the outdir; optionally write result.json ({"outputs": [{"path": ..., "name": ..., "meta": ...}]}) to control what gets registered as assets. stdout/stderr become the job log.

Manifest fields: id, name, category, description, accepts, produces, resources (gpu/cpu/net lane), requires_env (gates the operator until the key is set), python (absolute venv path for heavy tools), params_schema. Operators can tag output asset kind via result.json output meta.kind (e.g. splat, colmap_dataset).

Current operators:

id lane what
ffprobe cpu media inspection
ffmpeg_frames cpu video → frames (fps, mpdecimate dedupe, blur cull, max cap)
blender_convert cpu universal 3D format conversion via headless Blender
colmap_poses cpu frames → camera poses + sparse cloud (COLMAP 4.x + GLOMAP)
brush_train gpu colmap dataset → 3D gaussian splat (Brush, native Metal)
sf3d gpu image → GLB locally (Stable-Fast-3D, MPS) [HF-gated]
trellis_mac gpu image → GLB+PBR locally (TRELLIS.2 MPS port) [HF-gated]
fal_trellis / fal_trellis2 / fal_hunyuan3d / fal_hunyuan3d_v21 / fal_rodin net image → mesh via fal.ai API [needs FAL_KEY]
fal_bg_remove net image → subject cutout (BiRefNet v2) — run before any image→3D for a big quality jump
fal_upscale net image → faithful upscale (SeedVR)
fal_image_edit net image + instruction → edited image (nano-banana)
fal_text_image net prompt → image (Ideogram v3, readable text) — no input asset needed

Recommended fal chain for best image→3D: fal_bg_remove → (fal_upscale if thin) → fal_trellis2 or fal_hunyuan3d_v21. Note: Hunyuan v21 multi-view is broken on fal (verified 2026-07) — v21 is single-image only; use v2 for multi-view.

Heavy operators get their own uv venv ("python": "<abs venv path>" in the manifest). Remaining roadmap (object_capture, freemocap, retargeting, tripo/meshy character APIs, workflow presets, LLM copilot) is in HANDOFF.md §58.