Skip to content

Commit 9db9903

Browse files
committed
init
0 parents  commit 9db9903

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# KoboldCpp Vulkan Flake
2+
3+
Run `nix run github:jim3692/koboldcpp-flake`
4+
5+
It downloads [Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf](https://huggingface.co/lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF) using `huggingface-cli`, if it doesn't already exist in `~/.cache/huggingface`, and then starts KoboldCpp in Vulkan mode.

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
3+
4+
outputs = { nixpkgs, ... }:
5+
let
6+
system = "x86_64-linux";
7+
pkgs = import nixpkgs { inherit system; };
8+
9+
repoName = "lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF";
10+
fileName = "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf";
11+
in {
12+
apps.${system}.default = let
13+
run = pkgs.writeShellApplication {
14+
name = "run";
15+
text = with pkgs; ''
16+
findModel() {
17+
find ~/.cache/huggingface -name "${fileName}" | head -n1
18+
}
19+
20+
if [ "$(findModel)" == "" ]; then
21+
${python312Packages.huggingface-hub}/bin/huggingface-cli download "${repoName}" "${fileName}"
22+
fi
23+
24+
modelPath="$(findModel)"
25+
echo "Found ${fileName} at $modelPath"
26+
AMD_VULKAN_ICD=AMDVLK ${koboldcpp}/bin/koboldcpp --usevulkan --model "$modelPath" --gpulayers 100
27+
'';
28+
};
29+
in {
30+
type = "app";
31+
program = "${run}/bin/run";
32+
};
33+
};
34+
}
35+

0 commit comments

Comments
 (0)