Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Example **apps that run on** the Livepeer **live runner** — [go-livepeer](http
The point is to **swap the compute without changing your app — permissionlessly, no lock-in**. Your app stays a plain service with little or no Livepeer-specific code, so you're never tied to us. And the network is permissionless: anyone can run or extend it, no one gatekeeps what you deploy, and no single party can take your app down. Write the app once; **move the compute freely**.

> [!NOTE]
> Live runners ship in mainline go-livepeer since [v0.9.0](https://github.com/livepeer/go-livepeer/releases/tag/v0.9.0). The Python SDK is installed from its `main` branch until it is published to PyPI.
> Live runners ship in mainline go-livepeer since [v0.9.0](https://github.com/livepeer/go-livepeer/releases/tag/v0.9.0), and the Python SDK is on PyPI as [`livepeer-gateway`](https://pypi.org/project/livepeer-gateway/).

## How it works

Expand Down Expand Up @@ -110,12 +110,12 @@ Each example is self-contained and its README has the run commands. Everything b

### Prerequisites

- **Docker** for the end-to-end demos, so there is nothing to build. They currently run a mainline `livepeer/go-livepeer` master build rather than a release image: metered pricing needs the session-scoped payment URL added after v0.9.0 ([#4008](https://github.com/livepeer/go-livepeer/pull/4008)). They move back to a release tag once one carries it.
- **Docker** for the end-to-end demos, so there is nothing to build. They run the `livepeer/go-livepeer:v0.9.1` release image.
- **Python 3.12+** and [`uv`](https://docs.astral.sh/uv/) for the client.
- The **`livepeer-gateway` SDK** from its `main` branch (not yet on PyPI):
- The **[`livepeer-gateway` SDK](https://pypi.org/project/livepeer-gateway/)** (`uv run` installs it for you from each app's `pyproject.toml`):

```sh
pip install "git+https://github.com/livepeer/livepeer-python-gateway@main"
pip install "livepeer-gateway>=1.0.0"
```

### Shared components
Expand Down
2 changes: 1 addition & 1 deletion api-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The live runner can also **pass calls through to an API that runs somewhere else
| Pricing | fixed (one price per call) |
| Port | 8989 |

Prerequisites (Docker, `uv`, and the not-yet-released `livepeer-gateway` SDK — pinned in `pyproject.toml`) and the shared on-chain/payment setup live in the [repo README](../README.md). The demo upstream additionally needs a **Hugging Face API token** (`HF_TOKEN`, from [huggingface.co → settings → tokens](https://huggingface.co/settings/tokens)) with inference-provider credits.
Prerequisites (Docker, `uv`, and the [`livepeer-gateway` SDK](https://pypi.org/project/livepeer-gateway/)) and the shared on-chain/payment setup live in the [repo README](../README.md). The demo upstream additionally needs a **Hugging Face API token** (`HF_TOKEN`, from [huggingface.co → settings → tokens](https://huggingface.co/settings/tokens)) with inference-provider credits.

## How it's wired

Expand Down
6 changes: 1 addition & 5 deletions api-proxy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ description = "API proxy example app for the Livepeer network."
requires-python = ">=3.12"
dependencies = [
"aiohttp",
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
2 changes: 1 addition & 1 deletion compose.onchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
services:
signer:
# Master build, matching the orchestrator; see compose.orchestrator.yml.
image: livepeer/go-livepeer:sha-cc49228
image: livepeer/go-livepeer:v0.9.1
container_name: example_apps_signer
command:
- -remoteSigner
Expand Down
2 changes: 1 addition & 1 deletion compose.orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

services:
orchestrator:
image: livepeer/go-livepeer:sha-cc49228
image: livepeer/go-livepeer:v0.9.1
container_name: example_apps_orchestrator
# Two distinct addresses:
# serviceAddr advertised to external clients in discovery responses,
Expand Down
6 changes: 1 addition & 5 deletions echo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ FROM python:3.12-slim
# Flush stdout/stderr immediately so output isn't block-buffered in `docker logs`.
ENV PYTHONUNBUFFERED=1

RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

# livepeer-gateway SDK isn't on PyPI yet; install from Git. av (PyAV) ships its
# own ffmpeg; opencv-python-headless needs no system GUI libs.
RUN pip install --no-cache-dir \
"livepeer-gateway @ git+https://github.com/livepeer/livepeer-python-gateway@main" \
"livepeer-gateway>=1.0.0" \
av opencv-python-headless aiohttp

WORKDIR /app
Expand Down
6 changes: 3 additions & 3 deletions echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A realtime video app on the Livepeer network: it receives a live video stream ov
| Pricing | hour (metered per second) |
| Port | 8989 |

Prerequisites (Docker, `uv`, the not-yet-released SDK) and the shared setup are in the [repo README](../README.md).
Prerequisites (Docker, `uv`, the [SDK](https://pypi.org/project/livepeer-gateway/)) and the shared setup are in the [repo README](../README.md).

## How it's wired

Expand Down Expand Up @@ -115,12 +115,12 @@ A metered session pays **more than once**. The upfront payment that answers the

## Run without Docker

Start an orchestrator built from go-livepeer `v0.9.0` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:
Start an orchestrator built from go-livepeer `v0.9.1` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:

```sh
./livepeer -orchestrator -useLiveRunners -serviceAddr localhost:8935 -orchSecret abcdef -v 6
uv run runner.py --orchestrator https://localhost:8935 --orchSecret abcdef
uv run client.py --mode blur sample.mp4
```

The paid path needs a newer orchestrator than the offchain one: metered sessions rely on the session-scoped payment URL added after `v0.9.0` ([#4008](https://github.com/livepeer/go-livepeer/pull/4008)), which is why the compose files pin a master build.
Metered sessions rely on the session-scoped payment URL added in `v0.9.1` ([#4008](https://github.com/livepeer/go-livepeer/pull/4008)), which is the release the compose files pin.
6 changes: 1 addition & 5 deletions echo/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ dependencies = [
"opencv-python-headless", # runner: gray/invert/blur transforms
"numpy", # runner: robot ring modulation
"aiohttp",
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
7 changes: 1 addition & 6 deletions hello-world/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ FROM python:3.12-slim
# Flush stdout/stderr immediately so output isn't block-buffered in `docker logs`.
ENV PYTHONUNBUFFERED=1

RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

# livepeer-gateway SDK isn't on PyPI yet; install from Git.
RUN pip install --no-cache-dir \
"livepeer-gateway @ git+https://github.com/livepeer/livepeer-python-gateway@main"
"livepeer-gateway>=1.0.0"

WORKDIR /app
COPY runner.py client.py ./
Expand Down
4 changes: 2 additions & 2 deletions hello-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The smallest possible app on the Livepeer network: a synchronous request/respons
| Pricing | fixed (one price per call) |
| Port | 8989 |

Prerequisites (Docker, `uv`, and the not-yet-released `livepeer-gateway` SDK — pinned in `pyproject.toml`) and the shared on-chain/payment setup live in the [repo README](../README.md).
Prerequisites (Docker, `uv`, and the [`livepeer-gateway` SDK](https://pypi.org/project/livepeer-gateway/)) and the shared on-chain/payment setup live in the [repo README](../README.md).

## How it's wired

Expand Down Expand Up @@ -47,7 +47,7 @@ The app registers with a price (`--price` from `.env`, in USD billed once per ca

## Run without Docker

Start an orchestrator built from go-livepeer `v0.9.0` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:
Start an orchestrator built from go-livepeer `v0.9.1` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:

```sh
./livepeer -orchestrator -useLiveRunners -serviceAddr localhost:8935 -orchSecret abcdef -v 6
Expand Down
6 changes: 1 addition & 5 deletions hello-world/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ version = "0.1.0"
description = "Hello-world example app for the Livepeer network."
requires-python = ">=3.12"
dependencies = [
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
6 changes: 1 addition & 5 deletions realtime-transcription/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ FROM python:3.12-slim
# Flush stdout/stderr immediately so output isn't block-buffered in `docker logs`.
ENV PYTHONUNBUFFERED=1

RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

# livepeer-gateway SDK isn't on PyPI yet; install from Git. CTranslate2 (under
# faster-whisper) loads cuBLAS/cuDNN from the nvidia wheels, so no CUDA base image
# is needed -- the host driver comes in via the compose `deploy` reservation.
RUN pip install --no-cache-dir \
faster-whisper numpy \
nvidia-cublas-cu12 nvidia-cudnn-cu12 \
"livepeer-gateway @ git+https://github.com/livepeer/livepeer-python-gateway@main"
"livepeer-gateway>=1.0.0"

ENV LD_LIBRARY_PATH=/usr/local/lib/python3.12/site-packages/nvidia/cublas/lib:/usr/local/lib/python3.12/site-packages/nvidia/cudnn/lib

Expand Down
4 changes: 2 additions & 2 deletions realtime-transcription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Realtime speech-to-text on the Livepeer network over a **WebSocket** — the cli
| Transport | WebSocket (`/transcribe`) |
| Port | 8989 |

**Requires an NVIDIA GPU.** The model is fixed at `large-v3-turbo`: it swaps large-v3's 32-layer decoder for 4, so it runs far below realtime on a 3090 while staying near large-v3 quality. The device is pinned with it (`cuda`/`float16`) rather than exposed as a flag: on CPU the model loads but falls behind a live stream, which is the one thing this example is about. Prerequisites (Docker, `uv`, the not-yet-released SDK) and the shared on-chain/payment setup are in the [repo README](../README.md).
**Requires an NVIDIA GPU.** The model is fixed at `large-v3-turbo`: it swaps large-v3's 32-layer decoder for 4, so it runs far below realtime on a 3090 while staying near large-v3 quality. The device is pinned with it (`cuda`/`float16`) rather than exposed as a flag: on CPU the model loads but falls behind a live stream, which is the one thing this example is about. Prerequisites (Docker, `uv`, the [SDK](https://pypi.org/project/livepeer-gateway/)) and the shared on-chain/payment setup are in the [repo README](../README.md).

## How it's wired

Expand Down Expand Up @@ -85,7 +85,7 @@ docker compose -f compose.yml -f compose.onchain.yml down

## Run without Docker

Start an orchestrator built from go-livepeer `v0.9.0` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly (the app needs `faster-whisper` installed):
Start an orchestrator built from go-livepeer `v0.9.1` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly (the app needs `faster-whisper` installed):

```sh
./livepeer -orchestrator -useLiveRunners -serviceAddr localhost:8935 -orchSecret abcdef -v 6
Expand Down
6 changes: 1 addition & 5 deletions realtime-transcription/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ dependencies = [
"faster-whisper", # runner: streaming Whisper ASR
"numpy", # runner: PCM buffers + energy VAD
"aiohttp",
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
7 changes: 1 addition & 6 deletions tiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ FROM python:3.12-slim
# Flush stdout/stderr immediately so output isn't block-buffered in `docker logs`.
ENV PYTHONUNBUFFERED=1

RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

# livepeer-gateway SDK isn't on PyPI yet; install from Git.
# opencv-python-headless needs no system GUI libs.
RUN pip install --no-cache-dir \
"livepeer-gateway @ git+https://github.com/livepeer/livepeer-python-gateway@main" \
"livepeer-gateway>=1.0.0" \
opencv-python-headless numpy aiohttp

WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions tiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ An image processor on the Livepeer network that shows what **capacity** does. It
| Pricing | fixed (one price per tile call) |
| Port | 8989 |

Prerequisites (Docker, `uv`, and the not-yet-released `livepeer-gateway` SDK — pinned in `pyproject.toml`) and the shared on-chain/payment setup live in the [repo README](../README.md).
Prerequisites (Docker, `uv`, and the [`livepeer-gateway` SDK](https://pypi.org/project/livepeer-gateway/)) and the shared on-chain/payment setup live in the [repo README](../README.md).

## How it's wired

Expand Down Expand Up @@ -63,7 +63,7 @@ Each tile is one paid single-shot call — the orchestrator reserves a session f

## Run without Docker

Start an orchestrator built from go-livepeer `v0.9.0` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:
Start an orchestrator built from go-livepeer `v0.9.1` or newer (see [Build from source](https://docs.livepeer.org/v1/orchestrators/guides/install-go-livepeer#build-from-source)), then the app and client directly:

```sh
./livepeer -orchestrator -useLiveRunners -serviceAddr localhost:8935 -orchSecret abcdef -v 6
Expand Down
6 changes: 1 addition & 5 deletions tiles/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ dependencies = [
"opencv-python-headless", # runner: stylize tiles; client: split/stitch
"numpy",
"aiohttp",
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
2 changes: 1 addition & 1 deletion vllm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Runs an OpenAI-compatible LLM on the Livepeer network and consumes it with the *
| Pricing | hour (metered per second of the call) |
| Port | 8000 (vLLM), 8080 (gateway) |

**Requires an NVIDIA GPU** for vLLM. The model (`Qwen/Qwen2.5-0.5B-Instruct`) is tiny so it fits a modest card; serving a different one means changing `compose.yml` and `runners.json` together. Prerequisites (Docker, `uv`, the not-yet-released SDK) and the shared on-chain/payment setup are in the [repo README](../README.md).
**Requires an NVIDIA GPU** for vLLM. The model (`Qwen/Qwen2.5-0.5B-Instruct`) is tiny so it fits a modest card; serving a different one means changing `compose.yml` and `runners.json` together. Prerequisites (Docker, `uv`, the [SDK](https://pypi.org/project/livepeer-gateway/)) and the shared on-chain/payment setup are in the [repo README](../README.md).

## How it's wired

Expand Down
6 changes: 1 addition & 5 deletions vllm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ description = "vLLM (OpenAI-compatible LLM) example app for the Livepeer network
requires-python = ">=3.12"
dependencies = [
"aiohttp", # for gateway.py (the OpenAI -> Livepeer gateway)
"livepeer-gateway",
"livepeer-gateway>=1.0.0",
"openai", # for client.py (stock OpenAI library)
]

# livepeer-gateway is not on PyPI yet; pull it from the branch.
[tool.uv.sources]
livepeer-gateway = { git = "https://github.com/livepeer/livepeer-python-gateway", branch = "main" }
Loading