add .gitignore + connectivity test script

This commit is contained in:
drjones
2026-09-18 18:41:16 -07:00
parent 8b52a1faad
commit f5bf33e96c
2 changed files with 38 additions and 0 deletions

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
# test/piped input
input.txt
# session state
.last_model
*.last_model
# transcripts
metatron-*.md
# pycache
__pycache__/
*.pyc

25
test_metatron.py Normal file
View File

@@ -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", "")))