How it fits together
The bucket mounts read-only with keys held in two secrets, and a workspace in
a connected AWS account reads a
bucket in the same region without leaving it. The volume keeps each video’s
transcript. Every function scales to zero between runs, and the GPU bills
only for transcription.
Run it
1
Download
The CLI installs once with
uv tool install lazycloud-client. The commands
below download a standalone project and install its dependencies; no
repository checkout is needed. The guide then runs from that directory through
uv run, which uses the project’s pinned SDK.2
Configure
Create an IAM user with a policy that can only list and read the bucket,
with Put the bucket’s name and region in
my-video-bucket replaced by yours:video_highlights/settings.py
(BUCKET_NAME, BUCKET_REGION), then store that user’s key pair and an
OpenAI API key as secrets. The script also creates the workspace’s
callback signing key if there is none yet.3
Deploy
Deploy the receiver first to get its URL:Set The GPU image takes longest, since it downloads about 1.6 GB of Whisper
weights.
CALLBACK_URL in settings.py to the printed URL followed by
/video-highlights, or leave it None to skip callbacks, then deploy the
pipeline:4
Use
--json sends the arguments as JSON, so the result and the callback both
carry the manifest. A rerun of the same video reuses the saved transcript
and skips the GPU. The receiver’s log shows each verified callback:A bucket mount and a volume
A cloud bucket mounts like a volume, here read-only so no step can change your source files, and a volume keeps the transcripts between runs.video_highlights/pipeline.py
A coordinator with a callback
A function can call other deployed functions with.remote() and fan out with .map; preemptible=False keeps a reclaimed
machine from running the steps twice, and callback_url names where the
result goes.
video_highlights/pipeline.py
Share links as artifacts
An artifact saved on the current task returns a link anyone can open, for seven days at most.video_highlights/pipeline.py
A signed callback
When a run with acallback_url is retried or ends, LazyCloud POSTs a JSON
event signed with the workspace’s
LAZYCLOUD_CALLBACK_SIGNING_KEY, retried up to three times with an
Idempotency-Key header.
video_highlights/receiver.py
Adapt it
MAX_HIGHLIGHTS,MIN_CLIP_SECONDSandMAX_CLIP_SECONDSinhighlights.pyset the clip count and length limits;INSTRUCTIONSinllm.pydecides what counts as a highlight.WHISPER_MODELinpipeline.pypicks the transcription model, andCloudBucketConfigtakes anendpointfor another S3-compatible store.- A schedule that lists new keys under a prefix and spawns
highlight_videofor each one turns the pipeline into a drop folder.
Clean up
uv run lazycloud artifact list and artifact delete remove them sooner.
Your bucket and its videos are unchanged, since the pipeline mounts it
read-only.