2024-04-19 14:22:06 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.wyoming-faster-whisper
|
|
|
|
pkgs.whisper
|
|
|
|
pkgs.openai-whisper
|
|
|
|
pkgs.openai-whisper-cpp
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
services.wyoming.faster-whisper = {
|
|
|
|
package = pkgs.wyoming-faster-whisper;
|
|
|
|
|
|
|
|
servers = {
|
|
|
|
fast = {
|
|
|
|
enable = true;
|
|
|
|
model = "tiny-int8";
|
|
|
|
uri = "tcp://0.0.0.0:10302";
|
2024-05-19 00:15:13 +02:00
|
|
|
device = "auto";
|
2024-04-19 14:22:06 +02:00
|
|
|
language = "auto";
|
|
|
|
beamSize = 1;
|
|
|
|
};
|
|
|
|
fast-cpu = {
|
|
|
|
enable = true;
|
|
|
|
model = "tiny-int8";
|
|
|
|
uri = "tcp://0.0.0.0:10303";
|
|
|
|
device = "cpu";
|
|
|
|
language = "auto";
|
|
|
|
beamSize = 1;
|
|
|
|
};
|
|
|
|
slow = {
|
|
|
|
enable = true;
|
|
|
|
model = "small";
|
|
|
|
uri = "tcp://0.0.0.0:10304";
|
|
|
|
device = "auto";
|
|
|
|
language = "auto";
|
|
|
|
beamSize = 5;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."whisper.${config.networking.hostName}.${config.networking.domain}" = {
|
|
|
|
forceSSL = true;
|
|
|
|
#useACMEHost = config.networking.domain; #not sure if this will work, unless
|
|
|
|
locations."/" = {
|
|
|
|
proxyWebsockets = true;
|
|
|
|
proxyPass = "${config.services.services.wyoming.faster-whisper.servers.fast.uri}";
|
|
|
|
};
|
|
|
|
basicAuthFile = config.sops.secrets."nginx/defaultpass".path;
|
|
|
|
};
|
2024-05-19 00:15:13 +02:00
|
|
|
}
|