edytlab
API Reference

Speech Model and Runtime

Check the ONNX Runtime, and download, cancel or remove the speech model.

On this page5 commands

Called through tauri-bridge.ts. Each returns Promise<T> and throws a string on Rust Err(_).

ONNX Runtime

FunctionReturnsDescription
mlRuntimeStatus()MlRuntimeStatusWhich ONNX Runtime library the app found and its version, for the line in Settings. It loads the library if it has not been, off the main thread, and a library that is missing, broken, or unusable because this macOS is too old for it is a status, never a hang. state is found (version, path, and source: bundled, environment or executable), missing (the places searched), unsupportedOs (macOS older than the library's 13.4) or loadFailed (path, reason). The installers carry ONNX Runtime 1.23.2, so an installed build answers found with source bundled; a build from source answers missing. A loaded library runs nothing by itself: no model ships with it, transcribe uses the speech model only once it is downloaded (see Speech Model), and stem separation has not shipped. The same answer is printed, as one line of JSON with no window, by edytlab-desktop --ml-runtime-status, which the release workflows run against each installer.

Speech Model

FunctionReturnsDescription
mlModelStatus(model)MlModelStatusWhere a downloadable model is, for the Speech model row in Settings. model is an id from crates/ml-pipeline/models.json (today whisper-base, about 139 MB from huggingface.co). The answer is a flat object tagged by state: not_downloaded, downloading (received and total bytes), ready (every file on disk and checked against its SHA-256) or failed (reason), with bytes on disk and the pinned size. It reads the disk off the main thread and makes no network request.
downloadMlModel(model)MlModelStatusStart downloading a model on a thread of its own and answer at once with downloading. The only way a model is downloaded, called by the user's click on Download: nothing downloads at launch, when Settings opens, or from a tool or the agent. Progress and the end arrive on onMlModelProgress. A partial file from an earlier attempt is resumed with a Range request, and a file is renamed to its final name only once its size and SHA-256 match. It takes no store, engine, dispatcher or agent lock. The request goes to huggingface.co and carries no audio. A model on disk is what the transcribe tool uses: it finds the files, never downloads, and says the model is not downloaded when they are not there.
cancelMlModelDownload(model)MlModelStatusAsk a running download to stop. It stops at its next chunk and keeps the partial file for a resume; onMlModelProgress says not_downloaded once it has. Does nothing when no download is running.
removeMlModel(model)MlModelStatusDelete the model's own files (and its partial files) from the models folder, and nothing else in it. Refused while the model is downloading: cancel it first.