summaryrefslogtreecommitdiff
path: root/Biz/Llamacpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Llamacpp.py')
-rw-r--r--Biz/Llamacpp.py37
1 files changed, 34 insertions, 3 deletions
diff --git a/Biz/Llamacpp.py b/Biz/Llamacpp.py
index cd47e1e..9a2ff86 100644
--- a/Biz/Llamacpp.py
+++ b/Biz/Llamacpp.py
@@ -1,4 +1,35 @@
-"""Llamacpp."""
+"""
+Test that llama.cpp can build and exec in the omni repo.
-# : run nixos-23_11.llama-cpp
-# : run nixos-23_11.openblas
+Note that this does not test if llama-cpp can actually execute any models. I
+(currently) use ollama for running and managing models, but I'd like to make
+sure llama-cpp still works in case I need/want to switch at some point.
+"""
+
+# : out llamacpp-test
+# : run llama-cpp
+
+import os
+import sys
+import unittest
+
+
+class TestLlamaCpp(unittest.TestCase):
+ """Test that llama.cpp is available."""
+
+ def test_in_path(self) -> None:
+ """Test that llama.cpp is in $PATH."""
+ self.assertTrue("llama-cpp" in os.environ.get("PATH", ""))
+
+
+def main() -> None:
+ """Entrypoint."""
+ if sys.argv[1] == "test":
+ sys.argv.pop()
+ unittest.main()
+ else:
+ sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()