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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ request when unset, which selects the server defaults.
(`decart::Speed::Fast`, sent as `speed=fast`) serves the session from a
higher-compute tier for lower latency and higher throughput; output quality is
unchanged. It is currently available for `lucy-2.5` / `lucy-latest` and
`lucy-vton-3.5` / `lucy-vton-latest`, in the US region only, and is billed at 2x
`lucy-vton-3.5` / `lucy-vton-3.6` / `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 (the
SDK logs a warning). Omit it (the default) for standard mode.
`ModelDefinition::supportedSpeeds` lists the tiers a model advertises.
Expand Down
5 changes: 3 additions & 2 deletions examples/realtime_warmup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
//
// DECART_API_KEY=sk-... ./realtime_warmup [model]
//
// Set DECART_SPEED=fast to request fast mode (lucy-2.5 / lucy-vton-3.5 families
// only; US region; billed at 2x the standard realtime rate).
// Set DECART_SPEED=fast to request fast mode (lucy-2.5 family and
// lucy-vton-3.5 / lucy-vton-3.6 / lucy-vton-latest only; US region; billed at
// 2x the standard realtime rate).
//
#include <decart/decart.h>
#include <livekit/livekit.h>
Expand Down
4 changes: 3 additions & 1 deletion include/decart/models.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ namespace models {
///
/// Accepts canonical names ("lucy-2.1", "lucy-2.5", "lucy-vton-3.5",
/// "lucy-vton-3.6", "lucy-restyle-2") and server-resolved aliases
/// ("lucy-latest", "lucy-vton-latest", "lucy-restyle-latest").
/// ("lucy-latest", "lucy-vton-latest", "lucy-restyle-latest"). Aliases are
/// resolved by the server; e.g. "lucy-vton-latest" currently serves
/// "lucy-vton-3.6".
///
/// @throws Exception(ErrorCode::ModelNotFound) if the name is unknown.
ModelDefinition realtime(std::string_view name);
Expand Down
2 changes: 1 addition & 1 deletion include/decart/realtime/realtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct ConnectOptions {
/// Optional compute tier. `Speed::Fast` serves the session from a
/// higher-compute tier for lower latency and higher throughput; output quality
/// is unchanged. Currently available for `lucy-2.5` / `lucy-latest` and
/// `lucy-vton-3.5` / `lucy-vton-latest` (see
/// `lucy-vton-3.5` / `lucy-vton-3.6` / `lucy-vton-latest` (see
/// `ModelDefinition::supportedSpeeds`), in the US region only, and billed at
/// 2x the standard realtime rate for those models. Other models ignore the
/// option (the SDK logs a warning). Leave unset (the default) for standard mode.
Expand Down
4 changes: 2 additions & 2 deletions include/decart/realtime/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const char* toString(ConnectionState state) noexcept;
enum class Speed {
/// Fast mode: serves the session from a higher-compute tier for lower latency
/// and higher throughput; output quality is unchanged. Currently available
/// for `lucy-2.5` / `lucy-latest` and `lucy-vton-3.5` / `lucy-vton-latest`,
/// in the US region only, and billed at 2x the standard realtime rate for
/// for `lucy-2.5` / `lucy-latest` and `lucy-vton-3.5` / `lucy-vton-3.6` /
/// `lucy-vton-latest`, in the US region only, and billed at 2x the standard realtime rate for
/// those models. Other models ignore it.
Fast,
};
Expand Down
4 changes: 2 additions & 2 deletions src/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ constexpr std::array<Entry, 8> kRealtime = {{
{"lucy-2.1", 30, 1088, 624, true},
{"lucy-2.5", 30, 1280, 720, true, /*fastSpeed=*/true},
{"lucy-vton-3.5", 30, 1280, 720, true, /*fastSpeed=*/true},
{"lucy-vton-3.6", 30, 1280, 720, true},
{"lucy-vton-3.6", 30, 1280, 720, true, /*fastSpeed=*/true},
{"lucy-restyle-2", 30, 1280, 704, true},
// Server-resolved "latest" aliases
{"lucy-latest", 30, 1088, 624, false, /*fastSpeed=*/true},
// Resolves server-side to lucy-vton-3.5.
// Resolves server-side to lucy-vton-3.6.
{"lucy-vton-latest", 30, 1280, 720, false, /*fastSpeed=*/true},
{"lucy-restyle-latest", 30, 1280, 704, false},
}};
Expand Down
23 changes: 16 additions & 7 deletions tests/test_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") {
CHECK(vton36.fps == 30);
CHECK(vton36.width == 1280);
CHECK(vton36.height == 720);
// 3.6 is not offered on the fast tier, unlike 3.5.
CHECK(vton36.supportedSpeeds.empty());
// 3.6 is offered on the fast tier, like 3.5.
REQUIRE(vton36.supportedSpeeds.size() == 1);
CHECK(static_cast<int>(vton36.supportedSpeeds[0]) == static_cast<int>(Speed::Fast));

auto lucy25 = models::realtime("lucy-2.5");
CHECK(lucy25.name == "lucy-2.5");
Expand All @@ -42,11 +43,18 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") {
CHECK(lucy25.height == 720);
}

TEST_CASE("realtime() accepts latest aliases") {
TEST_CASE("realtime() accepts latest aliases (lucy-vton-latest resolves server-side to lucy-vton-3.6)") {
CHECK(models::realtime("lucy-latest").urlPath == "/v1/stream");
CHECK(models::realtime("lucy-vton-latest").name == "lucy-vton-latest");
CHECK(models::realtime("lucy-vton-latest").width == 1280);
CHECK(models::realtime("lucy-vton-latest").height == 720);
// lucy-vton-latest resolves server-side to lucy-vton-3.6; the client-side
// geometry must match the model it serves.
const auto vtonLatest = models::realtime("lucy-vton-latest");
const auto vton36 = models::realtime("lucy-vton-3.6");
CHECK(vtonLatest.fps == vton36.fps);
CHECK(vtonLatest.width == vton36.width);
CHECK(vtonLatest.height == vton36.height);
}

TEST_CASE("realtime() throws ModelNotFound for unknown names") {
Expand All @@ -61,7 +69,7 @@ TEST_CASE("realtime() throws ModelNotFound for unknown names") {
}
}

TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy-vton-3.5 families") {
TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy-vton-3.5/3.6 families") {
// Compare via integer form: doctest stringifies enums through our ADL
// toString() (which returns const char*) and cannot concatenate that.
const auto fastOnly = std::vector<int>{static_cast<int>(Speed::Fast)};
Expand All @@ -74,9 +82,11 @@ TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy
CHECK(speeds(models::realtime("lucy-2.5")) == fastOnly);
CHECK(speeds(models::realtime("lucy-latest")) == fastOnly);
CHECK(speeds(models::realtime("lucy-vton-3.5")) == fastOnly);
CHECK(speeds(models::realtime("lucy-vton-3.6")) == fastOnly);
CHECK(speeds(models::realtime("lucy-vton-latest")) == fastOnly);

const std::set<std::string> withFast = {"lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-latest"};
const std::set<std::string> withFast = {"lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-3.6",
"lucy-vton-latest"};
for (const auto& m : models::listRealtime(/*canonicalOnly=*/false)) {
INFO("model " << m.name);
if (withFast.count(m.name)) {
Expand All @@ -85,10 +95,9 @@ TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy
CHECK(m.supportedSpeeds.empty());
}
}
// Every other realtime model (lucy-2.1, lucy-vton-3.6, lucy-restyle-2, lucy-restyle-latest)
// Every other realtime model (lucy-2.1, lucy-restyle-2, lucy-restyle-latest)
// is standard-only.
CHECK(models::realtime("lucy-2.1").supportedSpeeds.empty());
CHECK(models::realtime("lucy-vton-3.6").supportedSpeeds.empty());
CHECK(models::realtime("lucy-restyle-2").supportedSpeeds.empty());
CHECK(models::realtime("lucy-restyle-latest").supportedSpeeds.empty());
}
Expand Down
1 change: 1 addition & 0 deletions tests/test_stream_url.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ TEST_CASE("supportsSpeed reflects ModelDefinition::supportedSpeeds") {
CHECK(supportsSpeed(models::realtime("lucy-2.5"), Speed::Fast));
CHECK(supportsSpeed(models::realtime("lucy-latest"), Speed::Fast));
CHECK(supportsSpeed(models::realtime("lucy-vton-3.5"), Speed::Fast));
CHECK(supportsSpeed(models::realtime("lucy-vton-3.6"), Speed::Fast));
CHECK(supportsSpeed(models::realtime("lucy-vton-latest"), Speed::Fast));
CHECK_FALSE(supportsSpeed(models::realtime("lucy-2.1"), Speed::Fast));
CHECK_FALSE(supportsSpeed(models::realtime("lucy-restyle-2"), Speed::Fast));
Expand Down
Loading