Skip to content

initial implementation of options filtering for byoc jobs - #3

Open
mikezupper wants to merge 3 commits into
masterfrom
tasks/livepeer.cloud/master/implement-byoc-options-filtering
Open

initial implementation of options filtering for byoc jobs#3
mikezupper wants to merge 3 commits into
masterfrom
tasks/livepeer.cloud/master/implement-byoc-options-filtering

Conversation

@mikezupper

@mikezupper mikezupper commented Mar 17, 2026

Copy link
Copy Markdown

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

Why You'd Want Options Filtering as a BYOC Runner Developer

The Problem Without It

Imagine you have two workers registered for the text-to-image capability:

  • Worker A: RTX 3080 (10GB VRAM), running Stable Diffusion 1.5
  • Worker B: A100 (80GB VRAM), running FLUX.1

Without filtering, a job requesting FLUX.1 could land on Worker A, which can't run it. The orchestrator has no way to say "this job needs Worker B specifically."


Layer by Layer

  1. Worker Registration (ExternalCapability.WorkerOptions)

When your runner registers itself with the orchestrator, it now includes metadata about what it actually supports:
{"model": "flux-1", "vram": "80", "precision": "fp16"}
This is your runner advertising its capabilities beyond just "I handle text-to-image."

  1. Orchestrator Capacity (GetFilteredCapacity)

When the gateway asks "how much capacity do you have for text-to-image?", the orchestrator can now answer specifically for the requested model. If the gateway asks "how much FLUX.1 capacity do you have?", it won't count
your SD1.5 workers. The gateway stops wasting time talking to orchestrators that can't actually handle the job.

  1. Job Token (JobToken.WorkerOptions)

When the orchestrator hands back a token to the gateway, it includes the worker options it found. This lets the gateway do a second sanity check — "does this orchestrator actually have what I need?" — before committing
to routing the job there.

  1. Runner Selection (SelectAndReserveRunner)

Previously, when a job arrived, the orchestrator just grabbed any available runner for that capability. Now it finds the best matching runner for the specific model/hardware requested, and atomically reserves it so no
other job steals it in the meantime.

  1. Job Parameters (JobParameters.OptionsFilter)

The job client (whoever is submitting work) can specify what they need in the job request:
{"options_filter": {"model": "flux-1"}}
This filter flows all the way from the client → gateway → orchestrator → runner selection.

  1. Network Capabilities (CapabilityOptions in /getNetworkCapabilities)

The gateway's discovery endpoint now publishes what options each orchestrator's workers support. Clients can query this first to know what's available before submitting a job — like a menu of supported models.

  1. /process/options endpoint (model discovery)

Both the orchestrator and gateway expose this endpoint. The gateway fans out to all its orchestrators and aggregates the results. This is what a UI or API client would call to populate a "choose your model" dropdown.


The Real-World Payoff

As a BYOC runner developer, this means:

  • You can register specialized workers (e.g. a node with a specific GPU/model) and guarantee jobs that need that specialization actually reach you
  • You don't get flooded with jobs your hardware can't handle, wasting capacity and returning errors
  • Multiple runners for the same capability can coexist on the same orchestrator, each advertising different specs — the orchestrator routes intelligently between them
  • Clients get predictable job routing instead of lottery-style assignment

This specification details a mechanism for dynamic, capability-based routing in the Bring Your Own Compute (BYOC) network. By decoupling domain-specific worker capabilities from the core Orchestrator and Gateway routing logic, BYOC workers can self-report their configuration (options), and clients can define strict requirements (filters). The Gateway evaluates these filters using a lightweight matching engine to determine Orchestrator eligibility.

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

Checklist:

@mikezupper
mikezupper force-pushed the tasks/livepeer.cloud/master/implement-byoc-options-filtering branch from 7c0c2ca to 1a2097d Compare April 1, 2026 20:22
rickstaa pushed a commit to rickstaa/go-livepeer that referenced this pull request Apr 2, 2026
Research document for Cloud-SPE#3 covering how 10 platforms
(Akash, Chutes, Golem, Render, Nosana, io.net, Ritual, Replicate, Modal,
Kubernetes) handle node filtering, how it maps to Livepeer's existing
discovery pipeline, and recommendations for the PR.

https://claude.ai/code/session_01DgpxiArhXKpZmg2ckCiS6f
@mikezupper
mikezupper force-pushed the tasks/livepeer.cloud/master/implement-byoc-options-filtering branch from 1a2097d to 6b6b5c4 Compare April 2, 2026 11:24
@mikezupper
mikezupper changed the base branch from releases/livepeer.cloud/master to master April 2, 2026 11:24
 initial implementation of options filtering for byoc jobs

 expose per-capability worker options in getNetworkCapabilities
  Worker options (model, vram, etc.) registered by BYOC workers are now
  returned under each orchestrator in /getNetworkCapabilities as
  capability_options keyed by capability name, alongside capabilities_prices.
  Changes:
  - Add GetAllWorkerOptionsByCapability() to ExternalCapabilities
  - Change GET /process/options on the orchestrator to return a per-capability
    map instead of a flat list
  - Add FetchCapabilityOptions() helper for single-orch HTTP fetch
  - Add CapabilityOptions field to OrchNetworkCapabilities
  - getNetworkCapabilitiesHandler fans out to each orch's OrchURI and attaches
    options via struct copies (not mutations of the cached pointers)
  - Fix race condition where direct mutation of cached OrchNetworkCapabilities
    pointers corrupted fields like capabilities_prices
  - added documentation for the BYOC implementation
@mikezupper
mikezupper force-pushed the tasks/livepeer.cloud/master/implement-byoc-options-filtering branch from 6b6b5c4 to a45206f Compare April 2, 2026 11:42
mikezupper and others added 2 commits April 23, 2026 07:47
Adds a new RemoteType_ByocRequest = "byoc-request" value for the
RemotePaymentRequest.Type field. Semantics:

- Caller supplies InPixels explicitly (no auto-calculation).
- Under BYOC pricing, PixelsPerUnit denominates wei-per-second, so
  InPixels here represents "seconds of compute to pre-fund."
- Rejected with 400 if InPixels is not positive.

This is the first wiring of non-LV2V BYOC through the remote signer.
Existing behavior (LV2V and empty-type) is unchanged; the switch
statement replacement is a refactor of the prior if/else chain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…c-request-payment-type

remote_signer: add byoc-request payment type
@mikezupper
mikezupper changed the base branch from master to releases/cloudspe/master April 23, 2026 19:17
@mikezupper
mikezupper changed the base branch from releases/cloudspe/master to master April 23, 2026 19:18
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