Skip to main content
You give the pipeline the key of a video in your S3 bucket. It transcribes the speech, has an OpenAI model choose chapters and the moments worth sharing, and cuts each one into an MP4 clip with a thumbnail. The run returns a manifest of share links and posts a signed callback to your app when it finishes.

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 my-video-bucket replaced by yours:
Put the bucket’s name and region in 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 CALLBACK_URL in settings.py to the printed URL followed by /video-highlights, or leave it None to skip callbacks, then deploy the pipeline:
The GPU image takes longest, since it downloads about 1.6 GB of Whisper weights.
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
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 a callback_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_SECONDS and MAX_CLIP_SECONDS in highlights.py set the clip count and length limits; INSTRUCTIONS in llm.py decides what counts as a highlight.
  • WHISPER_MODEL in pipeline.py picks the transcription model, and CloudBucketConfig takes an endpoint for another S3-compatible store.
  • A schedule that lists new keys under a prefix and spawns highlight_video for each one turns the pipeline into a drop folder.

Clean up

Clips, thumbnails and manifests expire with your plan’s retention. 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.