feat(ai/runner): per-second live runner pricing (remove 720p pixel scaling)#3952
feat(ai/runner): per-second live runner pricing (remove 720p pixel scaling)#3952rickstaa wants to merge 5 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…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>
6043888 to
a322f2f
Compare
|
@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>
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>
…rch meter) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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*3600and the meter multiplied wall-clock seconds by1280*720*30, so the two 720p factors cancelled toUSD/hour x hoursand every stream was billed as 720p regardless of real resolution. This makes the operator's price and the/discoverynumber confusing.This makes per-second the only behavior: the declared price converts directly to wei/second and usage is metered in wall-clock nanoseconds;
/discoverypublishes 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)
newConverterForRunnerconverts the declared price as USD/second (no 720p scaling).convertedPriceInfopublishes wei per nanosecond (PixelsPerUnit = 1e9).live_payment_processormeters wall-clock nanoseconds.remote_signerLV2V pixel computation now uses nanoseconds to match the orchestrator meter; removed the now-unuseddefaultSegInfo.How did you test each of these updates (required)
go build ./...,go test ./ai/runner/ -run LiveRunner, andgo 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:
makeruns successfully./test.shpass