hacking_ai / app.py
zetoi's picture
Update app.py
72b9e99 verified
Raw
History Blame Contribute Delete
1.55 kB
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()