> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway Capabilities

> What gateways can route, how they select orchestrators, and the workload types they support across video, AI, and custom pipelines.

> [!TIP]
>
> Gateways route work to orchestrators; they do not perform the compute themselves. Orchestrators run the GPU workload, while the gateway selects the route, enforces the price ceiling, and manages the session.

Core Functions

## Gateway Functions

A gateway performs five core functions for every job it processes:

1. **Job intake** - accept requests from applications via RTMP (video) or HTTP API (AI, video, BYOC)
2. **Orchestrator selection** - match each job to the best available orchestrator based on capability, price, latency, and performance history
3. **Session management** - maintain persistent connections to orchestrators for the duration of a stream or job batch
4. **Payment handling** - generate probabilistic micropayment tickets per job segment (on-chain operational mode) or delegate payment to a remote signer (off-chain operational mode)
5. **Result delivery** - return transcoded video (HLS/DASH), inference output (JSON/binary), or stream results to the calling application

> [!NOTE]
>
> Orchestrators perform GPU compute, run AI models, transcode video, and execute containers. Compute providers should see [Orchestrator Role](/v2/orchestrators/concepts/role.md).

Workload Types

## Workload Types

Gateways route four categories of work into the Livepeer network. Operational mode sets the eligible categories.

<table>
  <thead>
    <tr>
      Workload

      What it does

      Ingest protocol

      On-chain

      Off-chain
    </tr>
  </thead>

  <tbody>
    <tr>
      **Video transcoding**

      Convert live video streams into multiple resolutions and formats

      RTMP (port 1935)

      Yes

      No
    </tr>

    <tr>
      **Batch AI inference**

      Single-request AI jobs: text-to-image, image-to-video, audio-to-text, captioning, segmentation

      HTTP API (port 8935)

      Yes

      Yes
    </tr>

    <tr>
      **Real-time AI (Cascade)**

      Continuous AI processing on a live video stream - style transfer, avatars, real-time agents

      HTTP API (port 8935)

      Yes

      Yes
    </tr>

    <tr>
      **LLM inference**

      Text generation, chat, instruction-following via large language models

      HTTP API (port 8935)

      Yes

      Yes
    </tr>
  </tbody>
</table>

> [!WARNING]
>
> Video transcoding uses RTMP ingest and on-chain payment. Route video transcoding through an on-chain gateway.

### BYOC (Bring Your Own Container)

BYOC pipelines allow applications to define custom container-based workloads that orchestrators execute. The gateway routes BYOC requests through the same HTTP API it uses for AI inference, and the orchestrator runs an application-defined container instead of a standard AI model.

BYOC enables use cases like custom ML workflows, enterprise-specific processing, and novel applications (e.g. [Embody AI avatars](/v2/solutions/embody)).

See [BYOC pipelines](/v2/developers/build/byoc.md) for the developer-side setup.

Orchestrator Selection

## Orchestrator Selection

When a job arrives, the gateway must decide which orchestrator to send it to. This is the gateway's most important function - it directly affects cost, latency, and reliability for end users.

```mermaid theme={null}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#1a1a1a', 'primaryTextColor': '#fff', 'primaryBorderColor': '#2d9a67', 'lineColor': '#2d9a67', 'secondaryColor': '#0d0d0d', 'tertiaryColor': '#1a1a1a', 'background': '#0d0d0d', 'fontFamily': 'system-ui' }}}%%
flowchart TD
    A["Job arrives at gateway"] --> B["Filter: capability match"]
    B --> C["Filter: price within maxPricePerUnit"]
    C --> D["Rank: latency + performance history + stake weight"]
    D --> E["Select: best orchestrator"]
    E --> F["Dispatch job + payment ticket"]
    F --> G{Success?}
    G -->|Yes| H["Return result to application"]
    G -->|No| I["Failover: try next ranked orchestrator"]
    I --> F

    classDef default fill:#1a1a1a,color:#fff,stroke:#2d9a67,stroke-width:2px
```

