Merge pull request #291748 from abysssol/update-ollama-0.1.27

ollama: 0.1.26 -> 0.1.27
This commit is contained in:
Pol Dellaiera 2024-02-28 10:15:42 +01:00 committed by GitHub
commit 200390b3ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 13 deletions

View file

@ -1,11 +1,13 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib.types) nullOr enum; inherit (lib) types;
cfg = config.services.ollama; cfg = config.services.ollama;
ollamaPackage = cfg.package.override { ollamaPackage = cfg.package.override {
inherit (cfg) acceleration; inherit (cfg) acceleration;
linuxPackages.nvidia_x11 = config.hardware.nvidia.package; linuxPackages = config.boot.kernelPackages.overrideAttrs {
nvidia_x11 = config.hardware.nvidia.package;
};
}; };
in in
{ {
@ -15,14 +17,14 @@ in
lib.mdDoc "Server for local large language models" lib.mdDoc "Server for local large language models"
); );
listenAddress = lib.mkOption { listenAddress = lib.mkOption {
type = lib.types.str; type = types.str;
default = "127.0.0.1:11434"; default = "127.0.0.1:11434";
description = lib.mdDoc '' description = lib.mdDoc ''
Specifies the bind address on which the ollama server HTTP interface listens. Specifies the bind address on which the ollama server HTTP interface listens.
''; '';
}; };
acceleration = lib.mkOption { acceleration = lib.mkOption {
type = nullOr (enum [ "rocm" "cuda" ]); type = types.nullOr (types.enum [ "rocm" "cuda" ]);
default = null; default = null;
example = "rocm"; example = "rocm";
description = lib.mdDoc '' description = lib.mdDoc ''

View file

@ -24,7 +24,14 @@
let let
pname = "ollama"; pname = "ollama";
version = "0.1.26"; version = "0.1.27";
src = fetchFromGitHub {
owner = "jmorganca";
repo = "ollama";
rev = "v${version}";
hash = "sha256-+ayby+yVknFHLTyLjMAPMnOTMSzTKqzi9caN/TppcEg=";
fetchSubmodules = true;
};
validAccel = lib.assertOneOf "ollama.acceleration" acceleration [ null "rocm" "cuda" ]; validAccel = lib.assertOneOf "ollama.acceleration" acceleration [ null "rocm" "cuda" ];
@ -74,14 +81,6 @@ let
buildGoModule.override { stdenv = overrideCC stdenv gcc12; } buildGoModule.override { stdenv = overrideCC stdenv gcc12; }
else else
buildGoModule; buildGoModule;
src = fetchFromGitHub {
owner = "jmorganca";
repo = "ollama";
rev = "v${version}";
hash = "sha256-Kw3tt9ayEMgI2V6OeaOkWfNwqfCL7MDD/nN5iXk5LnY=";
fetchSubmodules = true;
};
preparePatch = patch: hash: fetchpatch { preparePatch = patch: hash: fetchpatch {
url = "file://${src}/llm/patches/${patch}"; url = "file://${src}/llm/patches/${patch}";
inherit hash; inherit hash;