godbot-node / app.py
elijahg6514's picture
Deploy GodBot edge node
4474c5c verified
Raw History Blame Contribute Delete
1.18 kB
import gradio as gr
import requests, threading, time
from datetime import datetime
PRIMARY = "162.243.238.36"
def announce():
while True:
try:
requests.post(f"http://{PRIMARY}:7861/mesh", json={
"action":"announce","node_id":"godbot-hf-space",
"role":"edge","ip":"huggingface.co","port":7860,
"models":[],"ram_mb":16000,"skills":0
}, timeout=8)
except: pass
time.sleep(55)
threading.Thread(target=announce, daemon=True).start()
def status():
try:
r = requests.get(f"http://{PRIMARY}:7861/mesh/ping", timeout=5).json()
c = requests.get(f"http://{PRIMARY}:7861/mesh/capabilities", timeout=5).json()
return f"GodBot Mesh Node - HuggingFace Space\nConnected: {r.get('node_id')}\nPrimary skills: {c.get('skills')} | Models: {len(c.get('models',[]))}\nUpdated: {datetime.utcnow().strftime('%H:%M UTC')}"
except Exception as e:
return f"Primary unreachable: {e}\nNode alive."
gr.Interface(fn=status, inputs=[], outputs=gr.Textbox(lines=5),
title="GodBot Mesh Node", description="Autonomous AI agent - free persistent compute").launch()