File size: 1,112 Bytes
07a6177
 
 
 
6c25357
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
07a6177
6c25357
 
 
 
 
 
 
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
import streamlit as st
import os
import requests

st.set_page_config(page_title="Core Interface", page_icon="⚡")

# Premium look
st.markdown("""
    <style>
    .main { background-color: #0e1117; color: #ffffff; }
    .stTextInput > div > div > input { background-color: #262730; color: white; }
    </style>
    """, unsafe_allow_html=True)

PIN = os.getenv("PIN", "1234")

if "auth" not in st.session_state:
    st.session_state.auth = False

if not st.session_state.auth:
    st.title("🔒 System Restricted")
    val = st.text_input("Access Key", type="password")
    if st.button("Unlock"):
        if val == PIN:
            st.session_state.auth = True
            st.rerun()
        else:
            st.error("Incorrect.")
else:
    st.title("⚡ Server Node Active")
    st.success("API Path: `/api/generate` (Unlocked)")
    st.info("Model: `qwen2.5:0.5b` pre-loaded.")
    
    # Status Check
    if st.button("Check Ollama Health"):
        try:
            r = requests.get("http://localhost:11434/api/tags")
            st.json(r.json())
        except:
            st.error("Backend offline.")