Spaces:
Paused
Paused
| 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.") |