summaryrefslogtreecommitdiff
path: root/Omni/Bild/Deps/llm-ollama.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-02-04 21:18:03 -0500
committerBen Sima <ben@bsima.me>2025-02-04 21:18:03 -0500
commit9f5b334eb6d0f64460f14d76255b096777a46332 (patch)
treedb357ca2a933456e1f35c17a1c85000fb5a64b9d /Omni/Bild/Deps/llm-ollama.nix
parent86ea51353c223cdc82cb8ebd013d58d70a7e646a (diff)
Update ollama, llm-ollama, openai-python, llm
I couldn't use llm-ollama because it required some package upgrades, so I started going down that rabbit hole and ended up 1) realizing that these packages are way out of date now, and 2) fiddling with overrides to get everything to work. I finally figured it out, the `postPatch` in ollama-python was throwing me off for like half a day. Anyway, one thing to note is that these are changing fast and I need to either move onto nixpkgs unstable for python stuff, or maintain my own builds of all of these. Not sure which is more appropriate right now. Oh and I had to fixup some logging stuff in Biz/Storybook.py because ruff started complaining about something, which is weird because I don't think the version changed? But it was easy enough to change.
Diffstat (limited to 'Omni/Bild/Deps/llm-ollama.nix')
-rw-r--r--Omni/Bild/Deps/llm-ollama.nix57
1 files changed, 36 insertions, 21 deletions
diff --git a/Omni/Bild/Deps/llm-ollama.nix b/Omni/Bild/Deps/llm-ollama.nix
index 15b26cc..3956bb7 100644
--- a/Omni/Bild/Deps/llm-ollama.nix
+++ b/Omni/Bild/Deps/llm-ollama.nix
@@ -1,47 +1,62 @@
{
+ lib,
buildPythonPackage,
fetchFromGitHub,
- lib,
+ # build-system
+ setuptools,
llm,
+ # dependencies
+ click,
ollama,
+ pydantic,
+ # tests
pytestCheckHook,
- setuptools,
- pythonOlder,
}:
buildPythonPackage rec {
pname = "llm-ollama";
- version = "0.3.0";
+ version = "0.8.2";
pyproject = true;
- disabled = pythonOlder "3.8";
-
src = fetchFromGitHub {
owner = "taketwo";
- repo = pname;
- rev = "refs/tags/${version}";
- hash = "sha256-Ar0Ux8BNGY0i764CEk7+48J6jnndlRIIMPZ9tFpXiy4=";
+ repo = "llm-ollama";
+ tag = version;
+ hash = "sha256-/WAugfkI4izIQ7PoKM9epd/4vFxYPvsiwDbEqqTdMq4=";
};
- nativeBuildInputs = [setuptools];
+ build-system = [
+ setuptools
+ # Follows the reasoning from https://github.com/NixOS/nixpkgs/pull/327800#discussion_r1681586659 about including llm in build-system
+ llm
+ ];
- buildInputs = [llm ollama];
+ dependencies = [
+ click
+ ollama
+ pydantic
+ ];
- propagatedBuildInputs = [ollama];
+ nativeCheckInputs = [
+ pytestCheckHook
+ ];
+ # These tests try to access the filesystem and fail
disabledTests = [
- # wants to mkdir in the /homeless-shelter
- "test_registered_models"
+ "test_registered_model"
+ "test_registered_chat_models"
+ "test_registered_embedding_models"
+ "test_registered_models_when_ollama_is_down"
];
- nativeCheckInputs = [pytestCheckHook];
-
- pythonImportsCheck = ["llm_ollama"];
+ pythonImportsCheck = [
+ "llm_ollama"
+ ];
- meta = with lib; {
+ meta = {
+ description = "LLM plugin providing access to Ollama models using HTTP API";
homepage = "https://github.com/taketwo/llm-ollama";
- description = "LLM plugin providing access to local Ollama models usting HTTP API";
changelog = "https://github.com/taketwo/llm-ollama/releases/tag/${version}";
- license = licenses.asl20;
- maintainers = with maintainers; [bsima];
+ license = lib.licenses.asl20;
+ maintainers = with lib.maintainers; [erethon];
};
}