Files

7.6 KiB
Raw Permalink Blame History

Strata desktop preview

Shared Avalonia 12.1.3 / .NET 10 UI with an independent Rust 1.99 core. The preview reads local hardware and evaluates explicit memory requirements. It does not start inference, download a model, or change a running server.

Build and run

From the repository root:

cargo build --locked --manifest-path desktop-core/Cargo.toml
dotnet restore desktop/Strata.Desktop.csproj --locked-mode
dotnet build desktop/Strata.Desktop.csproj --no-restore
dotnet desktop/bin/Debug/net10.0/Strata.Desktop.dll --self-check
dotnet run --project desktop/Strata.Desktop.csproj --no-build

The headless integration check boots the actual app-local Rust node and uses generated C# protobuf clients over authenticated gRPC/HTTP2 for handshake, hardware, memory planning and state subscription. The node is a persistent process for the lifetime of the preview; it only provides inventory/planning. STRATA_DESKTOP_CORE may override it with an absolute trusted executable path. CLI users do not need .NET:

desktop-core/target/debug/strata-desktop hardware
desktop-core/target/debug/strata-desktop plan desktop-core/examples/requirements.json

For a local macOS application bundle, run sh desktop/package-macos.sh. The result is artifacts/desktop/Strata Preview.app. This is a developer build, not a signed/notarized release. It includes the .NET runtime and Rust helper. Windows and Linux have a CI build/headless integration job; their GUI and packaging still require native verification. Hosted CI has not run yet.

What the numbers mean

Requirements schema v1 uses runtime allocation bytes, not compressed file size. The example is synthetic, explicitly labelled, and describes no real model. KV = bytes per token per request × context × concurrency. CPU memory includes weights, KV, workspace, load scratch and host overhead. Dedicated GPU candidates check both RAM and VRAM, retaining a host weight copy when requested. Weight offload candidates are emitted only with explicit backend support in the profile. Shared memory is counted once, with an independent device allocation ceiling. Unknown limits remain unknown. A fit is an estimate, never proof of backend compatibility, quality or speed; available memory must be rechecked before load.

Inventory currently covers CPU/RAM and runtime CPU features, macOS display inventory and NVIDIA via nvidia-smi on Windows/Linux. NPU/provider capabilities and non-NVIDIA GPU probes on Windows/Linux are not implemented. A missing probe result must not be interpreted as absent hardware.

The helper launches fixed probes without a shell, limits their output and time, and collects no prompts, process list, credentials or hostname. Closing the UI closes stdin of its owned inventory-only node. An external node is never stopped. The credential is generated in memory and passed via a private child environment; it is never placed in command arguments or bootstrap output.

To use an existing local node or SSH-forwarded node, set STRATA_NODE_ENDPOINT to its loopback HTTP URL and STRATA_NODE_TOKEN from your credential store. The same gRPC contract is used; there is no automatic SSH provisioning yet. These environment values are not persisted. Do not place credentials in Git.

Verification, 2026-10-04

On Apple M3 / macOS / 24 GiB: 11 Rust tests, strict Clippy, desktop build and headless hardware/plan integration passed. Real UI hardware cards, example planning and native JSON picker were exercised. Synthetic tests cover 8/16 GiB, offload, shared/unknown memory, retained copies, concurrency and overflow. No inference code changed; no speed or model-quality claim is made.

Next delivery units

  • STRA-40: actual model metadata, resumable acquisition and preparation.
  • STRA-42: backend capability probes including CPU/GPU/NPU.
  • STRA-44: opt-in comparable benchmarks and measured recipe selection.
  • STRA-50–53: remote SSH preflight, provisioning, tunnel and UI lifecycle.
  • STRA-47: signed platform distributions and native release gates.

See product architecture (spec node cross-platform-application.md) for boundaries.

The Rust CLI now also has an experimental pool gateway and SSH preflight. They are separate CLI capabilities; the desktop covers node inventory, memory planning and an installed worker’s lifecycle.

Shared node implementation: gRPC contract and commands. On macOS the C#→gRPC→Rust self-check passed. Rust integration tests also cover harness HTTP→gRPC→worker streaming with synthetic responses, auth, versioning, observer limits, reconnect snapshots and interrupted-stream quarantine. This is transport evidence, not Metal inference or Windows/Linux qualification.

Connection recovery: the window displays node connection separately from the hardware query result. The observer reconnects after transport failure, replaces state on agent epoch changes and stops automatic retries for auth/protocol errors. Run python desktop/tests/reconnect.py after building to test C# recovery against an isolated node restart. This test creates and cleans its own local processes; it never sends model requests or contacts the user's remote endpoint.

Managed model controls

For an operator-configured persistent node started with --worker-profile, set STRATA_NODE_ENDPOINT to its loopback address (or existing SSH forward) and STRATA_NODE_TOKEN to its private credential before launching the desktop. See the node commands/profile format. The window shows the model’s phase and provides Запустити модель / Зупинити модель. Neither opening nor closing the window changes the model’s running state. With the default inventory-only node, lifecycle buttons remain disabled.

During a lost connection the app queries the existing operation UUID instead of resending Start/Stop. Unknown outcomes or a replaced node block further actions and show the UUID for operator reconciliation. Installing/downloading a model, selecting another installed profile and creating SSH tunnels are not yet exposed.

python desktop/tests/lifecycle.py runs the real C# controller/gRPC/managed-child integration with synthetic data. On macOS it passed start/stop, lost-ack status recovery, client-close independence and exact Responses byte checks. The test is in the three-platform CI definition; hosted Actions and interactive inspection of the new buttons on all platforms remain unverified. No model quality/speed claim.

Managed nodes can now use a private durable operation journal via --worker-profile PROFILE.json --journal /absolute/private-directory/operations.jsonl. Completed command outcomes remain queryable after node restart; interrupted commands are marked indeterminate and block further mutations for reconciliation. The desktop can reconcile a pending command against a replacement node that advertises durable history, without submitting it again. The window's own pending operation is still in memory; restoring it after closing the app remains pending.

Existing remote node via managed SSH

The Rust core now owns a loopback SSH transport: strata-desktop ssh-tunnel /absolute/private/ssh-tunnel.json. Point STRATA_NODE_ENDPOINT at its printed endpoint and use the remote node's credential. The same desktop lifecycle works through this connection. See profile and verification. A real isolated OpenSSH/gRPC integration and forced SSH-disconnect recovery passed on macOS. Remote node/model installation and the desktop connection form remain pending; this command does not provision or restart the remote runtime.