Conversation
Add LiveKit configuration, admission scheduling, token issuance, room workers, media bridging, and session lifecycle APIs. Route stream-serve through the LiveKit runtime while keeping the legacy transport available for the later removal commit. Verification: - .venv/bin/python -m pytest tests/unit/service/livekit --ignore=tests/unit/service/livekit/test_demo.py -q - 42 passed - git diff --cached --check
Use the standalone sageattention package as the only SageAttention backend source, avoiding the tf-kernel path that triggered CUDA misaligned-address failures. Verification: PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m pytest tests/unit/ops/test_attention_backends.py tests/unit/service/livekit -q; ruff check and ruff format --check on the changed attention and LiveKit files; git diff --check.
Add the shared camera-control UI and LiveKit browser adapter with TURN relay configuration, reliable control messages, video playback, and streaming telemetry. Cover the rendered page and LingBot example defaults. Verification: - .venv/bin/python -m pytest tests/unit/service/livekit/test_demo.py tests/unit/pipelines/lingbot_world_fast/test_stream_example.py -q - 7 passed - git diff --cached --check
Keep actor-stage work asynchronous while reporting queue, pipeline, and applied-control latency separately. Preserve v2 camera intrinsics, rebalance translation controls, and make session stop and cache release behavior deterministic. Verification: - .venv/bin/python -m pytest tests/unit/pipelines/lingbot_world_fast/test_service_action_loop.py tests/unit/pipelines/lingbot_world_fast/test_service_metrics.py tests/unit/pipelines/lingbot_world_v2/test_service.py -q - 52 passed - git diff --cached --check
Make LiveKit the only stream transport, remove direct SDP and WebRTC API routes, delete the legacy aiortc session implementation and browser clients, and retain server-push support through the unified stream service contract. Verification: - .venv/bin/python -m pytest tests/unit/service -q - 182 passed - git diff --cached --check
Remove aiortc-specific LingBot stream benchmark contracts, configs, data, and helper scripts. Keep AIPerf documentation explicit that a validated LiveKit client adapter is required before streaming benchmarks are restored. Verification: - bash -n scripts/setup_aiperf_repo.sh - no references to removed stream benchmark assets - git diff --cached --check
Rewrite the English and Chinese stream guides around LiveKit sessions, data topics, deployment, and lifecycle. Add a root README quickstart that launches coturn, LiveKit, TeleFuser, and the browser controller with VS Code port forwarding, health checks, troubleshooting, and shutdown order. Verification: - .venv/bin/mkdocs build --strict --site-dir /tmp/telefuser-docs-livekit-rewrite - no aiortc, old SDP route, or legacy Demo references remain - git diff --cached --check
Add PyAV as a direct base dependency because the LiveKit media bridge imports it after aiortc is removed. Stop CI from requesting the deleted webrtc extra and install the standard development dependency set instead. Verification: - .venv/bin/python -m pip install --dry-run -e .[dev] - .venv/bin/python -m pytest tests/unit/service/livekit/test_app.py tests/unit/service/livekit/test_media_bridge.py tests/unit/service/livekit/test_runtime.py tests/unit/service/livekit/test_worker.py -q - 16 passed - GitHub Actions workflow YAML parsed successfully - git diff --cached --check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes LiveKit the single WebRTC streaming transport for TeleFuser.
It adds LiveKit-backed session APIs, admission scheduling, scoped token issuance, room workers, media bridging, reliable control messages, and browser reconnection support for both
ServerPushServiceandBidirectionalService.It also removes the legacy direct-aiortc transport, SDP endpoints, browser clients, unsupported WebRTC benchmark assets, and duplicate streaming paths. The documentation now includes a complete coturn + LiveKit + TeleFuser + browser workflow.
Motivation
TeleFuser previously maintained two WebRTC implementations with different session, control, media, and cache-lifecycle behavior. The direct aiortc path was difficult to operate reliably and did not provide the room lifecycle, reconnection handling, and transport management required by long-running interactive generation.
Using LiveKit as the single transport provides:
Type of Change
Changes Made
Added the LiveKit streaming runtime:
tf.control,tf.status, andtf.metricsdata topics.Unified
telefuser stream-serveon LiveKit:ServerPushServiceandBidirectionalService./v1/stream/sessionsas the canonical session API.Added the maintained browser control Demo:
Improved LingBot real-time streaming:
Removed the legacy direct WebRTC implementation:
aiortcdependency./v1/stream/webrtc/*SDP routes.Removed unsupported streaming benchmark assets:
Updated documentation:
Updated SageAttention loading:
sageattentionpackage.tf-kernel.Breaking Changes
telefuser stream-servenow uses LiveKit exclusively./v1/stream/webrtc/*SDP API has been removed.aiortcdependency and implementation have been removed.examples/stream_server/livekit_bidirectional_demo.py/v1/stream/sessionsand join the returned LiveKit room.Testing
Test commands:
Pre-commit
ruffandruff-formathooks passed for all code commits.Manual end-to-end validation was performed with:
tf.control.The client successfully received an
832 × 464video frame and status messages covering control application, prompt encoding, runtime allocation, denoising, VAE decoding, and chunk delivery. Session cleanup returned the worker to idle and released all session caches.Checklist
ruff)[TYPE] Brief descriptionpytest tests/pre-commit run --all-filesexecutedRelated Issues
N/A
Additional Notes
The checked-in browser Demo intentionally forces TCP TURN relay using development credentials so it works through VS Code Remote SSH port forwarding. These credentials, loopback addresses, disabled TURN TLS, and
--allow-loopback-peersmust not be used in production.The current runtime supports one in-process model worker per service process. Additional workers should use separate service processes until process-worker isolation is implemented.
The removed AIPerf stream benchmark assets depended on the old direct-WebRTC transport. A LiveKit-aware client adapter should be implemented and validated before those benchmarks are restored.
GPU Architecture Support
No CUDA or Triton kernels are added or modified by this PR.
The end-to-end LingBot streaming workflow was manually validated on four NVIDIA H100 GPUs.
Performance Impact
This PR does not claim a model-compute speedup.
The LingBot actor scheduler continues to overlap encode, DiT, and decode stages. Runtime telemetry now separates:
The transport migration is expected to improve connection lifecycle and browser stability. Formal delivery-latency and throughput comparisons require a future LiveKit-aware AIPerf adapter.