feat(realtime): add speed="fast" option and supported_speeds model capability - #70
Open
AdirAmsalem wants to merge 2 commits into
Open
AdirAmsalem wants to merge 2 commits into
AdirAmsalem wants to merge 2 commits into
Conversation
…pability
Add an optional `speed` on `RealtimeConnectOptions` (`RealtimeSpeed = Literal["fast"]`),
appended to the signaling URL as `&speed=fast` exactly like `resolution` and omitted when
unset, so the default path produces byte-identical URLs. The LiveKit manager redials with
the stored URL, so reconnects keep the parameter.
Expose the tier as a model capability via `ModelDefinition.supported_speeds` (default `()`),
set to `("fast",)` on the realtime entries lucy-2.5, lucy-latest, lucy-vton-3.5 and
lucy-vton-latest only. Passing `speed` for any other model emits a one-shot UserWarning
and still sends the parameter (the server ignores it).
Export `RealtimeSpeed` from `decart` and `decart.realtime`, document fast mode in the
README and examples README, add a `--speed fast` flag to the playground, and add unit
tests for the URL building, warning, reconnect and capability pin.
AdirAmsalem
marked this pull request as ready for review
September 23, 2026 15:13
The two warning tests recorded every warning in their window and asserted on the total. On some Python versions aiohttp "Unclosed client session" ResourceWarnings from sessions created by earlier tests are raised during GC inside that window, which made the assertion order-dependent. Filter the recorded warnings down to the speed warning before asserting.
This branch has not been deployed
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
Adds fast mode to the realtime API in the Python SDK.
Fast mode (
speed="fast") serves the session from a higher-compute tier for lower latency and higher throughput; output quality is unchanged. It is currently available forlucy-2.5/lucy-latestandlucy-vton-3.5/lucy-vton-latest, in the US region only, and is billed at 2x the standard realtime rate for those models. Other models ignore the option. Omit it (the default) for standard mode.What changes for users:
RealtimeConnectOptionsaccepts an optionalspeed(typeRealtimeSpeed, exported fromdecartanddecart.realtime), alongside the existingresolutionoption. It is kept across automatic reconnects.supported_speeds, so callers can check capability before connecting. Passingspeedfor a model that does not support it emits a one-time warning and the session proceeds in standard mode.--speed fast) document the option.Usage
Docs: https://docs.platform.decart.ai/sdks/python
Verification
Live test (production API, 2026-09-23 15:04 UTC)
Ran the SDK's own
RealtimeClient.connectpath from a sandbox with a synthetic LiveKit video source, held each session ~5s, then disconnected. Every case reachedconnectedthengeneratingand received a remote inference track with ~90 frames in 5s.speedlucy-2.5lucy-2.5"fast"lucy-vton-3.5"fast"lucy-2.1"fast"Compatibility
Additive and backward compatible:
speeddefaults to unset, the default connection path is unchanged (pinned by a test), and no model ids, aliases, or defaults change. No version bump.