Skip to content

Live Runner - #3938

Merged
j0sh merged 124 commits into
masterfrom
ja/live-runner
Jul 22, 2026
Merged

Live Runner#3938
j0sh merged 124 commits into
masterfrom
ja/live-runner

Conversation

@j0sh

@j0sh j0sh commented May 21, 2026

Copy link
Copy Markdown
Collaborator

This introduces LiveRunner as a way to run live AI applications behind a Livepeer orchestrator.

LiveRunner lets an orchestrator manage external runner processes for live AI workloads. A runner registers with the orchestrator, advertises its app, version, GPU, capacity, mode, and pricing metadata, and receives session traffic through orchestrator-proxied URLs. The runner’s internal URL is not exposed through discovery.

The orchestrator acts as the control plane for these runners. It tracks runner health and capacity, reserves and releases sessions, proxies client requests, forwards session credentials, and manages session-scoped trickle channels. Runners can be registered dynamically through heartbeats or configured statically from JSON.

The branch supports both persistent sessions and single-shot runner modes. Persistent sessions stay active until stopped, expired, released by health checks, or ended by payment failure. Single-shot runners reserve capacity for a single proxied request and release it when the request completes.

LiveRunner also adds the supporting discovery, payment, and trickle plumbing. Orchestrators expose runner metadata through /discovery, remote signer discovery can merge and filter runner entries, and on-chain sessions can use payment challenges with recurring accounting. Trickle changes add explicit channel creation, publisher reset handling, sequence metadata, and improved buffering for live stream fanout.

It also adds a Scope-specific serverless endpoint. /scope starts a live-video-to-video Scope session using control and events trickle channels, with support for serverless WebSocket workers, payment challenges when running on-chain, and a smaller request body surface tailored to Scope startup parameters.

Summary by CodeRabbit

  • New Features
    • Added live-runner orchestration: heartbeat, session reserve/release, discovery, and per-session trickle channel create/delete (persistent or single-shot routing), plus POST /registerLiveRunners for static registration.
    • Introduced serverless live-video-to-video worker mode and a new /scope streaming endpoint.
    • Added BYOC job signing and payment refresh API support.
  • Bug Fixes
    • Improved orchestrator discovery caching/merging and tightened on-chain vs off-chain pricing validation.
    • Enhanced Trickle stream behavior (reset/unblock handling, lifecycle hooks, and segment buffering).
  • Documentation
    • Updated remote-signer and Trickle protocol docs.
  • Tests
    • Added extensive coverage for live-runner, serverless worker, discovery, and segment buffering.

Max Holland and others added 30 commits April 1, 2026 18:15
* Don't create pub / sub trickle channels up front since those are
  now created on demand

* Listen to the events channel for payments instead of pub channel
If a client needs to start publishing again and doesn't know where
it left off, then it can add a Lp-Trickle-Reset header along with
the -1 seq ("write next empty segment") which is already supported.

This will unblock any subscribers that may be waiting for hanging
writes from the previous publisher.

Also add a Lp-Trickle-Seq header so publishers can correctly position
their next segment in the stream.

Fix a bookkeeping bug in the LocalPublisher, and add tests.
Optionally add an auth callback to remote payment requests so operators
can enforce policy checks before the remote signer sends down payments.

When configured, the handler POSTs a JSON body containing the incoming
request headers and the current signer state to the webhook URL right
before encoding and signing. Configured auth headers are attached to the
outbound request. Non-200 responses are propagated back to the caller
through the existing API error envelope, preserving the upstream status
code.

New CLI flags:
  -remoteSignerWebhookUrl       Webhook endpoint to call
  -remoteSignerWebhookHeaders   Outbound auth headers (key:val,key2:val2)

Omit -remoteSignerWebhookUrl to keep the existing behavior unchanged.
Allow the auth webhook to return an `expiry` field (Unix seconds) in
its 200 response. The value is persisted in the signer's state and
checked on subsequent requests. If the expiry hasn't yet passed, the
webhook call is skipped. Once expired (or absent), auth resumes.
The runner only has the full URL and uses those when deleting streams.
The ja/serverless branch removed the /sign-byoc-job endpoint, breaking
all BYOC inference (SDK gets 404 from signer, then BYOC orch rejects
with "Could not verify job creds"). This restores the signing endpoint
while preserving all new ja/serverless features (Daydream billing
webhook auth, cached AuthExpiry, etc.).

Cherry-picked from feat/remote-signer-byoc-v2:
- SignBYOCJobRequest handler + route registration in remote_signer.go
- BYOCJobSigningInput type + FlattenBYOCJob function in byoc/types.go

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@j0sh

j0sh commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Closing the loop on a few things @rickstaa @ad-astra-video

The trickle and maybe the scope items could be peeled off into separate PRs

#3990
#3989

A doc detailing the routes added and the payloads expected would help a lot.

fe6c786

Publish general (non-capability) apps on signer discovery

0cff1bd

max-price control for them

I'm not sure how to do this in a general way without needing to configure the signer with every app on the network which doesn't seem practical. We can discuss after merge.

Add a metadata field to discovery

ca09ddf

Authorize before generating payment

#3958 (comment)

Harden payment error handling

#3982 (comment)

session_duration logging on release

32c2352

@rickstaa

rickstaa commented Jul 22, 2026

Copy link
Copy Markdown
Member

@j0sh thanks for handling my comments. Good to be merged from my side. I think the only outstanding PRs on the go-livepeer side for a release are:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Issues and PR related to the AI-video branch. docs go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants