diff --git a/modules/services/ollama.nix b/modules/services/ollama.nix index c2cfa83a2..c6d22ecc4 100644 --- a/modules/services/ollama.nix +++ b/modules/services/ollama.nix @@ -27,6 +27,13 @@ let # deepseek-coder-7b # subpar to deepseek-coder-v2 in nearly every way deepseek-coder-v2-16b # GREAT balance between speed and code quality. code is superior to qwen2_5 in some ways, and inferior in others # deepseek-coder-v2-16b-lite-instruct-q5_1 # higher-res version of default 16b (but in practice, is more rambly and less correct) + deepseek-r1-1_5b + deepseek-r1-7b + deepseek-r1-14b + deepseek-r1-32b + deepseek-r1-abliterated-14b + dolphin-mistral-7b # UNCENSORED mistral + dolphin-mixtral-8x7b # UNCENSORED mixtral # falcon2-11b # code examples are lacking # gemma2-9b # fast, but not great for code gemma2-27b # generates at 1word/sec, but decent coding results if you can wrangle it @@ -35,6 +42,8 @@ let # llama3-chatqa-8b # it gets stuck # llama3_1-70b # generates like 1 word/sec, decent output (comparable to qwen2_5-32b) llama3_2-3b + llama3_2-uncensored-3b + llama3_3-70b magicoder-7b # it generates valid, if sparse, code marco-o1-7b # untested # mistral-7b # it generates invalid code @@ -47,6 +56,9 @@ let qwen2_5-14b # *almost* same quality to 32b variant, but faster # qwen2_5-32b-instruct-q2_K # lower-res version of default 32b (so, slightly faster, but generates invalid code where the full res generates valid code) qwen2_5-32b # generates 3~5 words/sec, but notably more accurate than coder-7b + qwen2_5-abliterate-7b + qwen2_5-abliterate-14b + qwen2_5-abliterate-32b # qwen2_5-coder-7b # fast, and concise, but generates invalid code qwq-32b # untested # solar-pro-22b # generates invalid code diff --git a/pkgs/by-name/ollamaPackages/athene-v2-72b-q2_K.nix b/pkgs/by-name/ollamaPackages/athene-v2-72b-q2_K.nix index 18caf9b21..7280324ac 100644 --- a/pkgs/by-name/ollamaPackages/athene-v2-72b-q2_K.nix +++ b/pkgs/by-name/ollamaPackages/athene-v2-72b-q2_K.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "athene-v2"; variant = "72b-q2_K"; #< smallest model - manifestHash = "sha256-yqH/Ltp0Z6yrHJYwPXU2NssViuxH0b1lO8dH6i60qWc="; + manifestHash = "sha256-5WbXE/LOEsOfgDLNDxpHxMkhSlq6jLIVA9Bb7ti3maQ="; modelBlob = "e85b0c9b18adb8eeb4f091a870ad4d66e6a10b4973fe1eada695a47f4a598a7a"; modelBlobHash = "sha256-6FsMmxituO608JGocK1NZuahC0lz/h6tppWkf0pZino="; systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; diff --git a/pkgs/by-name/ollamaPackages/codestral-22b.nix b/pkgs/by-name/ollamaPackages/codestral-22b.nix index 1dbe4be54..9998d9ebf 100644 --- a/pkgs/by-name/ollamaPackages/codestral-22b.nix +++ b/pkgs/by-name/ollamaPackages/codestral-22b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "codestral"; variant = "22b"; - manifestHash = "sha256-Sznj0qzrQOt+t9K+CZProh81RulafSDx9HYUv2jwVAE="; + manifestHash = "sha256-CJiosobVbYEFWHBJ/saWNPzoPJVyMPwT8Kz+A7exGQk="; modelBlob = "22a849aafe3ded20e9b6551b02684d8fa911537c35895dd2a1bf9eb70da8f69e"; modelBlobHash = "sha256-IqhJqv497SDptlUbAmhNj6kRU3w1iV3Sob+etw2o9p4="; paramsBlob = "5dea4f4d0fffcd67078a5f8fa107312bcf1d7d658cc668631a4fd6b4530a7159"; diff --git a/pkgs/by-name/ollamaPackages/deepseek-coder-v2-16b.nix b/pkgs/by-name/ollamaPackages/deepseek-coder-v2-16b.nix index ce463cdbc..c8f44461a 100644 --- a/pkgs/by-name/ollamaPackages/deepseek-coder-v2-16b.nix +++ b/pkgs/by-name/ollamaPackages/deepseek-coder-v2-16b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "deepseek-coder-v2"; variant = "16b"; - manifestHash = "sha256-F0cBCsxKHEQ+/+c+BJvT8cKhYP42voDWVLJpE0R4hvw="; + manifestHash = "sha256-Y/sZOzqbQyKhjoxrJQyi5wpf9THpYtv5W6CJslZvL6U="; modelBlob = "5ff0abeeac1d2dbdd5455c0b49ba3b29a9ce3c1fb181b2eef2e948689d55d046"; modelBlobHash = "sha256-X/Cr7qwdLb3VRVwLSbo7KanOPB+xgbLu8ulIaJ1V0EY="; paramsBlob = "19f2fb9e8bc65a143f47903ec07dce010fd2873f994b900ea735a4b5022e968d"; diff --git a/pkgs/by-name/ollamaPackages/deepseek-r1-14b.nix b/pkgs/by-name/ollamaPackages/deepseek-r1-14b.nix new file mode 100644 index 000000000..3d297b05b --- /dev/null +++ b/pkgs/by-name/ollamaPackages/deepseek-r1-14b.nix @@ -0,0 +1,10 @@ +# +{ mkOllamaModel }: mkOllamaModel { + modelName = "deepseek-r1"; + variant = "14b"; + manifestHash = "sha256-6jXf4YGC9jXuKyFOowt1IP4a2mjaAY+LOVtES2YtTxo="; + modelBlob = "6e9f90f02bb3b39b59e81916e8cfce9deb45aeaeb9a54a5be4414486b907dc1e"; + modelBlobHash = "sha256-bp+Q8Cuzs5tZ6BkW6M/OnetFrq65pUpb5EFEhrkH3B4="; + paramsBlob = "f4d24e9138dd4603380add165d2b0d970bef471fac194b436ebd50e6147c6588"; + paramsBlobHash = "sha256-9NJOkTjdRgM4Ct0WXSsNlwvvRx+sGUtDbr1Q5hR8ZYg="; +} diff --git a/pkgs/by-name/ollamaPackages/deepseek-r1-1_5b.nix b/pkgs/by-name/ollamaPackages/deepseek-r1-1_5b.nix new file mode 100644 index 000000000..f7755693e --- /dev/null +++ b/pkgs/by-name/ollamaPackages/deepseek-r1-1_5b.nix @@ -0,0 +1,10 @@ +# +{ mkOllamaModel }: mkOllamaModel { + modelName = "deepseek-r1"; + variant = "1.5b"; + manifestHash = "sha256-pCsl2MEKhBvSRyQwmJiuhRRmaWp9fzoKQIuJVTjMvJY="; + modelBlob = "aabd4debf0c8f08881923f2c25fc0fdeed24435271c2b3e92c4af36704040dbc"; + modelBlobHash = "sha256-qr1N6/DI8IiBkj8sJfwP3u0kQ1JxwrPpLErzZwQEDbw="; + paramsBlob = "f4d24e9138dd4603380add165d2b0d970bef471fac194b436ebd50e6147c6588"; + paramsBlobHash = "sha256-9NJOkTjdRgM4Ct0WXSsNlwvvRx+sGUtDbr1Q5hR8ZYg="; +} diff --git a/pkgs/by-name/ollamaPackages/deepseek-r1-32b.nix b/pkgs/by-name/ollamaPackages/deepseek-r1-32b.nix new file mode 100644 index 000000000..b6c88a635 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/deepseek-r1-32b.nix @@ -0,0 +1,10 @@ +# +{ mkOllamaModel }: mkOllamaModel { + modelName = "deepseek-r1"; + variant = "32b"; + manifestHash = "sha256-OAVrvLstBoUB7LLV6pzqndSEdGXxq4jE1KQSqfd5Jxc="; + modelBlob = "6150cb382311b69f09cc0f9a1b69fc029cbd742b66bb8ec531aa5ecf5c613e93"; + modelBlobHash = "sha256-YVDLOCMRtp8JzA+aG2n8Apy9dCtmu47FMapez1xhPpM="; + paramsBlob = "f4d24e9138dd4603380add165d2b0d970bef471fac194b436ebd50e6147c6588"; + paramsBlobHash = "sha256-9NJOkTjdRgM4Ct0WXSsNlwvvRx+sGUtDbr1Q5hR8ZYg="; +} diff --git a/pkgs/by-name/ollamaPackages/deepseek-r1-7b.nix b/pkgs/by-name/ollamaPackages/deepseek-r1-7b.nix new file mode 100644 index 000000000..37b94b828 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/deepseek-r1-7b.nix @@ -0,0 +1,10 @@ +# +{ mkOllamaModel }: mkOllamaModel { + modelName = "deepseek-r1"; + variant = "7b"; + manifestHash = "sha256-CowmaRAjL9MpHnHluh4FjMWvnUERks+IttMOkrbnMWM="; + modelBlob = "96c415656d377afbff962f6cdb2394ab092ccbcbaab4b82525bc4ca800fe8a49"; + modelBlobHash = "sha256-lsQVZW03evv/li9s2yOUqwksy8uqtLglJbxMqAD+ikk="; + paramsBlob = "f4d24e9138dd4603380add165d2b0d970bef471fac194b436ebd50e6147c6588"; + paramsBlobHash = "sha256-9NJOkTjdRgM4Ct0WXSsNlwvvRx+sGUtDbr1Q5hR8ZYg="; +} diff --git a/pkgs/by-name/ollamaPackages/deepseek-r1-abliterated-14b.nix b/pkgs/by-name/ollamaPackages/deepseek-r1-abliterated-14b.nix new file mode 100644 index 000000000..adbaa0512 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/deepseek-r1-abliterated-14b.nix @@ -0,0 +1,12 @@ +# +# uncensored version of deepseek-r1 +{ mkOllamaModel }: mkOllamaModel { + owner = "huihui_ai"; + modelName = "deepseek-r1-abliterated"; + variant = "14b"; + manifestHash = "sha256-ayIJ/9dYLoMQpLOplpG35yU75gj+OLPW2XzTubGET/Q="; + modelBlob = "38b5e20078675a1e3040eced1859e432b423ec732c42f5dab03b0a8ae7ba1bdd"; + modelBlobHash = "sha256-OLXiAHhnWh4wQOztGFnkMrQj7HMsQvXasDsKiue6G90="; + paramsBlob = "f4d24e9138dd4603380add165d2b0d970bef471fac194b436ebd50e6147c6588"; + paramsBlobHash = "sha256-9NJOkTjdRgM4Ct0WXSsNlwvvRx+sGUtDbr1Q5hR8ZYg="; +} diff --git a/pkgs/by-name/ollamaPackages/dolphin-mistral-7b.nix b/pkgs/by-name/ollamaPackages/dolphin-mistral-7b.nix new file mode 100644 index 000000000..69b57a601 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/dolphin-mistral-7b.nix @@ -0,0 +1,13 @@ +# +# uncensored version of mistral +{ mkOllamaModel }: mkOllamaModel { + modelName = "dolphin-mistral"; + variant = "7b"; + manifestHash = "sha256-XcjFor5lENyyr7z/3txzrL1YaNLCXZQC9gRL6t49X3A="; + modelBlob = "11a57a9bd0bc7d5e12aa0cc3d83e8d34b776fe5a8c232b20d610ca9f4e8b4b23"; + modelBlobHash = "sha256-EaV6m9C8fV4SqgzD2D6NNLd2/lqMIysg1hDKn06LSyM="; + paramsBlob = "f02dd72bb2423204352eabc5637b44d79d17f109fdb510a7c51455892aa2d216"; + paramsBlobHash = "sha256-8C3XK7JCMgQ1LqvFY3tE150X8Qn9tRCnxRRViSqi0hY="; + systemBlob = "9640c2212a51f7df5840f7929448afa17cb33fbb173cf15e1d74883e932a3466"; + systemBlobHash = "sha256-lkDCISpR999YQPeSlEivoXyzP7sXPPFeHXSIPpMqNGY="; +} diff --git a/pkgs/by-name/ollamaPackages/dolphin-mixtral-8x7b.nix b/pkgs/by-name/ollamaPackages/dolphin-mixtral-8x7b.nix new file mode 100644 index 000000000..4bd6da797 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/dolphin-mixtral-8x7b.nix @@ -0,0 +1,13 @@ +# +# uncensored version of mixtral +{ mkOllamaModel }: mkOllamaModel { + modelName = "dolphin-mixtral"; + variant = "8x7b"; + manifestHash = "sha256-T3bCjAQUPqeMr+MYmDy76wva0WqZNlw5uBizrI/lADc="; + modelBlob = "5041ba4278429fe475782b889471b5ff065a6cce5c3a539bd61d1e457f1961de"; + modelBlobHash = "sha256-UEG6QnhCn+R1eCuIlHG1/wZabM5cOlOb1h0eRX8ZYd4="; + paramsBlob = "f02dd72bb2423204352eabc5637b44d79d17f109fdb510a7c51455892aa2d216"; + paramsBlobHash = "sha256-8C3XK7JCMgQ1LqvFY3tE150X8Qn9tRCnxRRViSqi0hY="; + systemBlob = "9640c2212a51f7df5840f7929448afa17cb33fbb173cf15e1d74883e932a3466"; + systemBlobHash = "sha256-lkDCISpR999YQPeSlEivoXyzP7sXPPFeHXSIPpMqNGY="; +} diff --git a/pkgs/by-name/ollamaPackages/gemma2-27b.nix b/pkgs/by-name/ollamaPackages/gemma2-27b.nix index ddd2a723d..ab7b012f9 100644 --- a/pkgs/by-name/ollamaPackages/gemma2-27b.nix +++ b/pkgs/by-name/ollamaPackages/gemma2-27b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "gemma2"; variant = "27b"; - manifestHash = "sha256-WnC1+AyReHHBypXiSHQtHgqspSkmSPPtc0RkRp6MIaE="; + manifestHash = "sha256-UyYbycGSwctfzImN06oV2gk/WrbwjhfkjPg4uxxYq/4="; modelBlob = "d7e4b00a7d7a8d03d4eed9b0f3f61a427e9f0fc5dea6aeb414e41dee23dc8ecc"; modelBlobHash = "sha256-1+SwCn16jQPU7tmw8/YaQn6fD8Xepq60FOQd7iPcjsw="; paramsBlob = "2490e7468436707d5156d7959cf3c6341cc46ee323084cfa3fcf30fe76e397dc"; diff --git a/pkgs/by-name/ollamaPackages/llama3_2-3b.nix b/pkgs/by-name/ollamaPackages/llama3_2-3b.nix index 8f0b23bec..f55379b05 100644 --- a/pkgs/by-name/ollamaPackages/llama3_2-3b.nix +++ b/pkgs/by-name/ollamaPackages/llama3_2-3b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "llama3.2"; variant = "3b"; - manifestHash = "sha256-Z0I0WdLn2VWqGnIGK1GnBPuvbwuCbSM1WFXp+ltJaN8="; + manifestHash = "sha256-qAxPF6zVUmX+7EA8eu+GvgwlmDqyedg/O806u8tbi3I="; modelBlob = "dde5aa3fc5ffc17176b5e8bdc82f587b24b2678c6c66101bf7da77af9f7ccdff"; modelBlobHash = "sha256-3eWqP8X/wXF2tei9yC9YeySyZ4xsZhAb99p3r598zf8="; paramsBlob = "56bb8bd477a519ffa694fc449c2413c6f0e1d3b1c88fa7e3c9d88d3ae49d4dcb"; diff --git a/pkgs/by-name/ollamaPackages/llama3_2-uncensored-3b.nix b/pkgs/by-name/ollamaPackages/llama3_2-uncensored-3b.nix new file mode 100644 index 000000000..77afa9207 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/llama3_2-uncensored-3b.nix @@ -0,0 +1,13 @@ +# +{ mkOllamaModel }: mkOllamaModel { + owner = "artifish"; + modelName = "llama3.2-uncensored"; + variant = "latest"; + manifestHash = "sha256-xzvqJuAEg7WLpZcpt0v8FkeXHa+h/mbIkNhFrmPiw04="; + modelBlob = "1a01383341be9bf04a904e168089401c3f0533b3af4089d3536d8b36e497ccd6"; + modelBlobHash = "sha256-GgE4M0G+m/BKkE4WgIlAHD8FM7OvQInTU22LNuSXzNY="; + paramsBlob = "56bb8bd477a519ffa694fc449c2413c6f0e1d3b1c88fa7e3c9d88d3ae49d4dcb"; + paramsBlobHash = "sha256-VruL1HelGf+mlPxEnCQTxvDh07HIj6fjydiNOuSdTcs="; + systemBlob = "547c3e47ebd093e990745a1b4068995a29c392645f8255308d91349ffbcea5a5"; + systemBlobHash = "sha256-VHw+R+vQk+mQdFobQGiZWinDkmRfglUwjZE0n/vOpaU="; +} diff --git a/pkgs/by-name/ollamaPackages/llama3_3-70b.nix b/pkgs/by-name/ollamaPackages/llama3_3-70b.nix new file mode 100644 index 000000000..a0871ca99 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/llama3_3-70b.nix @@ -0,0 +1,10 @@ +# +{ mkOllamaModel }: mkOllamaModel { + modelName = "llama3.3"; + variant = "70b"; + manifestHash = "sha256-putHSP0pkK0pUrIzWpWn+VLRoGEZoKpqLfbNBSqTo/o="; + modelBlob = "4824460d29f2058aaf6e1118a63a7a197a09bed509f0e7d4e2efb1ee273b447d"; + modelBlobHash = "sha256-SCRGDSnyBYqvbhEYpjp6GXoJvtUJ8OfU4u+x7ic7RH0="; + paramsBlob = "56bb8bd477a519ffa694fc449c2413c6f0e1d3b1c88fa7e3c9d88d3ae49d4dcb"; + paramsBlobHash = "sha256-VruL1HelGf+mlPxEnCQTxvDh07HIj6fjydiNOuSdTcs="; +} diff --git a/pkgs/by-name/ollamaPackages/magicoder-7b.nix b/pkgs/by-name/ollamaPackages/magicoder-7b.nix index 4d12f9459..16f4b0137 100644 --- a/pkgs/by-name/ollamaPackages/magicoder-7b.nix +++ b/pkgs/by-name/ollamaPackages/magicoder-7b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "magicoder"; variant = "7b"; - manifestHash = "sha256-xImVZS0m8meZXB81pBF+qv+GydqgsaaVtDVwrsx8vS4="; + manifestHash = "sha256-gAfeBvXZ9I3APxZ/rCxO8gtlFdIHUPzGoeFaZBpISlA="; modelBlob = "4a501ed4ce55e5611922b3ee422501ff7cc773b472d196c3c416859b6d375273"; modelBlobHash = "sha256-SlAe1M5V5WEZIrPuQiUB/3zHc7Ry0ZbDxBaFm203UnM="; paramsBlob = "58e1b82a691f46c155e57be607f1031930ea0cccc22daf4447f91d360f74b2d2"; diff --git a/pkgs/by-name/ollamaPackages/marco-o1-7b.nix b/pkgs/by-name/ollamaPackages/marco-o1-7b.nix index 90050989b..92f68878c 100644 --- a/pkgs/by-name/ollamaPackages/marco-o1-7b.nix +++ b/pkgs/by-name/ollamaPackages/marco-o1-7b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "marco-o1"; variant = "7b"; - manifestHash = "sha256-RUs48/4zT8/ylZMBOjc09ED87mXgUVfkCjT2hOOfBDo="; + manifestHash = "sha256-R1LmK6oKqXVOr8P51BacJhhDhxJaNCa8yxQ/cWneq5I="; modelBlob = "234ea779a388b986a6c961440f175e75c7cd336f70614d7c5b043c09a5931ad7"; modelBlobHash = "sha256-I06neaOIuYamyWFEDxdedcfNM29wYU18WwQ8CaWTGtc="; systemBlob = "8c772364849c7ab9cc387c82994af4e17861dabc91d9937e48ec6db602783c6a"; diff --git a/pkgs/by-name/ollamaPackages/mistral-small-22b.nix b/pkgs/by-name/ollamaPackages/mistral-small-22b.nix index 17caa7ac0..229ae68bd 100644 --- a/pkgs/by-name/ollamaPackages/mistral-small-22b.nix +++ b/pkgs/by-name/ollamaPackages/mistral-small-22b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "mistral-small"; variant = "22b"; - manifestHash = "sha256-ko90yOH9L6slUJ6lySFOuMEa8dV9aLbaNq/bl+hWmdA="; + manifestHash = "sha256-0JXNVTsE5r3lcQcr89i8CojDQOARrPEqXU+gbuNviLw="; modelBlob = "e5f39205cb1323dbfce381f15993d66ec7b40374b2cc1961bdf62828fb9709d1"; modelBlobHash = "sha256-5fOSBcsTI9v844HxWZPWbse0A3SyzBlhvfYoKPuXCdE="; paramsBlob = "ac9aa3c4956dba22deb5330f3dfc21a403d74742ef7227033235a92a3808e4da"; diff --git a/pkgs/by-name/ollamaPackages/mkOllamaModel.nix b/pkgs/by-name/ollamaPackages/mkOllamaModel.nix index 59080029b..b322e928e 100644 --- a/pkgs/by-name/ollamaPackages/mkOllamaModel.nix +++ b/pkgs/by-name/ollamaPackages/mkOllamaModel.nix @@ -7,6 +7,7 @@ { modelName, variant, + owner ? "library", manifestHash ? "", # grab the *Blob from the manifest (trim the `sha256:` prefix). # the manifest can be acquired by providing just the above parameters and building this package, then viewing the output @@ -21,21 +22,25 @@ stdenv.mkDerivation { name = modelName; srcs = [ (fetchurl { - url = "https://registry.ollama.ai/v2/library/${modelName}/manifests/${variant}"; + name = "manifest"; + url = "https://registry.ollama.ai/v2/${owner}/${modelName}/manifests/${variant}"; hash = manifestHash; }) ] ++ lib.optionals (modelBlob != "") [ (fetchurl { + name = "model-blob"; url = "https://registry.ollama.ai/v2/llama/${modelName}:${variant}/blobs/sha256-${modelBlob}"; hash = modelBlobHash; }) ] ++ lib.optionals (paramsBlob != "") [ (fetchurl { + name = "params-blob"; url = "https://registry.ollama.ai/v2/llama/${modelName}:${variant}/blobs/sha256-${paramsBlob}"; hash = paramsBlobHash; }) ] ++ lib.optionals (systemBlob != "") [ (fetchurl { + name = "system-blob"; url = "https://registry.ollama.ai/v2/llama/${modelName}:${variant}/blobs/sha256-${systemBlob}"; hash = systemBlobHash; }) @@ -60,17 +65,24 @@ stdenv.mkDerivation { runHook preBuild mkdir blobs - for _src in sha256-*; do - mv "$_src" blobs - done + ${lib.optionalString (modelBlob != "") '' + mv model-blob blobs/sha256-${modelBlob} + ''} + ${lib.optionalString (paramsBlob != "") '' + mv params-blob blobs/sha256-${paramsBlob} + ''} + ${lib.optionalString (systemBlob != "") '' + mv system-blob blobs/sha256-${systemBlob} + ''} # lots of fields are not required by ollama, # and removing them allows to also remove the files (hashes) they reference - jq 'del(.config)' < ${variant} \ + jq 'del(.config)' < manifest \ | jq '. + { layers: .layers | map(select(.mediaType != "application/vnd.ollama.image.license")) }' \ | jq '. + { layers: .layers | map(select(.mediaType != "application/vnd.ollama.image.template")) }' \ | jq '. + { layers: .layers | map(select(.mediaType != "application/vnd.docker.container.image.v1+json")) }' \ - > manifest + > manifest.new + mv manifest.new manifest runHook postBuild ''; @@ -97,11 +109,18 @@ stdenv.mkDerivation { local blobType="$1" local expectedBlobHash="$2" local blobHash=$(cat manifest | jq ".layers.[] | select(.mediaType == \"application/vnd.ollama.image.$blobType\") | .digest[7:]") + local blobHashNoQuotes=''${blobHash//\"/} + if [ -n "$blobHash" ]; then printf " %sBlob = %s;\n" "$blobType" "$blobHash" fi - if [ "''${blobHash//\"/}" != "$expectedBlobHash" ]; then + if [ -n "$expectedBlobHash" -a ! -e "blobs/sha256-$blobHashNoQuotes" ]; then + printf " %sBlob doesn't exist at blobs/sha256-$blobHashNoQuotes\n" + mismatchedBlobs+=("$blobType") + fi + + if [ "$blobHashNoQuotes" != "$expectedBlobHash" ]; then mismatchedBlobs+=("$blobType") fi } @@ -132,6 +151,6 @@ stdenv.mkDerivation { }; meta = { - homepage = "https://ollama.com/library/${modelName}"; + homepage = "https://ollama.com/${owner}/${modelName}"; }; } diff --git a/pkgs/by-name/ollamaPackages/package.nix b/pkgs/by-name/ollamaPackages/package.nix index 5df87959e..a5265b1e2 100644 --- a/pkgs/by-name/ollamaPackages/package.nix +++ b/pkgs/by-name/ollamaPackages/package.nix @@ -7,6 +7,13 @@ # - # - # - +# +# choosing a model, for sensitive/illicit things ("Uncensored General Intelligence"): +# - +# - +# - search "abliterated" or "abliterate" +# - search "uncensored" +# - search "Eric Hartford" { lib, newScope, @@ -22,6 +29,13 @@ lib.recurseIntoAttrs (lib.makeScope newScope (self: with self; { deepseek-coder-7b = callPackage ./deepseek-coder-7b.nix { }; deepseek-coder-v2-16b = callPackage ./deepseek-coder-v2-16b.nix { }; deepseek-coder-v2-16b-lite-instruct-q5_1 = callPackage ./deepseek-coder-v2-16b-lite-instruct-q5_1.nix { }; + deepseek-r1-1_5b = callPackage ./deepseek-r1-1_5b.nix { }; + deepseek-r1-7b = callPackage ./deepseek-r1-7b.nix { }; + deepseek-r1-14b = callPackage ./deepseek-r1-14b.nix { }; + deepseek-r1-32b = callPackage ./deepseek-r1-32b.nix { }; + deepseek-r1-abliterated-14b = callPackage ./deepseek-r1-abliterated-14b.nix { }; + dolphin-mistral-7b = callPackage ./dolphin-mistral-7b.nix { }; + dolphin-mixtral-8x7b = callPackage ./dolphin-mixtral-8x7b.nix { }; falcon2-11b = callPackage ./falcon2-11b.nix { }; gemma2-9b = callPackage ./gemma2-9b.nix { }; gemma2-27b = callPackage ./gemma2-27b.nix { }; @@ -30,6 +44,8 @@ lib.recurseIntoAttrs (lib.makeScope newScope (self: with self; { llama3-chatqa-8b = callPackage ./llama3-chatqa-8b.nix { }; llama3_1-70b = callPackage ./llama3_1-70b.nix { }; llama3_2-3b = callPackage ./llama3_2-3b.nix { }; + llama3_2-uncensored-3b = callPackage ./llama3_2-uncensored-3b.nix { }; + llama3_3-70b = callPackage ./llama3_3-70b.nix { }; magicoder-7b = callPackage ./magicoder-7b.nix { }; marco-o1-7b = callPackage ./marco-o1-7b.nix { }; mistral-7b = callPackage ./mistral-7b.nix { }; @@ -42,6 +58,9 @@ lib.recurseIntoAttrs (lib.makeScope newScope (self: with self; { qwen2_5-14b = callPackage ./qwen2_5-14b.nix { }; qwen2_5-32b = callPackage ./qwen2_5-32b.nix { }; qwen2_5-32b-instruct-q2_K = callPackage ./qwen2_5-32b-instruct-q2_K.nix { }; + qwen2_5-abliterate-7b = callPackage ./qwen2_5-abliterate-7b.nix { }; + qwen2_5-abliterate-14b = callPackage ./qwen2_5-abliterate-14b.nix { }; + qwen2_5-abliterate-32b = callPackage ./qwen2_5-abliterate-32b.nix { }; qwen2_5-coder-7b = callPackage ./qwen2_5-coder-7b.nix { }; qwq-32b = callPackage ./qwq-32b.nix { }; solar-pro-22b = callPackage ./solar-pro-22b.nix { }; diff --git a/pkgs/by-name/ollamaPackages/qwen2_5-14b.nix b/pkgs/by-name/ollamaPackages/qwen2_5-14b.nix index 27d458dc0..c49b56634 100644 --- a/pkgs/by-name/ollamaPackages/qwen2_5-14b.nix +++ b/pkgs/by-name/ollamaPackages/qwen2_5-14b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "qwen2.5"; variant = "14b"; - manifestHash = "sha256-1U+DYHu8mCbpzfSMeCgjYcGA9+mgNPSNQCOx5TQw92s="; + manifestHash = "sha256-fN9aAYfVxYzF02myVVkveEHRxGltRajIqUiUQDhbIvY="; modelBlob = "2049f5674b1e92b4464e5729975c9689fcfbf0b0e4443ccf10b5339f370f9a54"; modelBlobHash = "sha256-IEn1Z0sekrRGTlcpl1yWifz78LDkRDzPELUznzcPmlQ="; systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; diff --git a/pkgs/by-name/ollamaPackages/qwen2_5-32b.nix b/pkgs/by-name/ollamaPackages/qwen2_5-32b.nix index abd7cad47..b98749136 100644 --- a/pkgs/by-name/ollamaPackages/qwen2_5-32b.nix +++ b/pkgs/by-name/ollamaPackages/qwen2_5-32b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "qwen2.5"; variant = "32b"; - manifestHash = "sha256-Gt8djxgzdAm9BK9FrMAz5dxFEP1+Sg86w0ESGzxsNuA="; + manifestHash = "sha256-nxO6Epmv6gnZqVb8aoW+zJkRWm1Zb64gGlSHoDvcQ2g="; modelBlob = "eabc98a9bcbfce7fd70f3e07de599f8fda98120fefed5881934161ede8bd1a41"; modelBlobHash = "sha256-6ryYqby/zn/XDz4H3lmfj9qYEg/v7ViBk0Fh7ei9GkE="; systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; diff --git a/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-14b.nix b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-14b.nix new file mode 100644 index 000000000..70f0fe2d2 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-14b.nix @@ -0,0 +1,12 @@ +# +# uncensored version of qwen2.5 +{ mkOllamaModel }: mkOllamaModel { + owner = "huihui_ai"; + modelName = "qwen2.5-abliterate"; + variant = "14b"; + manifestHash = "sha256-qGXe8FVeBXD9oGuz6jVde48LXCZRBRPuFAR/U2kQhjA="; + modelBlob = "29ed0ac6f51294cdfcbdf77535162e751fac1fe7ebc87cb2893fb70f9e7b5edb"; + modelBlobHash = "sha256-Ke0KxvUSlM38vfd1NRYudR+sH+fryHyyiT+3D557Xts="; + systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; + systemBlobHash = "sha256-ZrnqCb1bcJnLtPyCDzG1dcA2b6Q5sIJFVmaSxnhOKB4="; +} diff --git a/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-32b.nix b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-32b.nix new file mode 100644 index 000000000..fc46354cf --- /dev/null +++ b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-32b.nix @@ -0,0 +1,12 @@ +# +# uncensored version of qwen2.5 +{ mkOllamaModel }: mkOllamaModel { + owner = "huihui_ai"; + modelName = "qwen2.5-abliterate"; + variant = "32b"; + manifestHash = "sha256-jcJWbTsgGMISTIcUKrpT4IrpPuQhMWVbJuyxKbU4If0="; + modelBlob = "70b5f74f481cdc895708221bd8a15e3a47293ab7cf50e75c80d7da7884a27cec"; + modelBlobHash = "sha256-cLX3T0gc3IlXCCIb2KFeOkcpOrfPUOdcgNfaeISifOw="; + systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; + systemBlobHash = "sha256-ZrnqCb1bcJnLtPyCDzG1dcA2b6Q5sIJFVmaSxnhOKB4="; +} diff --git a/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-7b.nix b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-7b.nix new file mode 100644 index 000000000..1b14214a5 --- /dev/null +++ b/pkgs/by-name/ollamaPackages/qwen2_5-abliterate-7b.nix @@ -0,0 +1,12 @@ +# +# uncensored version of qwen2.5 +{ mkOllamaModel }: mkOllamaModel { + owner = "huihui_ai"; + modelName = "qwen2.5-abliterate"; + variant = "7b"; + manifestHash = "sha256-EDSCR1ybTUAymZ3V1zg0eMrYuWauaumE1SXa9zUsIhk="; + modelBlob = "212345411ab817a8d7669ed63f24a30f2e2a2cd297455a6aad1de50c82f7691c"; + modelBlobHash = "sha256-ISNFQRq4F6jXZp7WPySjDy4qLNKXRVpqrR3lDIL3aRw="; + systemBlob = "66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e"; + systemBlobHash = "sha256-ZrnqCb1bcJnLtPyCDzG1dcA2b6Q5sIJFVmaSxnhOKB4="; +} diff --git a/pkgs/by-name/ollamaPackages/qwq-32b.nix b/pkgs/by-name/ollamaPackages/qwq-32b.nix index 885f68ab9..c851622b0 100644 --- a/pkgs/by-name/ollamaPackages/qwq-32b.nix +++ b/pkgs/by-name/ollamaPackages/qwq-32b.nix @@ -2,7 +2,7 @@ { mkOllamaModel }: mkOllamaModel { modelName = "qwq"; variant = "32b"; - manifestHash = "sha256-9i224DAvi8Onzjzaa0nh5HX2sfcTITDow1J0KVOdrBA="; + manifestHash = "sha256-RkB77aXAzf3PgD0jYoBJhSX1InGdY5g/WHWXcZiZYd8="; modelBlob = "fa711da9efad72a93edc6b16aadc2dba1345f3c16491350483104978b1e89c91"; modelBlobHash = "sha256-+nEdqe+tcqk+3GsWqtwtuhNF88FkkTUEgxBJeLHonJE="; paramsBlob = "f02dd72bb2423204352eabc5637b44d79d17f109fdb510a7c51455892aa2d216";