feat: llama-swap transcribe

This commit is contained in:
2026-03-24 12:37:09 +01:00
parent 6d61867bc7
commit bba4bd532c
3 changed files with 61 additions and 0 deletions
+1
View File
@@ -66,6 +66,7 @@
qwen-asr = nixpkgs.legacyPackages.${system}.callPackage ./packages/qwen-asr.nix { };
llama-swap = nixpkgs.legacyPackages.${system}.callPackage ./packages/llama-swap { };
z-image-models = nixpkgs.legacyPackages.${system}.callPackage ./packages/z-image-models { };
whisper-models = nixpkgs.legacyPackages.${system}.callPackage ./packages/whisper-models { };
};
# legolas
+26
View File
@@ -10,7 +10,9 @@
environment.systemPackages = [
pkgs.unstable.llama-cpp-vulkan
pkgs.unstable.stable-diffusion-cpp-vulkan
pkgs.unstable.whisper-cpp-vulkan
inputs.self.packages.${system}.z-image-models
inputs.self.packages.${system}.whisper-models
];
services.llama-swap = {
@@ -23,7 +25,9 @@
let
llama-server = lib.getExe' pkgs.unstable.llama-cpp-vulkan "llama-server";
sd-server = lib.getExe' pkgs.unstable.stable-diffusion-cpp-vulkan "sd-server";
whisper-server = lib.getExe' pkgs.unstable.whisper-cpp-vulkan "whisper-server";
z-image-models = inputs.self.packages.${system}.z-image-models;
whisper-models = inputs.self.packages.${system}.whisper-models;
in
{
healthCheckTimeout = 180;
@@ -99,6 +103,28 @@
llm = "${z-image-models}/models/Qwen3-4B-Instruct-2507-Q4_K_M.gguf";
};
};
"distil-whisper-v3.5" = {
cmd = "${whisper-server} --host 127.0.0.1 --port $\{PORT\} -m $\{model\} --request-path /v1/audio/transcriptions --inference-path \"\"";
checkEndpoint = "/v1/audio/transcriptions/";
proxy = "http://127.0.0.1:$\{PORT\}";
ttl = 0;
aliases = [
"whisper"
"whisper-1"
];
macros.model = "${whisper-models}/models/distil-large-v3.5.bin";
};
"nb-whisper-small" = {
cmd = "${whisper-server} --host 127.0.0.1 --port $\{PORT\} -m $\{model\} --request-path /v1/audio/transcriptions --inference-path \"\" --language no";
checkEndpoint = "/v1/audio/transcriptions/";
proxy = "http://127.0.0.1:$\{PORT\}";
ttl = 0;
aliases = [
"whisper-no"
"whisper-nb"
];
macros.model = "${whisper-models}/models/nb-whisper-small-q5_0.bin";
};
};
};
};
+34
View File
@@ -0,0 +1,34 @@
{
lib,
fetchurl,
runCommand,
}:
let
distilLargeV35 = fetchurl {
url = "https://huggingface.co/distil-whisper/distil-large-v3.5-ggml/resolve/main/ggml-model.bin";
hash = "sha256-7CSYkZtJjF9rAAQa20VlASSzzZ8m9UX/+o9dEcKNzyY=";
name = "distil-large-v3.5.bin";
};
nbWhisperSmallQ5 = fetchurl {
url = "https://huggingface.co/NbAiLab/nb-whisper-small/resolve/main/ggml-model-q5_0.bin";
hash = "sha256-KpAlr7boJfxK5qRmceDLL0PmLx3shycN7qb+YbUoWiA=";
name = "nb-whisper-small-q5_0.bin";
};
in
runCommand "whisper-models"
{
version = "1.0.0";
meta = {
description = "Whisper GGML models for whisper.cpp";
homepage = "https://huggingface.co/distil-whisper/distil-large-v3.5-ggml";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}
''
mkdir -p $out/models
ln -s ${distilLargeV35} $out/models/distil-large-v3.5.bin
ln -s ${nbWhisperSmallQ5} $out/models/nb-whisper-small-q5_0.bin
''