MQUEN — Privacy-First AI Content Moderation

Inspiration

Online communities need effective content moderation, but traditional moderation systems often depend on centralized cloud processing. This can introduce privacy concerns, network dependency, latency, and limited control over where user content is processed.

We wanted to explore a different approach: What if AI-powered moderation could run directly on a user's device while still offering cloud intelligence when needed?

That idea inspired MQUEN — a flexible AI moderation platform that combines local inference using Gemma with cloud inference using Gemini. Our goal is to make content moderation more accessible, privacy-conscious, and adaptable to different deployment requirements.

What it does

MQUEN analyzes user-generated comments and identifies potentially harmful or inappropriate content using AI.

Its core feature is a flexible inference system with three modes:

  • ONLY_ON_DEVICE: Runs moderation locally using Gemma, minimizing the need to send user content to external services.
  • ONLY_IN_CLOUD: Uses Gemini for cloud-based moderation when cloud processing is explicitly enabled.
  • PREFER_ON_DEVICE: Prioritizes local inference and can use cloud inference when permitted and supported.

The platform also provides moderation explanations, a moderation queue, evaluation tools, and privacy-oriented controls to help users understand and manage moderation decisions.

MQUEN is designed around an important principle: AI should be powerful without forcing users to sacrifice control over their data.

How we built it

We built MQUEN using a modern TypeScript-based web stack and integrated Google's AI models into a flexible inference architecture.

The main components include:

  • Gemma: On-device AI inference for privacy-conscious moderation.
  • Gemini: Cloud-based AI inference for moderation when enabled.
  • Firebase AI Logic: Integration with Google's cloud AI capabilities.
  • Firebase App Check: Helps protect cloud-facing Firebase resources.
  • TypeScript and React: Application architecture and interactive user interface.
  • Vitest: Unit testing for inference routing, moderation logic, and core functionality.
  • Playwright: Browser-based end-to-end testing.

A key architectural decision was separating inference routing from moderation logic. This allows the application to select an inference source according to the user's chosen mode, cloud consent, and model availability.

We also built evaluation functionality to assess moderation performance through metrics such as accuracy, latency, and false positives, with separate visibility into local and cloud inference results.

Challenges we faced

1. Balancing privacy and AI capability

One of our biggest challenges was supporting local and cloud inference without compromising the user's control. We designed separate execution paths and explicit cloud-consent checks.

2. Building reliable inference routing

Supporting multiple inference modes required careful handling of model availability, network conditions, consent, and fallback behavior. In particular, cloud-only mode must not silently switch to local inference, and local-only mode must not depend on cloud services.

3. Firebase App Check integration

Securing cloud AI requests while keeping local inference independent of cloud attestation required careful separation of Firebase initialization and App Check responsibilities.

4. Meaningful evaluation

We needed evaluation results that accurately represented both successful and failed requests. We focused on transparent reporting instead of allowing failed inferences to disappear from benchmark results.

5. Testing across the application

We developed unit tests and browser-based tests to validate core logic, inference behavior, privacy controls, and important user interactions.

What we learned

Building MQUEN taught us that integrating AI models is only one part of building a reliable AI product. Model selection, inference routing, privacy, security, error handling, and evaluation are equally important.

We learned how to work with local and cloud AI inference, integrate Firebase AI services, design consent-aware architectures, and build automated tests for complex application workflows.

Most importantly, we learned that privacy and powerful AI do not have to be competing priorities.

What's next

We want to expand MQUEN with more advanced moderation policies, improved evaluation datasets, additional model support, and better tools for understanding moderation decisions.

Our long-term vision is to make MQUEN a flexible moderation platform that gives communities greater control over how AI processes and protects their content.

Built With

Share this project:

Updates

Submission history