From f5bf33e96cc506039f7d2b9e01263a7f94104acd Mon Sep 17 00:00:00 2001 From: drjones Date: Fri, 18 Sep 2026 18:41:16 -0700 Subject: [PATCH] add .gitignore + connectivity test script --- .gitignore | 13 +++++++++++++ test_metatron.py | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 test_metatron.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4932494 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# test/piped input +input.txt + +# session state +.last_model +*.last_model + +# transcripts +metatron-*.md + +# pycache +__pycache__/ +*.pyc diff --git a/test_metatron.py b/test_metatron.py new file mode 100644 index 0000000..f066467 --- /dev/null +++ b/test_metatron.py @@ -0,0 +1,25 @@ +import json +import urllib.request + +OLLAMA = "http://10.30.20.29:11434" + +# 1. model list +d = json.load(urllib.request.urlopen(OLLAMA + "/api/tags", timeout=15)) +names = [m["name"] for m in d["models"]] +print("MODELS:", len(names)) +for n in names: + print(" -", n) + +# 2. quick chat (non-streaming, think:false) +payload = { + "model": names[0], + "messages": [{"role": "user", "content": "Reply with exactly: METATRON OK"}], + "stream": False, + "think": False, + "options": {"num_predict": 30}, +} +req = urllib.request.Request( + OLLAMA + "/api/chat", data=json.dumps(payload).encode(), + headers={"Content-Type": "application/json"}) +r = json.load(urllib.request.urlopen(req, timeout=90)) +print("REPLY:", repr(r["message"].get("content", "")))