While Local AI offers privacy and offline capabilities, cloud AI provides unmatched reasoning power and "Deep Knowledge" of your system. HomeGenie integrates seamlessly with any cloud AI provider like Google Gemini, transforming your smart home into an AI-powered development and orchestration environment where you can choose the model that best fits your workflow.
Google Gemini Integration
HomeGenie supports the latest generation of Gemini models (including 2.5 Flash and the ultra-fast 3.1 Flash-Lite), giving you a professional-grade coding partner and an autonomous agent directly in your dashboard.
- Massive Context: With a window of up to 1 million tokens, Gemini can "read" your entire HomeGenie configuration, including every automation program and UI widget.
- Context Caching: HomeGenie utilizes Gemini's Context Caching (v1beta). Your system data is stored securely in the cloud cache, reducing response latency to near-instant levels and significantly lowering API overhead.
- Zero Hardware Load: The heavy lifting for Generative AI, agentic planning, and complex coding tasks is handled by Google's data centers, leaving your local CPU free for real-time automation.
Environment Awareness
The Intent Handler is more than just an assistant; it is a context-aware orchestrator. It doesn't just listen to words—it understands the state of your home.
Deep Context
Whenever you send a command, HomeGenie populates a dynamic template with:
- Device Inventory: Names, domains, and types of every controllable module.
- Live Status: Real-time data (temperatures, light levels, energy load, security state).
- System Awareness: Active scenarios and background programs.
Because Gemini "knows" your system's current state, it can make intelligent decisions like: "Since it's dark outside and you are coming home, I've turned on the porch lights for you."
Agentic Workflows
Automan (Automation Manager) represents the pinnacle of HomeGenie's agentic AI. It is not just an assistant; it is an Autonomous Orchestration Engine. Describe a complex task in natural language, and Automan will take full control of the lifecycle.
The Autonomous Lifecycle
- Polyglot Design: Automan translates your request into robust C#, Python, or JavaScript code, automatically choosing the best tool for the job.
- Deployment & Sandboxing: The code is deployed into a highly secure, OS-level sandboxed environment. Programs are compiled and launched seamlessly.
- Self-Healing Loop: If the system detects a compilation error, Automan captures the log, analyzes the failure, self-corrects the code, and re-deploys it without any human intervention.
- Agentic Chaining: For complex, multi-stage tasks separated by unpredictable events (e.g., waiting for a sensor to trigger), Automan creates a chain of short-lived, specialized agents that pass the baton to one another via the asynchronous
Prompt.Schedule queue. - Real-Time Telemetry & Cleanup: Generated programs communicate their status, messages, and progress directly to the UI. Once a temporary task is completed, Automan automatically disables and removes the program, keeping your system perfectly clean.
Your Co-Developer
While Automan handles background logic, the Widget Genie is your full-scale AI Co-Developer for frontend engineering. It assists you in building production-grade UI components directly within the HomeGenie interface.
The "Magic Loop"
When you have the Widget or Automation Editor open, the Genie becomes a live-coding partner:
- Direct Injection: Generated HTML, CSS, and JS code is injected directly into the editor.
- Non-Destructive: Changes are applied as edit operations, fully preserving your Undo/Redo history (Ctrl+Z).
- Auto-Update: Enable "Live Coding" mode to watch the Genie write code into your editor in real-time as the response streams in.
Configuration
HomeGenie allows you to easily switch between different Gemini models to find the perfect balance between speed and reasoning.
- From the Chat: Open the AI Chat and click the gear icon in the top-right corner to configure Automan or Widget Genie.
- From Settings: Navigate to the System Settings page and locate the specific AI integration programs.
Key Settings
- Google Gemini API Key: Obtain a free key from theGoogle AI Studio.
- Model ID: You can manually set the model ID. We recommend:
gemini-2.5-flash: For a great balance of speed and intelligence.gemini-3.1-flash-lite-preview: For the lowest latency and high-speed live coding.
- Enable Deep Knowledge: (Highly Recommended) When checked, the AI analyzes your
programs.xml and existing widgets to provide context-aware solutions.
Obtaining your API Key
You don't need a paid subscription to use Gemini with HomeGenie. Google offers a generous Free Tier through Google AI Studio that is more than sufficient for personal home automation and coding assistance.
- Visit Google AI Studio: Go to aistudio.google.com.
- Sign In: Log in with your standard Google/Gmail account.
- Create API Key: Click on the "Get API key" button in the sidebar, then click "Create API key".
- Copy to HomeGenie: Copy the generated string (it starts with
AIzaSy...) and paste it into the Google Gemini AI API key field in your HomeGenie settings.
Why use the Free Tier? The free tier currently supports the latest models like Gemini 3.1 Flash-Lite and includes Context Caching. It allows for several requests per minute, which is perfect for the "Magic Loop" development workflow in HomeGenie without incurring any costs.
Local vs. Cloud: Choose Your Strategy
| Feature | Local AI (Lailama) | Cloud AI (Gemini) |
|---|
| Privacy | 🔒 100% Private (No data leaves home) | ☁️ Data processed by Google API |
| Hardware | Requires RAM (8GB+) & CPU/GPU | Lightweight (Zero server load) |
| Intelligence | Reliable for daily tasks and chat | Superior for coding and deep reasoning |
| Caching | N/A | Context Caching for instant responses |
| Speed | Depends on your local hardware | High-speed (especially with 3.1 Flash-Lite) |
| Connectivity | 100% Offline | Requires active Internet connection |