import gradio as gr import json from datetime import datetime import random CSS = """ :root { --primary: #4f46e5; --bg: #0a0a0f; --surface: #12121a; --text: #f0f0f4; --accent: #818cf8; } * { box-sizing: border-box; } body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; } .gradio-container { max-width: 1000px !important; margin: 0 auto; } """ AGENTS = [ {"name": "Code Assistant", "icon": "💻", "status": "ready", "description": "Write, review, and refactor code"}, {"name": "Data Analyst", "icon": "📊", "status": "ready", "description": "Analyze data and generate insights"}, {"name": "Research Bot", "icon": "🔬", "status": "ready", "description": "Research topics and summarize findings"}, {"name": "Email Composer", "icon": "✉️", "status": "ready", "description": "Draft and refine email communications"}, {"name": "Document Processor", "icon": "📄", "status": "beta", "description": "Extract and process document content"}, {"name": "Task Scheduler", "icon": "📅", "status": "beta", "description": "Manage schedules and set reminders"}, ] def get_agent_status(): return [{"name": a["name"], "icon": a["icon"], "status": a["status"]} for a in AGENTS] def simulate_agent_response(agent_name: str, task: str): responses = { "Code Assistant": f"```python\n# Generated by {agent_name}\ndef solution():\n # Analyzing: {task}\n return \"Implementation complete\"\n```", "Data Analyst": f"📊 **Analysis Results**\n\nAnalyzed: {task}\n- Rows processed: {random.randint(1000, 50000):,}\n- Insights found: {random.randint(3, 12)}\n- Confidence: {random.uniform(85, 99):.1f}%", "Research Bot": f"🔬 **Research Summary**\n\nTopic: {task}\n- Sources reviewed: {random.randint(5, 25)}\n- Key findings: {random.randint(3, 8)}\n- Generated: {datetime.now().strftime('%Y-%m-%d %H:%M')}", } default = f"**{agent_name}** processing: _{task}_\n\nTask has been queued and will be processed locally on your device." return responses.get(agent_name, default) def get_system_metrics(): return { "cpu_usage": f"{random.uniform(10, 80):.1f}%", "memory_usage": f"{random.uniform(1, 8):.1f} GB", "active_agents": random.randint(1, 4), "tasks_completed": random.randint(50, 500), "uptime": f"{random.randint(1, 72)}h {random.randint(0, 59)}m", "local_model": "Raven AI Core v0.1.0", "privacy_mode": "✅ Enabled (All processing local)", } with gr.Blocks(css=CSS, title="Home for AI", theme=gr.themes.Soft( primary_hue="indigo", neutral_hue="slate", )) as demo: gr.HTML("""
🏠

Home for AI

Enterprise Desktop Operations Platform

Zero Trust Local First Cross Platform Tauri + Rust
""") with gr.Tabs(): with gr.Tab("🤖 Agent Hub"): gr.HTML("

Available Agents

") agent_grid = gr.HTML() refresh_btn = gr.Button("🔄 Refresh Agents", variant="secondary") def render_agents(): agents = get_agent_status() cards = "
" for a in agents: status_color = "#22c55e" if a["status"] == "ready" else "#fbbf24" status_text = "Ready" if a["status"] == "ready" else "Beta" cards += f"""
{a["icon"]}
{a["name"]}
● {status_text}
""" cards += "
" return cards refresh_btn.click(fn=render_agents, outputs=agent_grid) agent_grid.value = render_agents() with gr.Tab("💬 Agent Chat"): agent_selector = gr.Dropdown( choices=[a["name"] for a in AGENTS], label="Select Agent", value="Code Assistant", ) task_input = gr.Textbox( label="Describe your task", placeholder="e.g., Write a Python function to sort a list...", lines=3, ) submit_btn = gr.Button("Run Task", variant="primary") agent_output = gr.Markdown(label="Agent Response") submit_btn.click( fn=simulate_agent_response, inputs=[agent_selector, task_input], outputs=agent_output, ) with gr.Tab("📊 System Monitor"): metrics_btn = gr.Button("Refresh Metrics", variant="primary") metrics_output = gr.JSON(label="System Metrics") metrics_btn.click(fn=get_system_metrics, outputs=metrics_output) gr.HTML("""

Privacy Notice

All processing happens locally on your device. No data leaves your machine. Home for AI operates on a zero-trust architecture — your data, your compute.

""") with gr.Tab("📱 Download"): gr.HTML("""

Get Home for AI

🪟

Windows

.exe installer

🍎

macOS

.dmg installer

🐧

Linux

.AppImage / .deb

GitHub Repository →

""") gr.HTML("""

Home for AI — Zero-Trust Desktop AI | GitHub

""") if __name__ == "__main__": demo.launch()