Skip to content

feat: add optional remote compute backend#128

Open
Luis Serrano (luisnomad) wants to merge 7 commits into
Lightricks:mainfrom
luisnomad:codex/remote-backend-mode
Open

feat: add optional remote compute backend#128
Luis Serrano (luisnomad) wants to merge 7 commits into
Lightricks:mainfrom
luisnomad:codex/remote-backend-mode

Conversation

@luisnomad

@luisnomad Luis Serrano (luisnomad) commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Adds an optional remote-compute mode so LTX Desktop can keep its Electron UI and project files on one computer while running models and inference on a user-owned headless GPU machine.

  • Keeps the existing managed-local backend as the default.
  • Adds a first-run local/remote compute choice and a persistent Settings → Compute control.
  • Adds an authenticated standalone FastAPI deployment mode for a headless GPU host.
  • Transfers inputs and generated artifacts through authenticated media IDs instead of sharing client filesystem paths.

This implements the self-hosted split-UI/GPU-server scenario described in #82 (and related discussion in #53). That request identified authentication, transport security, packaging, and UI flow as the missing pieces; this PR covers each of those areas.

Design

Desktop client

  • Stores the optional remote URL and bearer token through Electron; the token is encrypted with safeStorage.
  • Tests protocol/capability compatibility before saving a remote connection.
  • Routes backend HTTP, WebSocket, media upload, and artifact download through the active connection.
  • Imports downloaded outputs into the existing local project-assets directory.
  • Clearly separates the remote-backend access token from the LTX Cloud API key.
  • Supports authenticated direct HTTP on a deliberately configured trusted LAN, with an in-app warning that the token and media are not encrypted in transit.

Headless backend

  • Adds LTX_DEPLOYMENT_MODE=standalone with a required LTX_AUTH_TOKEN of at least 32 characters.
  • Requires bearer authentication for HTTP and WebSocket requests; Basic auth is rejected in standalone mode.
  • Disables the shutdown endpoint in standalone mode.
  • Remains loopback-only by default. A non-loopback listener requires authentication and explicit LTX_BIND_HOST configuration.
  • Documents direct trusted-LAN HTTP as the minimal private-network setup, SSH as an encrypted private-host alternative, and HTTPS for shared, untrusted, or internet-facing networks.
  • Uses bounded uploads, validated media types, opaque artifact IDs, expiry cleanup, and path-containment checks.
  • Returns an explicit protocol version and capability set for client compatibility checks.
  • Keeps model paths and Hugging Face authentication owned by the compute backend.

See docs/REMOTE_BACKEND.md for deployment and connection instructions.

Compatibility

  • Existing installations continue using the Electron-managed local Python backend unless remote compute is explicitly selected.
  • LTX Cloud generation remains independent of this feature.
  • Remote compute can be changed after onboarding through the status control or Settings → Compute.
  • The backend remains a trusted, single-user service; this does not attempt to introduce multi-tenancy.

Validation

  • pnpm typecheck
  • pnpm backend:test — 285 passed
  • pnpm build:frontend
  • Packaged Apple Silicon client connected through an SSH tunnel to an Ubuntu/NVIDIA headless backend.
  • Completed an image-to-video generation on the remote LTX model, downloaded the authenticated artifact, and imported it into the Mac project assets.
  • Restarted the client with the saved remote configuration and confirmed that it reconnects without starting the Mac Python backend.
  • Bound the backend to a specific trusted-LAN address and connected the Mac directly after stopping the SSH tunnel; an unauthenticated probe returned 401 and the saved authenticated desktop connection succeeded.

Notes for reviewers

The generated OpenAPI TypeScript/JSON changes account for a substantial portion of the diff. The implementation follows the existing route → handler → service structure, with a fake media service used by integration tests rather than mocks.

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