Skip to content

refactor(examples): move to USD per hour pricing - #34

Merged
rickstaa merged 8 commits into
mainfrom
rs/usd-per-hour-pricing
Jul 27, 2026
Merged

refactor(examples): move to USD per hour pricing#34
rickstaa merged 8 commits into
mainfrom
rs/usd-per-hour-pricing

Conversation

@rickstaa

@rickstaa rickstaa commented Jul 24, 2026

Copy link
Copy Markdown
Member

What

Moves the examples to the pricing scheme from livepeer/go-livepeer#3992: runners advertise a single USD per hour price instead of price_per_unit / pixels_per_unit.

  • runner.py (hello-world, tiles): --price is a float in USD/hour; --pixels-per-unit is gone.
  • vllm/runners.json: price_info is now { "price": 0.01 }.
  • .env.example: PRICE replaces PRICE_PER_UNIT / PIXELS_PER_UNIT; the signer caps what it pays via MAX_PRICE_PER_UNIT, applied per second of runtime.
  • compose.onchain.yml: dropped -pixelsPerUnit from the signer, retuned -ticketEV, and raised -maxFaceValue to 4e15 so a ticket's faceValue can cover the redemption tx cost (~3.6e15 wei on Arbitrum); lower caps made the orchestrator reject every session with "insufficient sender reserve".
  • Dockerfiles: install the SDK from the ja/live-runner branch ref (rebuild with --no-cache to refresh).
  • docker-compose*.yml renamed to compose*.yml (Compose v2 convention); docs updated.
  • tiles client: logs one warning per tile with the rejection reason when a reserve is refused, so a dead runner no longer looks like a hang.

Testing

Verified end to end on Arbitrum mainnet: hello-world paid /hello call, tiles 9 tiles paid and stitched, vllm paid chat completion through the OpenAI gateway.

Requires livepeer-python-gateway ja/live-runner at 89ac0f7 or later; older pins compute payments ~1e6 too large and fail with "numTickets exceeds maximum of 100".

Track go-livepeer#3992: runners now advertise a single decimal USD per
hour price instead of price_per_unit / pixels_per_unit.

- runner.py (hello-world, tiles): replace --price/--pixels-per-unit
  with a single float --price in USD per hour
- vllm/runners.json: price_info is now { "price": 0.01 }
- .env.example: PRICE replaces PRICE_PER_UNIT/PIXELS_PER_UNIT
- compose.onchain.yml: drop -pixelsPerUnit from the signer, move
  -maxFaceValue to the orchestrator and retune -ticketEV for the new
  price scale
- Dockerfiles: parameterize the SDK ref and bust the pip cache when
  the branch moves
- READMEs: document the new pricing and /discovery output

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 20:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the example apps to match the updated on-chain pricing model: runners now advertise a single decimal USD/hour price instead of the legacy price_per_unit + pixels_per_unit scheme, and the on-chain compose/env/docs are updated accordingly.

Changes:

  • Switch runner registration and example configs to price (decimal USD/hour), removing pixels-per-unit usage.
  • Update on-chain compose/env templates and root docs to reflect the new pricing model and discovery output.
  • Make the SDK git ref configurable in Dockerfiles via SDK_REF and add a cache-busting mechanism to force SDK ref refreshes on rebuild.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vllm/runners.json Update static runner config to advertise { "price": ... }.
vllm/.env.example Remove legacy pricing vars; document new runner price source and payer max-price cap.
tiles/runner.py Update CLI args and runner registration to use price (USD/hour).
tiles/Dockerfile Parameterize SDK ref and add cache-busting to refresh SDK dependency.
tiles/docker-compose.onchain.yml Switch on-chain overlay to pass PRICE to --price.
tiles/.env.example Replace legacy pricing vars with PRICE (USD/hour).
README.md Update repo-level on-chain pricing explanation and /discovery verification notes.
hello-world/runner.py Update CLI args and runner registration to use price (USD/hour).
hello-world/README.md Update documentation to describe --price as USD/hour.
hello-world/Dockerfile Parameterize SDK ref and add cache-busting to refresh SDK dependency.
hello-world/docker-compose.onchain.yml Switch on-chain overlay to pass PRICE to --price.
hello-world/.env.example Replace legacy pricing vars with PRICE (USD/hour).
echo/Dockerfile Parameterize SDK ref and add cache-busting to refresh SDK dependency.
compose.onchain.yml Remove legacy signer pixel scaling flag; retune/payment-related orchestrator flags and comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hello-world/Dockerfile Outdated
Comment thread tiles/Dockerfile Outdated
Comment thread echo/Dockerfile Outdated
Comment thread compose.onchain.yml Outdated
@rickstaa
rickstaa marked this pull request as draft July 24, 2026 20:50
rickstaa and others added 4 commits July 26, 2026 08:58
…ntion

Compose v2 canonical naming, matching the shared root files. Auto discovery
and -f usage are unchanged; all README commands and file header comments
updated to the new names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtVeDdep8i9UrNKbm9yr8G
A ticket faceValue must cover redeemGas (1.2M on Arbitrum) times the 3 gwei
average gas price go-livepeer assumes, about 3.6e15 wei. With maxFaceValue
below that the orchestrator rejects every session with insufficient sender
reserve regardless of the actual reserve size. 4e15 clears it with headroom.
The vllm overlay carries the same flag in the rename commit. Also documents
PRICE in the vllm env example.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtVeDdep8i9UrNKbm9yr8G
The reserve retry loop swallowed NoRunnerAvailableError silently for up to
reserve-timeout seconds, which made a dead runner look like a hang. Each tile
now logs one warning with the rejection reason on its first refused reserve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtVeDdep8i9UrNKbm9yr8G
The ADD of the commits API endpoint hit api.github.com on every image build
and could fail on rate limits. Install the SDK from the branch ref directly;
rebuild with --no-cache when a fresh SDK checkout is needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtVeDdep8i9UrNKbm9yr8G
-maxPricePerUnit caps per unit and a live runner unit is one second, so the
old 0.10USD default meant about 360 USD/hour, effectively no cap. Ship
0.000111USD (about 0.40 USD/hour) and document the per-second unit. Verified
against a third party orch at 0.34 USD/hour: passes at this cap, refused with
HTTP 481 when the cap is set below its price.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtVeDdep8i9UrNKbm9yr8G
Decimal USD was spec speak for "a plain number, not integer wei"; nobody
reads it that way, so say USD with the 0.01 example carrying the format.
The signer max price cap comments now simply say the cap applies per
second of runtime, and the ticketEV and maxFaceValue comment essays in
compose.onchain.yml are gone; the PR and git history keep the derivations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rickstaa rickstaa changed the title refactor(examples): move to decimal USD per hour pricing refactor(examples): move to USD per hour pricing Jul 27, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rickstaa
rickstaa marked this pull request as ready for review July 27, 2026 13:46
Copilot AI review requested due to automatic review settings July 27, 2026 13:46
@rickstaa
rickstaa merged commit 879f441 into main Jul 27, 2026
5 checks passed
@rickstaa
rickstaa deleted the rs/usd-per-hour-pricing branch July 27, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 21 changed files in this pull request and generated no new comments.

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.

2 participants