The selection algorithm considers:

<table>
  <thead>
    <tr>
      Factor

      What it means
    </tr>
  </thead>

  <tbody>
    <tr>
      **Capability**

      Does the orchestrator support the requested pipeline, model, or transcoding profile?
    </tr>

    <tr>
      **Price**

      Is the orchestrator's advertised price within the gateway's configured `maxPricePerUnit`?
    </tr>

    <tr>
      **Latency**

      How fast has this orchestrator responded to recent jobs?
    </tr>

    <tr>
      **Performance history**

      What is the orchestrator's success rate and error rate over recent sessions?
    </tr>

    <tr>
      **Stake weight**

      How much LPT is staked to this orchestrator? Higher stake implies greater economic commitment to good behaviour
    </tr>
  </tbody>
</table>

### Discovery Methods

Gateway discovery follows the operational mode:

> [tab] On-chain gateway
>
> Queries the **on-chain orchestrator registry** (ServiceRegistry contract on Arbitrum). All registered orchestrators are discoverable automatically. The gateway refreshes this list periodically.
>
> This is the default discovery method and requires no additional configuration.

> [tab] Off-chain gateway
>
> Off-chain gateways do not query the on-chain registry directly. Orchestrator discovery is handled via:
>
> * **Orchestrator list from the remote signer** - the signer provides a set of known orchestrators
> * **Manual configuration** - the operator provides an explicit orchestrator list
>
> See the [Remote Signers](/v2/gateways/guides/payments-and-pricing/remote-signers.md) page for how discovery works in off-chain operational mode.

Session Management

## Sessions and Failover

Gateways maintain **sessions** with orchestrators for the duration of a workload. For video transcoding, a session covers an entire livestream. For AI inference, a session usually covers a single request or batch.

Key session behaviours:

* **Session reuse** - the gateway reuses an existing session with an orchestrator when a new segment of the same stream arrives, avoiding repeated orchestrator selection overhead
* **Automatic failover** - when an orchestrator fails mid-session (timeout, error, disconnect), the gateway selects the next-best orchestrator and retries the segment
* **Session managers** - the gateway runs separate session managers for video (`BroadcastSessionsManager`) and AI (`AISessionManager`), allowing dual-workload operation from a single node
* **Price negotiation** - session setup includes price agreement. A mid-session price change triggers renegotiation or a switch

> [!NOTE]
>
> Running both video and AI workloads from a single gateway node is called **dual-workload configuration**. The gateway handles this through separate session managers - no special setup required beyond enabling both ingest protocols. See [Gateway Architecture](/v2/gateways/concepts/architecture.md) for the internal pipeline view.

Marketplace

## Gateway Marketplace Role

Gateways participate in the Livepeer marketplace as the **demand side**. They create competition among orchestrators by routing jobs based on price, performance, and capability.

This means:

* **Better orchestrators earn more work** - gateways naturally route to faster, cheaper, more reliable nodes
* **Gateways compete on routing quality** - application developers choose gateways based on supported features, latency, developer experience, and pricing
* **New capabilities are instantly routable** - when an orchestrator adds a new AI model or pipeline, gateways discover it and route to it without code changes

The marketplace emerges from gateways and orchestrators advertising capabilities and prices, with the selection algorithm matching supply to demand.

See [Gateway Business Model](/v2/gateways/concepts/business-model.md) for how gateway operators set pricing and earn margins within this marketplace.

## Related Pages

> [card] [Gateway Role](/v2/gateways/concepts/role.md)
>
> What gateways are and how the role has evolved.

> [card] [Gateway Architecture](/v2/gateways/concepts/architecture.md)
>
> Internal components, request flow, and system interactions.

> [card] [Gateway Business Model](/v2/gateways/concepts/business-model.md)
>
> Revenue models, cost structures, and pricing.

> [card] [Navigator](/v2/gateways/navigator.md)
>
> Find the right setup path for your goals.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.