Skip to content

feat(byoc): send capabilities protobuf on one-shot /inference payments#40

Open
seanhanca wants to merge 1 commit into
jm/live-runner-session-paymentsfrom
feat/byoc-inference-capabilities-protobuf
Open

feat(byoc): send capabilities protobuf on one-shot /inference payments#40
seanhanca wants to merge 1 commit into
jm/live-runner-session-paymentsfrom
feat/byoc-inference-capabilities-protobuf

Conversation

@seanhanca

Copy link
Copy Markdown
Contributor

Summary

Attaches the BYOC capability-constraints protobuf to the /generate-live-payment
request built by _create_byoc_payment (the one-shot /inference path), mirroring
how the live-runner LivePaymentSession._payment_request already encodes it.

Before this change, one-shot BYOC inference jobs sent only a capability string
and were metered by the remote signer as live-video-to-video / unknown at a flat
base fee. With the capabilities protobuf present (Capability_BYOC keyed on the
capability name), the signer derives the usage label
pipeline=byoc, model_id=<capability> via ConstrainedPipelineModelID — the same
mechanism the live-runner path uses.

byoc_caps = build_capabilities(CapabilityId.BYOC, capability)
payment_body = json.dumps({
    "orchestrator": orch_info_b64,
    "type": "lv2v",
    "capability": capability,          # retained for backward compat
    "capabilities": capabilities_b64,  # NEW: BYOC constraints protobuf
})

Test plan

  • pytest tests/test_capabilities.py tests/test_byoc_training.py — 5 passed
  • End-to-end against the production DMZ signer (pymthouse-production.up.railway.app)
    via the hosted staging orchestrator: flux-schnell, flux-dev, nano-banana
    each returned HTTP 200 with real images.
  • OpenMeter usage now shows byoc/flux-schnell, byoc/flux-dev,
    byoc/nano-banana instead of live-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.CapabilitiesPrices
for the BYOC constraint.

Made with Cursor

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.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: e78dc6f4-8797-4b9b-8060-f5dee1be8f01

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 feat/byoc-inference-capabilities-protobuf

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant