From 0b2415e6844617a63ae9ab4f4182d49a9ed91dbb Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 11 Feb 2025 16:05:41 -0600 Subject: [PATCH] add flake and source --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 36 ++++++++++++++++++++++++++++++++++++ src/siren.py | 9 +++++++++ 3 files changed, 72 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/siren.py diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..874b59a --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1739206421, + "narHash": "sha256-PwQASeL2cGVmrtQYlrBur0U20Xy07uSWVnFup2PHnDs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "44534bc021b85c8d78e465021e21f33b856e2540", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ccfb748 --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Build Project Siren"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + }; + + outputs = { self, nixpkgs, ... }: let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + + Siren = pkgs.stdenv.mkDerivation { + + name = "Siren"; + + src = ./src; + + buildInputs = with pkgs; [ + (python311.withPackages (ps: with ps; [ + ollama + ])) + ]; + + buildPhase = '' + + ''; + + installPhase = '' + mkdir -p $out/bin + ''; + }; + + packages.${system}.default = self.Siren; + }; +} diff --git a/src/siren.py b/src/siren.py new file mode 100644 index 0000000..b5f2f69 --- /dev/null +++ b/src/siren.py @@ -0,0 +1,9 @@ +import ollama + +c = ollama.Client( + host='https://ollama.blunkall.us' + ) + +r = c.generate(model='llama3.2', prompt='say hello')['response'] + +print(r)