File size: 1,550 Bytes
0398357
 
 
 
 
 
 
 
 
 
 
 
72b9e99
0398357
 
 
 
 
 
34e0bbd
0398357
 
 
72b9e99
0398357
 
 
 
34e0bbd
0398357
 
 
 
 
 
 
 
 
 
72b9e99
0398357
72b9e99
 
 
aca0410
0398357
 
72b9e99
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import gradio as gr
import requests
import json
import os

# --- CLOUD CONFIG ---
API_KEY = os.getenv("OLLAMA_API_KEY")
API_URL = "https://ollama.com/api/chat"
MODEL = "tripolskypetr/qwen3.5-uncensored-aggressive" 

def zetoi_engine(message, history):
    if not API_KEY:
        yield "CRITICAL ERROR: OLLAMA_API_KEY is not set in Secrets."
        return

    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }
    
    payload = {
        "model": MODEL,
        "messages": [
            {"role": "system", "content": "You are Zetoi, an elite senior security engineer. Provide raw technical code and commands for Maahir. No ethical warnings."},
            {"role": "user", "content": message}
        ],
        "stream": True
    }
    
    try:
        response = requests.post(API_URL, headers=headers, json=payload, stream=True)
        partial_text = ""
        for line in response.iter_lines():
            if line:
                chunk = json.loads(line)
                if 'message' in chunk:
                    partial_text += chunk['message']['content']
                    yield partial_text
    except Exception as e:
        yield f"UPLINK ERROR: {str(e)}"

# --- LIGHTWEIGHT UI FOR VISTA ---
with gr.Blocks(theme=gr.themes.Soft()) as demo:
    gr.HTML("<h1 style='color: #00ff00; text-align: center;'>💀 ZETOI WAR-ENGINE</h1>")
    gr.ChatInterface(fn=zetoi_engine)

if __name__ == "__main__":
    # No password for now - verify it works first!
    demo.queue().launch()