GoNix Hybrid AI
Inspiration
We believe access to intelligent AI should not depend entirely on a constant internet connection or sending every request to the cloud. Many students, educators, and everyday users need AI experiences that are responsive, accessible, and designed with privacy in mind.
This inspired us to build GoNix Hybrid AI: an intelligent assistant that explores how on-device AI and cloud AI can work together in one application.
Our goal is to give users a choice between local intelligence and cloud-powered capabilities, while making the transition between these environments controlled by user preferences and device capabilities.
What it does
GoNix Hybrid AI is a hybrid AI application built around two inference environments:
- On-device AI: Uses supported device capabilities to process requests locally when a compatible model and runtime are available.
- Cloud AI: Uses Firebase AI Logic with the configured Gemini model for cloud-based inference when cloud use is permitted.
The application supports four inference modes:
- "PREFER_ON_DEVICE" — prioritize local inference, with fallback subject to cloud consent and availability.
- "PREFER_IN_CLOUD" — prioritize cloud inference when the required consent and security conditions are met.
- "ONLY_ON_DEVICE" — restrict inference to the local environment.
- "ONLY_IN_CLOUD" — restrict inference to the cloud environment.
This approach gives the application a flexible foundation for adapting to different devices, connectivity conditions, and user preferences.
How we built it
We built GoNix Hybrid AI using React, TypeScript, Vite, Firebase, and Capacitor.
The shared hybrid inference logic coordinates the selected inference mode and determines which execution path is eligible to handle a request.
For browser-based experiences, the application checks for supported on-device AI capabilities rather than assuming every browser or device has a local model available.
For Android, we developed a native Capacitor integration that connects the application to Firebase AI Logic's on-device model capabilities. The Android implementation exposes model options for preview, fast preview, and stable availability.
For cloud inference, we integrated Firebase AI Logic with the configured Gemini model, "gemini-3.5-flash-lite". Cloud access is designed around explicit user consent and application security checks.
We also implemented streaming-oriented response handling, bounded retries, and safeguards intended to prevent local-only requests from silently switching to cloud inference.
Challenges we faced
One of our biggest challenges was designing a consistent AI experience across browser and Android environments, where model availability and runtime capabilities are not the same.
We also had to account for device compatibility, model availability, cloud consent, Firebase configuration, and application security.
Another challenge was making sure that choosing an inference mode actually influences the execution path, rather than simply presenting users with a choice that the application does not enforce.
These challenges shaped our architecture and reinforced the importance of transparent fallback behavior and user control.
What we learned
We learned that hybrid AI is not simply a matter of connecting a local model to a cloud model. It requires capability detection, inference orchestration, consent management, platform-specific integrations, and careful handling of failure conditions.
We also learned to distinguish between detecting that an AI API exists and verifying that a model is actually available and can successfully generate a response.
What's next
We are continuing to validate the application across compatible browsers and Android devices, with particular attention to on-device model availability, cloud inference, streaming, consent enforcement, and App Check verification.
Our long-term vision is to make GoNix Hybrid AI a practical foundation for more accessible, privacy-conscious AI experiences in education and beyond.
GoNix Hybrid AI — Local intelligence. Cloud power. One AI experience.
Built With
- android
- capacitor
- cloud-ai
- firebase
- firebase-ai-logic
- firebase-app-check
- gemini
- gemini-nano
- google-ai
- hybrid-ai
- javascript
- kotlin
- on-device-ai
- react
- recaptcha
- typescript
- vite