@lvrged/video-factory
GPU infrastructure control for Pi: provision, deploy, run, monitor, and destroy GPU workloads on RunPod, Vast.ai, SaladCloud, Modal, Lambda, and Prime — with H3/Wan/Hunyuan video generation as the first-class workload. First-run onboarding, spend policy,
Package details
Install @lvrged/video-factory from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@lvrged/video-factory- Package
@lvrged/video-factory- Version
0.2.0- Published
- Aug 12, 2026
- Downloads
- 359/mo · 19/wk
- Author
- frontier-operators
- License
- MIT
- Types
- extension, skill
- Size
- 152.1 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"name": "video-factory",
"description": "Agent-operable GPU cloud: deploy video models (H3, Wan, Hunyuan, Seedance) and run generation workloads on whatever GPU provider you have access to.",
"extensions": [
"./extension/index.ts"
],
"skills": [
"./skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
video-factory
GPU infrastructure control for Pi. Install one package and your agent can provision, deploy, run, monitor, and destroy GPU workloads on whatever cloud infrastructure you have access to — with video generation (MiniMax H3, Wan 2.2, HunyuanVideo, Seedance) as the first-class workload.
pi install npm:@lvrged/video-factory
Then, inside Pi:
I need HunyuanVideo running on a GPU. Find the cheapest suitable provider, deploy it, expose an endpoint, test it, and make it available to me as a tool.
The agent figures out the rest — from docs/pricing/ for provider comparison,
from the skills for the how-to, and from the ledger for cost control.
What you get
gpu_*tools — the normalized agent interface:gpu_setup,gpu_status,gpu_ensure,gpu_provision,gpu_register,gpu_run,gpu_job_finish,gpu_jobs,gpu_spend,gpu_destroy,gpu_model_add,gpu_workflow_add,gpu_policy./gpucommands — the human dashboard: setup, status, deploy, jobs, spend, stop, policy.- Skills — the knowledge:
gpu-setup,gpu-ops,comfyui,model-deployment,video-models,provider-adapters. - Docs — pricing snapshots for RunPod, Vast.ai, Modal, Lambda, Prime
(
docs/pricing/) and per-provider playbooks (docs/providers/). - A persistent registry + job ledger in
<project>/.pi/gpu/— the agent restarts tomorrow and still knows H3 is deployed, what it costs, and which workflow version made which video.
Quickstart
- First run = onboarding. The extension greets you with
/gpu onboard— the H3 production economics (Turbo 4-8 step workflow, provider lanes, cost per finished minute) and the first-deployment flow. Or just say: "set me up to make H3 videos cheaply" — the agent runs thegpu-onboardingskill. /gpu setup(or ask the agent to rungpu_setup) — detects provider CLIs, installs missing ones with your permission, checks auth.- Ask for a model: "deploy h3 on the cheapest provider" — the agent runs
gpu_ensure, searches live prices, provisions, installs ComfyUI + weights (with the optimized Turbo/Sage/INT8 workflow), health-checks with a test generation, and registers the deployment. - Generate: "run h3-image-to-video on slide-042.png with 'slow push-in',
5 seconds" —
gpu_runopens a ledger entry; artifacts sync off the pod before shutdown. - "How much did the last 100 videos cost?" —
gpu_spendanswers from the ledger. "Regenerate everything from workflow v3" —gpu_jobsfinds them.
Provider coverage
| Provider | Interface | Kind | Notes |
|---|---|---|---|
| RunPod | runpodctl + API |
managed instances | community (cheap) / secure pools, templates |
| Vast.ai | vastai |
marketplace | cheapest lane; search live before every deploy |
| SaladCloud | REST API | containers on distributed GPUs | batch pricing — the economic outlier; bring your own image |
| Modal | modal |
serverless | zero idle cost, cold starts |
| Lambda | REST API | premium on-demand | no egress fees; clusters need commitment |
| Prime | prime |
decentralized marketplace | dynamic pricing, spot, parallel bids |
New providers don't need a new release: if its CLI is agent-friendly, the provider-adapters skill teaches the agent how to operate it.
Using the same skills with Claude Code (no Pi)
The repo ships a parallel skill set in claude-skills/ for people who don't
run Pi — same knowledge, adapted to bash-only operation (no gpu_* tools),
sharing the same .pi/gpu JSON registry so Pi and Claude users can operate
identical infrastructure:
cp -r claude-skills/* /path/to/your/project/.claude/skills/
Claude Code picks them up automatically (gpu-setup, gpu-onboarding, gpu-ops, comfyui, model-deployment, video-models, provider-adapters). The onboarding skill walks a new Claude user through the same H3 economics card.
Architecture
See docs/ARCHITECTURE.md (the core abstraction is the deployment, not the
provider) and docs/REGISTRY.md (state file schemas).
Pi Agent
│
video-factory extension
│
provider capability tables
┌──────────┼──────────┬──────────┐
│ │ │ │
RunPod Vast.ai Modal Lambda/Prime
│ │ │ │
CLI/API CLI/API CLI API
The spend policy (read this)
Extensions run arbitrary code — this one executes provider CLIs and spends
real money. The trust boundary is .pi/gpu/policy.json:
{ "ceiling_per_job_usd": 5, "ceiling_daily_usd": 40, "ceiling_monthly_usd": 400, "confirm_above_usd": 1, "idle_shutdown_after_min": 30 }
Provisioning above confirm_above_usd always asks you in the UI, and ceilings
cap what the agent may do without checking in. Adjust with gpu_policy or
/gpu policy. Review this package's source before installing — it's yours.
Development
npm install # dev deps (typescript, pi types)
npx tsc --noEmit # typecheck
pi -e . # load the extension from this dir in a scratch session
License
MIT