feat(byoc): send capabilities protobuf on one-shot /inference payments#40
Open
seanhanca wants to merge 1 commit into
Open
Conversation
Attach the BYOC capability-constraints protobuf (Capability_BYOC keyed on the capability name) to the /generate-live-payment request built by _create_byoc_payment, mirroring how the live-runner LivePaymentSession already encodes it. This lets the remote signer derive the usage label (pipeline=byoc, model_id=<capability>) via ConstrainedPipelineModelID instead of metering every one-shot inference job as live-video-to-video/unknown. Verified end-to-end against the production DMZ signer: flux-schnell, flux-dev and nano-banana now meter as byoc/<capability>. The existing "capability" string field is retained for backward compatibility.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Attaches the BYOC capability-constraints protobuf to the
/generate-live-paymentrequest built by
_create_byoc_payment(the one-shot/inferencepath), mirroringhow the live-runner
LivePaymentSession._payment_requestalready encodes it.Before this change, one-shot BYOC inference jobs sent only a
capabilitystringand were metered by the remote signer as
live-video-to-video / unknownat a flatbase fee. With the
capabilitiesprotobuf present (Capability_BYOCkeyed on thecapability name), the signer derives the usage label
pipeline=byoc, model_id=<capability>viaConstrainedPipelineModelID— the samemechanism the live-runner path uses.
Test plan
pytest tests/test_capabilities.py tests/test_byoc_training.py— 5 passedpymthouse-production.up.railway.app)via the hosted staging orchestrator:
flux-schnell,flux-dev,nano-bananaeach returned HTTP 200 with real images.
byoc/flux-schnell,byoc/flux-dev,byoc/nano-bananainstead oflive-video-to-video / unknown.Known limitation (signer-side, out of scope for this PR)
Per-capability pricing is still flat (~322 µUSD/gen for all models) — the signer's
per-cap price resolution (
resolveByocPrice/ModelIDForCapability(Capability_BYOC),go-livepeer #3977) does not yet differentiate. Labels are fixed by this gateway change;
correct per-cap charge requires the signer to look up
OrchestratorInfo.CapabilitiesPricesfor the BYOC constraint.
Made with Cursor