Skip to content

Initial Decart C++ SDK#1

Merged
AdirAmsalem merged 2 commits into
mainfrom
decart-cpp-sdk-realtime
Jun 18, 2026
Merged

Initial Decart C++ SDK#1
AdirAmsalem merged 2 commits into
mainfrom
decart-cpp-sdk-realtime

Conversation

@AdirAmsalem

@AdirAmsalem AdirAmsalem commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Decart C++ SDK 🎉

This adds a first-class C++ SDK so native apps, desktop tools, robotics, and game/engine integrations can use Decart's realtime models directly — no browser or Python runtime required. It rounds out our SDK lineup with the same concepts and ergonomics developers already know, in idiomatic, modern C++.

What you can do

  • Transform video in realtime — stream frames to a model and get the transformed frames back, and steer the look live with prompts and reference images.
  • Authenticate — mint short-lived client tokens from a server-side API key.

Usage

#include <decart/decart.h>
#include <livekit/livekit.h>

decart::Client client;                                   // reads DECART_API_KEY
auto model  = decart::models::realtime("lucy-2.1");
auto source = std::make_shared<livekit::VideoSource>(model.width, model.height);

decart::ConnectOptions opts;
opts.model = model;
opts.initialState.prompt = decart::Prompt{"put them all in space"};
opts.onRemoteFrame = [](const livekit::VideoFrame& frame, std::int64_t) {
  // render / encode the transformed frame
};

auto session = client.realtime().connect(source, opts);
// ... push your camera/render frames into `source` ...
session->setPrompt("a watercolor painting");   // change the look on the fly
session->disconnect();

// Auth: short-lived client token for untrusted clients
auto token = client.tokens().create();

Notes

  • Easy to adopt: pulls its dependencies automatically via CMake (works with or without vcpkg), ships runnable examples (including streaming a video file through a model and saving the result), unit tests, and CI for Linux, macOS, and Windows.
  • Lightweight option: an auth/tokens-only build is available for backends that only mint tokens and don't need the realtime stack.
  • Verified end-to-end against production for both token creation and a full video transform.

Scope is intentionally minimal for this first release (realtime + auth); more surfaces can follow.

Minimal, professional C++17 SDK for Decart's realtime models, built on the
official LiveKit C++ SDK for media transport.

- decart::Client with API-key/base-URL config (DECART_API_KEY fallback)
- Realtime: client.realtime().connect(videoSource, opts) — publish frames,
  receive transformed frames, steer with setPrompt/set/setImage; connection-state,
  queue-position, generation, and error callbacks
- Auth: client.tokens().create() — short-lived client tokens
- Model registry: decart::models::realtime(...)
- Transport: WebSocket signaling (IXWebSocket) + LiveKit/WebRTC media
- Optional auth-only build (DECART_BUILD_REALTIME=OFF) with no LiveKit dependency
- CMake packaging (vcpkg manifest + FetchContent fallback + prebuilt LiveKit
  download), examples, doctest unit tests, and Linux/macOS/Windows CI
Comment thread src/logging.cpp
@AdirAmsalem AdirAmsalem changed the title Initial Decart C++ SDK (realtime + auth) Initial Decart C++ SDK Jun 18, 2026
- Windows build failed to link the examples: IXWebSocket's mbedtls TLS backend
  references BCryptGenRandom, so link Bcrypt.lib (PUBLIC) on Windows.
- realtime_video used POSIX popen/pclose, which MSVC names _popen/_pclose;
  add a _WIN32 shim.
- Silence MSVC C4996 getenv warnings via _CRT_SECURE_NO_WARNINGS.
@DecartAI DecartAI deleted a comment from wiz-9b1b272901 Bot Jun 18, 2026
@AdirAmsalem AdirAmsalem merged commit b3974f4 into main Jun 18, 2026
10 checks passed
@AdirAmsalem AdirAmsalem deleted the decart-cpp-sdk-realtime branch June 18, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant