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

# Configure AI, Video, or Dual Gateway Services

> Configure a Livepeer Gateway for AI inference, video transcoding, or both from one consolidated setup page.

# &#x20;Configure Your Gateway

Use this page to configure a Livepeer Gateway for AI inference, video transcoding, or both workloads on the same node.

## Configuration Methods

You can configure a Livepeer Gateway using:

* Command-line flags
* Environment variables prefixed with `LP_`
* A plain-text configuration file

> [card] [Full Configuration Reference](/v2/gateways/resources/reference/technical/configuration-flags.md)
>
> Full reference for gateway configuration flags

> [card] [Pricing Configuration](/v2/gateways/guides/payments-and-pricing/pricing-configuration.md)
>
> Configure pricing for your gateway services

> [tab] AI
>
> This page will walk you through the process of deploying and configuring a Livepeer Gateway for AI inference services.
>
> ## Gateway Modes
>
> You can run a gateway
>
> * **"Off-chain"** -> dev or local mode
>
> * **"On-chain"** -> production mode connected to the blockchain-based Livepeer network.
>
> > [!WARNING]
> >
> > If you run your gateway **off-chain** - **you will need to run your own Orchestrator node** ie. Have access to a GPU and set it up as an Orchestrator, in order to test Gateway functionality.
>
> > [!NOTE]
> >
> > There is currently no Livepeer "Testnet" available which has Orchestrator offerings, though there are conversations underway to enable this in the future.
> >
> > **Do you think Livepeer should have a "testnet" available for Gateways to connect to?**
> >
> > Follow & contribute to the discussion in the [Discord](https://discord.gg/livepeer) and on the [Forum](https://forum.livepeer.org)
>
> ## Deploy a Gateway for AI Inference Services
>
> You can run the Livepeer AI software using one of the following methods:
>
> * **Docker** (Recommended): The simplest and preferred method.
> * **Pre-built Binaries**: An alternative if you prefer not to use Docker.
>
> ## &#x20;Deploy an AI Gateway
>
> Follow the steps below to start your Livepeer AI Gateway node.
>
> > [!NOTE]
> >
> > These instructions apply to both on-chain & off-chain Gateway deployments.
>
> > [tab] Use Docker (Recommended)
> >
> > ### 1. Retrieve the Livepeer AI Docker Image
> >
> > Fetch the latest [Livepeer AI Docker image](https://hub.docker.com/r/livepeer/go-livepeer) with the following command:
> >
> > ```bash icon="terminal" Pull Docker Image theme={null}
> > docker pull livepeer/go-livepeer:master
> > ```
> >
> > ### 1. Launch a Localhost (Off-chain) AI Gateway
> >
> > Run the Docker container for your AI Gateway node:
> >
> > ```bash icon="terminal" theme={null}
> > docker run \
> >     --name livepeer_ai_gateway \
> >     -v ~/.lpData2/:/root/.lpData2 \
> >     -p 8935:8935 \
> >     --network host \
> >     livepeer/go-livepeer:master \
> >     -datadir ~/.lpData2 \
> >     -gateway \
> >     -orchAddr <orchestrator list> \
> >     -httpAddr 0.0.0.0:8935 \
> >     -v 6 \
> >     -httpIngest
> > ```
> >
> > This command launches a local (**off-chain**) AI Gateway node. The flags are similar to those used for a Mainnet Transcoding Network Gateway. See the [go-livepeer CLI reference](/v2/gateways/resources/reference/technical/go-livepeer/cli-reference) for flag details.
> >
> > ### 1. Confirm Successful Startup
> >
> > Upon successful startup, you should see output similar to:
> >
> > ```bash icon="terminal" theme={null}
> > I0501 11:07:47.609839       1 mediaserver.go:201] Transcode Job Type: [{P240p30fps16x9 600k 30 0 426x240 16:9 0 0 0s 0 0 0 0} {P360p30fps16x9 1200k 30 0 640x360 16:9 0 0 0s 0 0 0 0}]
> > I0501 11:07:47.609917       1 mediaserver.go:226] HTTP Server listening on http://0.0.0.0:8935
> > I0501 11:07:47.609963       1 lpms.go:92] LPMS Server listening on rtmp://127.0.0.1:1935
> > ```
> >
> > ### 1. Check Port Availability
> >
> > Ensure that port `8935` is open and accessible, and configure your router for port forwarding if necessary to make the Gateway accessible from the internet.
> >
> > ### 1. Test the AI Gateway
> >
> > Follow the instructions in the [AI Gateway Testing Guide](/v2/gateways/quickstart/gateway-setup.md) to verify that the AI Gateway is operational.
>
> > [tab] Use Binaries
> >
> > ### 1. Download the Latest Livepeer AI Binary
> >
> > Download the latest Livepeer AI binary for your system:
> >
> > ```bash icon="terminal" theme={null}
> > wget https://build.livepeer.live/go-livepeer/livepeer-<OS>-<ARCH>.tar.gz
> > ```
> >
> > Replace `<OS>` and `<ARCH>` with your operating system and architecture (e.g., `linux-amd64` for Linux AMD64). For install options, see the [go-livepeer installation guide](/v2/gateways/setup/install.md).
> >
> > > [!WARNING]
> > >
> > > The Windows and MacOS (amd64) binaries of Livepeer AI are **not** available yet.
> >
> > ### 1. Extract and Configure the Binary
> >
> > Once downloaded, extract the binary to a directory of your choice.
> >
> > ### 1. Launch an Off-chain AI Gateway
> >
> > Start the AI Gateway node with the following command:
> >
> > ```bash icon="terminal" theme={null}
> > ./livepeer \
> >     -datadir ~/.lpData2 \
> >     -gateway \
> >     -orchAddr <orchestrator list> \
> >     -httpAddr 0.0.0.0:8935 \
> >     -v 6 \
> >     -httpIngest
> > ```
> >
> > This command launches an **off-chain** AI Gateway node. Refer to the [go-livepeer CLI reference](/v2/gateways/resources/reference/technical/go-livepeer/cli-reference) for more details on the flags.
> >
> > ### 1. Confirm Successful Startup
> >
> > Check the terminal for the following output to confirm successful startup:
> >
> > ```bash icon="terminal" theme={null}
> > I0501 11:07:47.609839       1 mediaserver.go:201] Transcode Job Type: [{P240p30fps16x9 600k 30 0 426x240 16:9 0 0 0s 0 0 0 0} {P360p30fps16x9 1200k 30 0 640x360 16:9 0 0 0s 0 0 0 0}]
> > I0501 11:07:47.609917       1 mediaserver.go:226] HTTP Server listening on http://0.0.0.0:8935
> > I0501 11:07:47.609963       1 lpms.go:92] LPMS Server listening on rtmp://127.0.0.1:1935
> > ```
> >
> > ### 1. Check Port Availability
> >
> > Ensure that port `8935` is open and accessible, and configure port forwarding if needed.
> >
> > ### 1. Test the AI Gateway
> >
> > Follow the instructions in the [AI Gateway Testing Guide](/v2/gateways/quickstart/gateway-setup.md) to verify that the AI Gateway is operational.
> >
> > > [!NOTE]
> > >
> > > If binaries are unavailable for your system, you can build the [master branch](https://github.com/livepeer/go-livepeer/tree/master) of [go-livepeer](https://github.com/livepeer/go-livepeer) from source. Refer to the [go-livepeer installation guide](/v2/gateways/setup/install.md) or reach out to the Livepeer community on [Discord](https://discord.gg/livepeer) for assistance.
>
> ## Gateway Code Links
>
> For AI processing, the Gateway extends its functionality to handle AI-specific workflows.
>
> > [card] [go-livepeer/server/ai\_mediaserver.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_mediaserver.go)
>
> Key components include:
>
> * **AISessionManager**: Manages AI processing sessions and selects appropriate Orchestrators with AI capabilities [ai\_http.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_http.go)
> * **MediaMTX Integration**: Handles media streaming for AI processing
> * **Trickle Protocol**: Enables efficient streaming for real-time AI video processing
>
> The AI workflow [server/ai\_process.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_process.go) involves
>
> * authenticating AI streams,
> * selecting AI-capable Orchestrators,
> * processing payments **based on pixels**, and
> * managing live AI pipelines

> [tab] Video
>
> ## TL;DR Configuration
>
> If you just want a working video gateway, use the below command:
>
> > [tab] Off-Chain
> >
> > Replace \<ORCHESTRATOR\_ADDRESSES> with your locally running orchestrator http address.
> >
> > ```bash wrap lines icon="terminal" Off-Chain Video Gateway theme={null}
> > livepeer -gateway \
> >   -network offchain \
> >   # Minimum required video flags
> >   -rtmpAddr=0.0.0.0:1935 \
> >   -httpAddr=0.0.0.0:8935 \
> >   -transcodingOptions=P240p30fps16x9,P360p30fps16x9 \
> >   # You will need to add your local orchestrator address if you are running off-chain
> >   -orchAddr=<ORCHESTRATOR_ADDRESSES> #comma separated list of orchestrator addresses
> >   # Example: -orchAddr=http://192.168.1.100:8935,http://192.168.1.101:8935
> >   # You can also use a JSON file: -orchAddr=/path/to/orchestrators/portal.json
> > ```
>
> > [tab] On-Chain
> >
> > Replace \<ORCHESTRATOR\_ADDRESSES> with publicly available orchestrator addresses.
> >
> > ```bash wrap lines icon="link" On-Chain Video Gateway theme={null}
> > livepeer -gateway \
> >   -network arbitrum-one-mainnet \
> >   # See the on-chain setup guide for more details on these flags
> >   -ethUrl=<YOUR_RPC_URL> \
> >   -ethAcctAddr=<YOUR_ETH_ADDRESS> \
> >   -ethPassword=<YOUR_PASSWORD> \
> >   -ethKeystorePath=<KEYSTORE_PATH> \
> >   # Minimum required video flags
> >   -rtmpAddr=0.0.0.0:1935 \
> >   -httpAddr=0.0.0.0:8935 \
> >   -transcodingOptions=P240p30fps16x9,P360p30fps16x9 \
> >   # Price per unit is required on-chain (see pricing guide)
> >   -maxPricePerUnit=1000 \
> >   # You will need to connect to a public orchestrator if you are running onchain
> >   -orchAddr=<ORCHESTRATOR_ADDRESSES> #comma separated list of orchestrators
> >   # Example:  -orchAddr=https://orch1.example.com:8935,https://orch2.example.com:8935
> >   # You can also use a JSON file: -orchAddr=/path/to/orchestrators/portal.json
> >
> > ```
> >
> > Livepeer does not currently maintain a list of publicly available Orchestrators. You need to discover them through:
> >
> > * **Livepeer CLI**: Use livepeer\_cli → Option 9: "List registered orchestrators"
> > * **Network discovery**: The gateway discovers orchestrators from the on-chain registry
> > * **Community resources**: Check Livepeer community channels or documentation
> >
> > Jump to the [Connect Guide](/v2/gateways/setup/connect/connect-with-offerings) for details on connecting to orchestrators.
>
> OVERVIEW
>
> Gateways for Video Transcoding In traditional video transcoding, the Gateway
> ingests video streams via
> [RTMP](https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol) or
> [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol), segments
> them, and distributes transcoding work to Orchestrators&#x20;
>
> Video Gateway Transcoding Architecture
>
> ```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 TB
>     subgraph INPUT["Video Input Sources"]
>         direction LR
>         RTMP["RTMP Stream<br/>:1935"]
>         HTTP["HTTP Upload<br/>:8935"]
>     end
>
>     GATEWAY["Gateway Node<br/>LivepeerNode<br/>-gateway mode"]
>
>     INPUT --> GATEWAY
>
>     subgraph MANAGER["Broadcast Session Manager"]
>         BSM["BroadcastSessionsManager<br/>Manages transcoding sessions<br/>Selects orchestrators"]
>     end
>
>     GATEWAY --> BSM
>
>     subgraph PROCESSING["Video Processing Pipeline"]
>         direction TB
>         SEG["Segment Video<br/>Split into chunks"]
>         TRANS["Send to Orchestrators<br/>with payment tickets"]
>         ORCH["Orchestrators<br/>Transcode segments<br/>Multiple renditions"]
>         RECEIVE["Receive Results<br/>Transcoded segments"]
>     end
>
>     BSM --> SEG --> TRANS --> ORCH --> RECEIVE
>
>     subgraph OUTPUT["Output & Delivery"]
>         direction LR
>         HLS["HLS Manifest<br/>.m3u8"]
>         RENDITIONS["Multiple Renditions<br/>240p, 360p, 720p, 1080p"]
>     end
>
>     RECEIVE --> HLS --> RENDITIONS
>
>     subgraph PAYMENT["Payment System"]
>         direction TB
>         PM["Payment Manager<br/>Generate tickets"]
>         TICKETS["Per-segment payments<br/>Based on pixels transcoded"]
>     end
>
>     TRANS --> PM --> TICKETS --> ORCH
>
>     subgraph STORAGE["Storage (Optional)"]
>         OBJ["Object Store<br/>S3/IPFS"]
>     end
>
>     RENDITIONS -.-> OBJ
>
>     classDef default fill:#1a1a1a,color:#fff,stroke:#2d9a67,stroke-width:2px
>     classDef video fill:#1a1a1a,color:#fff,stroke:#3b82f6,stroke-width:2px
>     classDef payment fill:#1a1a1a,color:#fff,stroke:#fbbf24,stroke-width:2px
>     class RTMP,HTTP,BSM,SEG,TRANS,ORCH,RECEIVE,HLS,RENDITIONS video
>     class PM,TICKETS payment
>     style INPUT fill:#0d0d0d,stroke:#2d9a67,stroke-width:1px
>     style MANAGER fill:#0d0d0d,stroke:#3b82f6,stroke-width:1px
>     style PROCESSING fill:#0d0d0d,stroke:#3b82f6,stroke-width:1px
>     style OUTPUT fill:#0d0d0d,stroke:#3b82f6,stroke-width:1px
>     style PAYMENT fill:#0d0d0d,stroke:#fbbf24,stroke-width:1px
>     style STORAGE fill:#0d0d0d,stroke:#2d9a67,stroke-width:1px,stroke-dasharray: 5 5
> ```
>
> > [card] [Code Reference](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/livepeernode.go)
> >
> > go-livepeer/core/livepeernode.go
>
> ## Essential Configuration Flags
>
> #### Required Flags
>
> **-gateway** `boolean` *required* (default: false)
>
> Enable Gateway mode
>
> **-network** `string` (default: offchain)
>
> Set to the blockchain network for production gateways  `arbitrum-one-mainnet`&#x20;
>
> **-orchAddr** `string` *required* (default: none)
>
> Set to  `http://<ORCHESTRATOR_IP>:<PORT>`  to connect to orchestrators
>
> #### Network Configuration
>
> **-rtmpAddr** `string` (default: 127.0.0.1:1935)
>
> Set to  `0.0.0.0:1935`  to allow external RTMP connections
>
> **-httpAddr** `string` (default: 127.0.0.1:8935)
>
> Set to  `0.0.0.0:8935`  to allow external HLS/API access
>
> #### Transcoding Configuration
>
> **-transcodingOptions** `string` (default: P240p30fps16x9,P360p30fps16x9)
>
> Set to  `path/to/transcodingOptions.json`  to use a custom transcoding configuration
>
> #### Additional On-Chain Flags
>
> Add these flags for on-chain configuration. See [On-Chain Setup Guide](/v2/gateways/setup/requirements/on-chain-setup/on-chain.md) for details.
>
> FULL CONFIGURATION GUIDE
>
> ## Comprehensive Configuration Guide
>
> ### Configuration Methods
>
> You have three ways to configure your Livepeer gateway after installation:
>
> * Command-line flags (most common)
> * Environment variables (prefixed with LP\_)
> * Configuration file (plain text key value format)
>
> ### Configuration Examples
>
> The below examples show the most common configuration methods.
>
> > [tab] CLI
> >
> > .
>
> > [tab] Config File
> >
> > .
>
> > [tab] Env Variables
> >
> > .
>
> > [tab] Docker
> >
> > ```bash wrap icon="docker" Create docker-compose.yml theme={null}
> > # 1. Create a basic docker-compose.yml
> > cat > docker-compose.yml << EOF
> > version: '3.9'
> > services:
> >   gateway:
> >     image: livepeer/go-livepeer:master
> >     ports:
> >       - 1935:1935  # RTMP ingest
> >       - 8935:8935  # HLS/API
> >     volumes:
> >       - gateway-data:/root/.lpData
> >     command: |
> >       -gateway
> >       -network offchain
> >       -rtmpAddr=0.0.0.0:1935
> >       -httpAddr=0.0.0.0:8935
> >       -orchAddr=https://orchestrator.example.com:8935
> >       -transcodingOptions=P240p30fps16x9,P360p30fps16x9,P720p30fps16x9
> >
> > volumes:
> >   gateway-data:
> > EOF
> > ```
> >
> > Start the Gateway
> >
> > ```bash wrap icon="docker" Start the gateway theme={null}
> > # 2. Start the gateway
> > docker-compose up -d
> > ```
>
> > [tab] Binary
> >
> > .
>
> ```bash icon="terminal" theme={null}
> livepeer -gateway \
>   -network offchain \
>   -transcodingOptions=${env:HOME}/.lpData/offchain/transcodingOptions.json \
>   -orchAddr=0.0.0.0:8935 \
>   -httpAddr=0.0.0.0:9935 \
>   -v=6
> ```
>
> > [tab] Docker
> >
> > ```bash wrap icon="docker" Create docker-compose.yml theme={null}
> > # 1. Create a basic docker-compose.yml
> > cat > docker-compose.yml << EOF
> > version: '3.9'
> > services:
> >   gateway:
> >     image: livepeer/go-livepeer:master
> >     ports:
> >       - 1935:1935  # RTMP ingest
> >       - 8935:8935  # HLS/API
> >     volumes:
> >       - gateway-data:/root/.lpData
> >     command: |
> >       -gateway
> >       -network arbitrum-one-mainnet
> >       -rtmpAddr=0.0.0.0:1935
> >       -httpAddr=0.0.0.0:8935
> >       -orchAddr=https://orchestrator.example.com:8935
> >       -transcodingOptions=P240p30fps16x9,P360p30fps16x9,P720p30fps16x9
> >       -ethUrl <YOUR_RPC_URL> \
> >       -ethAcctAddr <YOUR_ETH_ADDRESS> \
> >       -ethPassword <YOUR_PASSWORD> \
> >       -ethKeystorePath <KEYSTORE_PATH> \
> >       -maxPricePerUnit 1000
> >
> > volumes:
> >   gateway-data:
> > EOF
> > ```
> >
> > Start the Gateway
> >
> > ```bash wrap icon="docker" Start the gateway theme={null}
> > # 2. Start the gateway
> > docker-compose up -d
> > ```
>
> > [tab] Binary
> >
> > .
>
> ```bash icon="terminal" theme={null}
> livepeer -gateway \
>   -network arbitrum-one-mainnet \
>   -ethUrl=<YOUR_RPC_URL> \
>   -ethAcctAddr=<YOUR_ETH_ADDRESS> \
>   -ethPassword=<YOUR_PASSWORD> \
>   -ethKeystorePath=<KEYSTORE_PATH> \
>   -maxPricePerUnit=1000 \
>   -orchAddr=<ORCHESTRATOR_ADDRESSES> \
>   -monitor=true
> ```
>
> ## Transcoding Options JSON
>
> Livepeer supports JSON configuration files for transcoding options through the `-transcodingOptions` flag.
>
> The transcodingOptions.json file lets you precisely control the encoding ladder.
>
> This file is a custom configuration file containing an array of rendition objects that defines which renditions (resolutions + bitrates)
> your Gateway will produce for each incoming stream.
>
> It overrides the default built-in ladder (e.g., P240p30fps16x9, etc.).
>
> ```json wrap lines icon="brackets-curly" transcodingOptions.json example theme={null}
> [
>   {
>     // required
>     "bitrate": 1600000,
>     "width": 854,
>     "height": 480,
>     // optional
>     "name": "480p0",
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
>   },
>   {
>     // required
>     "bitrate": 3000000,
>     "width": 1280,
>     "height": 720,
>     // optional
>     "name": "720p0",
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
>   },
>   {
>     // required
>     "bitrate": 6500000,
>     "width": 1920,
>     "height": 1080,
>     // optional
>     "name": "1080p0",
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
>   }
> ]
> ```
>
> #### Notes
>
> * JSON configuration only applies to transcoding options, not other gateway flags
>
> * The file must contain valid JSON with the specified structure
>
> * All fields are optional except width, height, and bitrate
>
> * You can mix JSON configuration with other command-line flags
>
> > [card] [Next Step: Pricing Configuration](/v2/gateways/guides/payments-and-pricing/pricing-configuration.md)
> >
> > Configure pricing for your gateway.
>
> ## Full Configuration Flag Reference
>
> ### Essential Changes
>
> ### Network Configuration
>
> ### Transcoding Settings
>
> ### Production Considerations
>
> **>\_ Configuration Options**
>
> **old docs**
>
> ## Modify Config Files
>
> > [tab] Docker Config (Recommended)
> >
> > Create the transcodingOptions.json file using the above template.
> >
> > ```bash icon="docker" theme={null}
> > nano -p /var/lib/docker/volumes/gateway-lpData/_data/transcodingOptions.json
> > ```
> >
> > Modify the docker-compose.yml file from the root user's home directory */root/*
> > and add the following below `-pixelsPerUnit=1`
> >
> > ```bash icon="docker" theme={null}
> > -transcodingOptions=/root/.lpData/transcodingOptions.json
> > ```
>
> > [tab] Linux Config
> >
> > Create the transcodingOptions.json file using the above template.
> >
> > ```bash icon="linux" theme={null}
> > sudo nano /usr/local/bin/lptConfig/transcodingOptions.json
> > ```
> >
> > Modify the Linux Service file /etc/systemd/system/livepeer.service and add the
> > following below `-pixelsPerUnit=1`
> >
> > ```bash icon="linux" theme={null}
> > -transcodingOptions=/usr/local/bin/lptConfig/transcodingOptions.json \
> > ```
>
> > [tab] Windows Config
> >
> > Create the transcodingOptions.json file using the above template.
> >
> > Open notepad (or your text editor of choice) paste the template above and save
> > the transcodingOptions.json file in the following location.
> >
> > In Windows, **`%USERNAME%`** is already a built-in environment variable
> > -> You can use it directly.
> >
> > ```bash icon="windows" theme={null}
> > C:\Users\%USERNAME%\.lpData\transcodingOptions.json
> > ```
> >
> > Modify Windows bat file to include the following command after
> > `-pixelsPerUnit=1`
> >
> > ```bash icon="windows" theme={null}
> > -transcodingOptions=C:\Users\%USERNAME%\.lpData\transcodingOptions.json
> > ```

> [tab] Dual
>
> The Livepeer Gateway supports a dual setup configuration that enables a single node to handle both
> traditional video transcoding and AI processing workloads simultaneously.
>
> This unified architecture reduces infrastructure complexity while providing
> comprehensive media processing capabilities.
>
> Dual Gateway Architecture: Video & AI Pipelines
>
> ```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 TB
>     subgraph INPUT["Input Sources"]
>         direction LR
>         RTMP["RTMP Stream"]
>         HTTP["HTTP Upload"]
>         AI_REQ["AI Request"]
>     end
>
>     GATEWAY["Gateway Node<br/>LivepeerNode"]
>
>     INPUT --> GATEWAY
>
>     subgraph MANAGERS["Session Managers"]
>         direction LR
>         BSM["BroadcastSessionsManager<br/>Video Transcoding"]
>         ASM["AISessionManager<br/>AI Processing"]
>     end
>
>     GATEWAY --> BSM
>     GATEWAY --> ASM
>
>     subgraph VIDEO["Video Pipeline"]
>         SEG["Segment Processing"]
>         ORCH_V["Orchestrators<br/>Transcoding"]
>         HLS["HLS/DASH Output"]
>     end
>
>     subgraph AI["AI Pipeline"]
>         PROC["AI Processing"]
>         ORCH_AI["Orchestrators<br/>AI Models"]
>         OUT_AI["AI Output<br/>Images/Video"]
>     end
>
>     BSM --> SEG --> ORCH_V --> HLS
>     ASM --> PROC --> ORCH_AI --> OUT_AI
>
>     subgraph PAYMENT["Payment"]
>         direction LR
>         PAY_SEG["Per Segment"]
>         PAY_PIX["Per Pixel"]
>     end
>
>     ORCH_V --> PAY_SEG
>     ORCH_AI --> PAY_PIX
>
>     classDef default fill:#1a1a1a,color:#fff,stroke:#2d9a67,stroke-width:2px
>     classDef video fill:#1a1a1a,color:#fff,stroke:#3b82f6,stroke-width:2px
>     classDef ai fill:#1a1a1a,color:#fff,stroke:#a855f7,stroke-width:2px
>     class RTMP,HTTP,BSM,SEG,ORCH_V,HLS,PAY_SEG video
>     class AI_REQ,ASM,PROC,ORCH_AI,OUT_AI,PAY_PIX ai
>     style INPUT fill:#0d0d0d,stroke:#2d9a67,stroke-width:1px
>     style MANAGERS fill:#0d0d0d,stroke:#2d9a67,stroke-width:1px
>     style VIDEO fill:#0d0d0d,stroke:#3b82f6,stroke-width:1px
>     style AI fill:#0d0d0d,stroke:#a855f7,stroke-width:1px
>     style PAYMENT fill:#0d0d0d,stroke:#2d9a67,stroke-width:1px
> ```
>
> ## Overview
>
> The Gateway's dual capability is enabled by its modular architecture, where different
> managers handle specific workflows while sharing common infrastructure for media ingestion,
> payment processing, and result delivery.
>
> The LivepeerNode struct contains fields for both traditional transcoding (Transcoder, TranscoderManager)
> and AI processing (AIWorker, AIWorkerManager) [livepeernode.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/livepeernode.go)
>
> The gateway determines the processing type based on the request:
>
> * Standard transcoding requests go through the BroadcastSessionsManager
> * AI requests go through the AISessionManager with AI-specific authentication and pipeline selection [ai\_auth.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_auth.go)
>
> The gateway initializes with two distinct session managers:
>
> ```go icon="terminal" theme={null}
> // Traditional transcoding session manager
> sessManager = NewSessionManager(ctx, s.LivepeerNode, params)
> ```
>
> ```go icon="terminal" theme={null}
> // AI processing session manager
> AISessionManager: NewAISessionManager(lpNode, AISessionManagerTTL)
> ```
>
> **Key Differences**
>
> <table>
>   <thead>
>     <tr>
>       Aspect
>
>       Video Transcoding
>
>       AI Pipelines
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       Processing Type
>
>       Format/bitrate conversion
>
>       AI model inference
>     </tr>
>
>     <tr>
>       Session Manager
>
>       `BroadcastSessionsManager`
>
>       `AISessionManager`
>     </tr>
>
>     <tr>
>       Payment Model
>
>       Per segment
>
>       Per pixel processed
>     </tr>
>
>     <tr>
>       Protocol
>
>       Standard HLS/DASH
>
>       Trickle protocol for real-time AI
>     </tr>
>
>     <tr>
>       Components
>
>       RTMP Server, Playlist Manager
>
>       MediaMTX, Trickle Server
>     </tr>
>   </tbody>
> </table>
>
> ## Configuration
>
> To configure a gateway to handle both video transcoding and AI processing, you need
> to set the appropriate flags and options when starting the livepeer binary.
>
> **Essential Flags**
>
> To enable dual setup, configure the gateway with the following flags:
>
> <table>
>   <thead>
>     <tr>
>       Flag
>
>       Description
>
>       Required
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       `-gateway`
>
>       Run as a gateway node
>
>       ✓
>     </tr>
>
>     <tr>
>       `-httpIngest`
>
>       Enable HTTP ingest for AI requests
>
>       ✓
>     </tr>
>
>     <tr>
>       `-transcodingOptions`
>
>       Transcoding profiles for video
>
>       ✓
>     </tr>
>
>     <tr>
>       `-aiServiceRegistry`
>
>       Enable AI service registry
>
>       ✓
>     </tr>
>   </tbody>
> </table>
>
> See: [cmd/livepeer/livepeer.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/cmd/livepeer/livepeer.go)
>
> ### AI-Specific Configuration
>
> ```bash AI flags icon="user-robot" theme={null}
> -aiModels=${env:HOME}/.lpData/cfg/aiModels.json
> -aiModelsDir=${env:HOME}/.lpData/models
> -aiRunnerContainersPerGPU=1
> -livePaymentInterval=5s
> ```
>
> ### Transcoding Configuration
>
> Note, if the `transcodingOptions.json` file is not provided, the gateway will use the default transcoding profiles `-transcodingOptions=P240p30fps16x9,P360p30fps16x9`.
>
> ```bash Transcoding flags icon="film-canister" theme={null}
> # -transcodingOptions=P240p30fps16x9,P360p30fps16x9
> -transcodingOptions=${env:HOME}/.lpData/cfg/transcodingOptions.json
> -maxSessions=10
> -nvidia=all  # or specific GPU IDs
> ```
>
> > [!NOTE]
> >
> > `-nvidia` and NVIDIA drivers are only required for GPU transcoding hosts. A
> > gateway-only routing setup does not require NVIDIA drivers.
>
> ## Deployment
>
> > [tab] Off-Chain Developement Setup
> >
> > For local development and testing purposes, there is no need to connect to the blockchain payments layer.
> >
> > > [!NOTE]
> > >
> > > You will need to run your own orchestrator node for local development.
> >
> > ```bash Off-Chain Gateway Deployment with dual capabilities icon="terminal" theme={null}
> > livepeer -gateway \
> >     -httpIngest \
> >     -transcodingOptions=${env:HOME}/.lpData/offchain/transcodingOptions.json \
> >     -orchAddr=0.0.0.0:8935 \
> >     -httpAddr=0.0.0.0:9935 \
> >     -httpIngest \
> >     -v=6
> >
> >     # Verify these
> >     -aiServiceRegistry \
> >     -aiModels=${env:HOME}/.lpData/cfg/aiModels.json \
> >     -aiModelsDir=${env:HOME}/.lpData/models \
> >     -aiRunnerContainersPerGPU=1 \
> > ```
>
> > [tab] On-Chain Production Setup
> >
> > For production deployment with blockchain integration
> >
> > You will need an ETH account with funds to pay for transcoding and AI processing and set the following environment variables:
> > `$ETH_SECRET`
> > `$ETH_ACCT_ADDR`
> >
> > ```bash On-Chain Gateway Deployment with dual capabilities icon="terminal" theme={null}
> > livepeer -gateway \
> >     -transcodingOptions=${env:HOME}/.lpData/offchain/transcodingOptions.json \
> >     -orchAddr=0.0.0.0:8935 \
> >     -httpAddr=0.0.0.0:9935 \
> >     -httpIngest \
> >     -v=6 \
> >     -network=arbitrum-one-mainnet \
> >     -ethUrl=https://arb1.arbitrum.io/rpc \
> >     -ethPassword=<ETH_SECRET> \
> >     -ethAcctAddr=<ETH_ACCT_ADDR> \
> >     -v=6
> >
> >     # verfiy these
> >     -aiServiceRegistry \
> >     -aiModels=${env:HOME}/.lpData/cfg/aiModels.json \
> >     -aiModelsDir=${env:HOME}/.lpData/models \
> >     -aiRunnerContainersPerGPU=1 \
> >     -livePaymentInterval=5s
> > ```
>
> ## Combined Gateway/Orchestrator AI-Enabled Deployment
>
> For nodes that handle both orchestration and AI processing
>
> ```bash Combined Gateway/OrchestratorOn-Chain Deployment icon="terminal" theme={null}
>
>     livepeer -orchestrator -aiWorker -aiServiceRegistry \
>         -serviceAddr=0.0.0.0:8935 \
>         -nvidia=all \
>         -aiModels=${env:HOME}/.lpData/cfg/aiModels.json \
>         -aiModelsDir=${env:HOME}/.lpData/models \
>         -network=arbitrum-one-mainnet \
>         -ethUrl=https://arb1.arbitrum.io/rpc \
>         -ethPassword=<ETH_SECRET> \
>         -ethAcctAddr=<ETH_ACCT_ADDR> \
>         -ethOrchAddr=<ORCH_ADDR>
> ```
>
> ## Troubleshooting
>
> **Common Issues**
>
> * **AI models not loading:** Check `-aiModelsDir` and model file permissions
> * **GPU transcoding failures:** Verify NVIDIA drivers and `-nvidia` configuration (only required for GPU transcoding hosts)
> * **Port conflicts:** Ensure `-rtmpAddr`, `-httpAddr`, and `-cliAddr` are available
> * **Memory pressure:** Monitor AI model memory usage, adjust `-aiRunnerContainersPerGPU`
>
> **Debug Commands**
>
> ```bash icon="terminal" theme={null}
>     # Check transcoding capabilities
>     curl http://localhost:8935/getBroadcastConfig
>
>     # Test AI endpoint
>     curl -X POST http://localhost:8935/text-to-image \
>     -H "Content-Type: application/json" \
>     -d '{"prompt":"test image"}'
>
>     # Monitor logs
>     livepeer -gateway -v=6 2>&1 | grep -E "(transcode|AI|segment)"
> ```
>
> ## Example Setup
>
> The box setup for local development demonstrates running a gateway that handles both types of processing.
>
> > [!NOTE]
> >
> > The embedded `box/box.md` excerpt is unavailable in this docs branch.
> > Review the full example setup in the upstream repository:
> > [livepeer/go-livepeer `box/box.md`](https://github.com/livepeer/go-livepeer/blob/master/box/box.md).


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