Skip to main content

installWhisperCpp()v4.0.115

Installs a Whisper.cpp version into a folder.

install-whisper.mjs
tsx
import path from "path";
import { installWhisperCpp } from "@remotion/install-whisper-cpp";
 
const { alreadyExisted } = await installWhisperCpp({
to: path.join(process.cwd(), "whisper.cpp"),
version: "1.5.5", // A Whisper.cpp semver or git tag
});
install-whisper.mjs
tsx
import path from "path";
import { installWhisperCpp } from "@remotion/install-whisper-cpp";
 
const { alreadyExisted } = await installWhisperCpp({
to: path.join(process.cwd(), "whisper.cpp"),
version: "1.5.5", // A Whisper.cpp semver or git tag
});

On Windows, if the provided version is not in semantic version format (e.g., 1.5.4), the installation will throw an error. The function expects a precompiled semantic versioned release available for download.

On other platforms, the source is cloned from GitHub and built.

If you install Whisper.cpp into a folder which is in a Git repository, you should add the folder to the .gitignore file.

If the output folder already exists, the function will not do anything and return { alreadyExisted: true }.

You also need to download a model for Whisper.cpp to work. You can do this with the downloadWhisperModel() function.

Options

to

The folder to install Whisper.cpp into.

version

The version of Whisper.cpp to install. Don't include the v prefix. This can be either a hash of a Whisper.cpp commit or a semantic version of an official release.

info

On Windows, currently only release tags of Whisper.cpp are supported (e.g 1.5.4).

printOutput?

Whether to print the output of the installation process to the console. Defaults to true.

Return value

Returns a Promise that resolves to an object with the following property:

alreadyExisted

Whether the folder already existed. If it did, and contains the necessary executable, the function did not perform any installation and returned true. If the executable is missing in the existing folder, the function expects manual deletion of the folder before attempting another installation.

See also