Skip to content

feat(ai/runner): per-second live runner pricing (remove 720p pixel scaling)#3952

Draft
rickstaa wants to merge 5 commits into
ja/live-runnerfrom
rs/live-runner-per-second-pricing
Draft

feat(ai/runner): per-second live runner pricing (remove 720p pixel scaling)#3952
rickstaa wants to merge 5 commits into
ja/live-runnerfrom
rs/live-runner-per-second-pricing

Conversation

@rickstaa

@rickstaa rickstaa commented Jun 17, 2026

Copy link
Copy Markdown
Member

What does this pull request do? Explain your changes. (required)

Live runner usage is metered per compute-second on the orchestrator, but the price was run through a hidden fixed-720p@30fps pixel conversion: the converter divided the declared price by 1280*720*30*3600 and the meter multiplied wall-clock seconds by 1280*720*30, so the two 720p factors cancelled to USD/hour x hours and every stream was billed as 720p regardless of real resolution. This makes the operator's price and the /discovery number confusing.

This makes per-second the only behavior: the declared price converts directly to wei/second and usage is metered in wall-clock nanoseconds; /discovery publishes a real wei-per-second rate (PixelsPerUnit = 1e9). The remote signer's LV2V pixel computation also moves to nanoseconds so the consumer side matches the orchestrator's metering. Per-second matches the orchestrator's actual cost basis and the serverless GPU market (Modal/Replicate/RunPod bill per second). Full rationale in #3951.

Specific updates (required)

  • newConverterForRunner converts the declared price as USD/second (no 720p scaling).
  • convertedPriceInfo publishes wei per nanosecond (PixelsPerUnit = 1e9).
  • live_payment_processor meters wall-clock nanoseconds.
  • remote_signer LV2V pixel computation now uses nanoseconds to match the orchestrator meter; removed the now-unused defaultSegInfo.
  • Tests updated for per-second; signer test ticket EV recalibrated for the nanosecond quantity.

How did you test each of these updates (required)
go build ./..., go test ./ai/runner/ -run LiveRunner, and go test ./server/ -run 'LiveRunner|LivePayment|RemoteSigner' pass. A 10 USD/s price at 2000 USD/ETH converts to 5e15 wei/s, published as {PricePerUnit: 5e15, PixelsPerUnit: 1e9}.

Does this pull request close any open issues?
Fixes #3951

Checklist:

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4a84ffa-c1c5-4850-b124-b6174332424e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rs/live-runner-per-second-pricing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added go Pull requests that update Go code AI Issues and PR related to the AI-video branch. labels Jun 17, 2026
…EGACY_PIXEL_PRICING)

Live runner usage is metered per compute-second on the orchestrator, but the
price was run through a hidden fixed-720p@30fps pixel conversion: the converter
divided by 1280*720*30*3600 and the meter multiplied wall-clock seconds by
1280*720*30, so the two 720p factors cancelled to USD/hour x hours and every
stream was billed as 720p regardless of real resolution.

Default to plain USD/second: convert the declared price directly to wei/second
and meter wall-clock nanoseconds. The legacy 720p path is preserved behind
LIVE_AI_LEGACY_PIXEL_PRICING for runners (e.g. Daydream) still declaring
USD/hour prices, until they migrate.

Fixes #3951

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rickstaa rickstaa force-pushed the rs/live-runner-per-second-pricing branch from 6043888 to a322f2f Compare June 17, 2026 12:28
@rickstaa

Copy link
Copy Markdown
Member Author

@j0sh I just realized that, since this is on the orchestrator side, each orchestrator would need to enable the environment flag, which would be difficult to enforce. New orchestrators would also need to set it explicitly, so switching to this approach does not provide much benefit.

For now, I removed the flag in my latest commit. I think it would be better to coordinate the Daydream gateway migration to the new pricing instead.

An orchestrator-side env flag is hard to coordinate (new orchs would have to
set it, and it can't be enforced per-runner), so remove it and make per-second
the only behavior. We'll coordinate the Daydream gateway onto the new pricing
directly instead.

- Remove the LIVE_AI_LEGACY_PIXEL_PRICING helper and the legacy 720p branches in
  the converter, convertedPriceInfo, and the live payment meter.
- Update the remote signer's LV2V pixel computation to nanoseconds so the
  consumer side matches the orchestrator's per-second metering (previously the
  flag's default branch left this at 720p, an inconsistency).
- Remove the now-unused defaultSegInfo and legacy-path test; recalibrate signer
  test EV for the nanosecond quantity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rickstaa rickstaa changed the title feat(ai/runner): default live runner pricing to per-second (remove 720p pixel scaling) feat(ai/runner): per-second live runner pricing (remove 720p pixel scaling) Jun 17, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
secsSinceLastProcessed is the human-readable field; billedNanos is just
secs x 1e9 and the quantity is already logged downstream.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rickstaa rickstaa marked this pull request as draft June 17, 2026 20:21
…rch meter)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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. go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live runner: replace fixed 720p pixel pricing with per-second metering

1 participant