This is a submission for the Gemma 4 Challenge: Build with Gemma 4
What I Built
I built the AI Masala Engine, a "Cine-Intelligence" platform designed to solve the chronic problem of "infinite scrolling" through movie catalogs. Instead of generic genres, this app maps a user's specific emotional state—like "Nostalgic but Edgy"—to a combination of current cinematic culture (vibes/memes) and personalized film recommendations.
It acts as a hybrid bridge between deep movie reasoning and the fast-paced world of social cinema trends.
Demo
How I Used Gemma 4
The AI Masala Engine utilizes a Hybrid Multi-Model Architecture to ensure that each part of the user experience is powered by the right tool for the job. We didn't just use one model; we matched the competition guidelines by being intentional with model selection:
Gemma 4 31B Dense (Core Reasoning):
Why: We used the 31B Dense model for the complex Reason field in our recommendations. Connecting an abstract user preference like "Cyberpunk Noir with a hint of hope" to a specific classic film requires deep world knowledge and superior reasoning capabilities that only a server-grade dense model can provide.Gemma 4 26B Mixture-of-Experts (High-Throughput Extraction):
Why: For the "Trending Vibes" and "Cinematic Memes" section, we utilized the MoE architecture. Identifying cultural micro-trends across YouTube, blogs, and social media requires high throughput and the ability to process diverse, switching contexts rapidly. MoE allowed us to extract these vibes without sacrificing inference speed.Gemma 4 4B Small (Edge-Optimized Copy):
Why: We offloaded the generation of "Punchy Taglines" to the 4B model. These are concise, micro-copy elements where speed is prioritized over deep reasoning, simulating a workflow where this model could eventually run locally on a user's device for instant UI feedback.
The most compelling aspect of this project is the Inference Log visible in the app's footer, which shows the system "choosing" the path (Dense vs. MoE) based on the complexity of the user's movie prompt.
Code Highlight: Prompt Engineering for Model Rationale
// From src/services/geminiService.ts
const prompt = `
REASONING ARCHITECTURE (Gemma 4 31B Dense + 4B Small Hybrid):
- Use the 31B Dense reasoning path for the 'reason' field to provide deep cinematic links.
- Use the 4B Small path for 'tagline' to ensure punchy, micro-copy style output.
- Include a 'modelRationale' explaining how the Dense model connected this movie to the user's mood.
`;
Why "Mood" Relevancy Matters
The "Mood" relevancy is the heart of why this stands out.
- Beyond Metadata: Traditional search looks for "Action" or "1990s." Gemma 4 allows us to search for vibe. It understands that a "Neon-Noir Cyberpunk" mood isn't just about the setting—it's about the pacing, the color palette, and the philosophical undertones.
- The Model Rationale: By surfacing the modelRationale in the UI (e.g., "System Rationale: Gemma 4 31B Dense connected your 'melancholy optimism' to this film's use of natural light and non-linear storytelling"), I give the user insight into the AI's "thought process," turning a black-box recommendation into a collaborative discovery.
- Cultural Context: Integrating memes and vibes alongside movie picks makes the app feel "alive." It treats cinema as a living cultural conversation rather than a static database.
Core Feature Breakdown
- Craft Your Scene (Mood Recommender) Uses Gemma 4 31B Dense to perform deep-link reasoning, connecting complex emotional prompts to obscure cinematic parallels.
// System instruction for Dense Reasoning
REASONING ARCHITECTURE (Gemma 4 31B Dense):
- Use the 31B Dense reasoning path for the 'reason' field to provide deep cinematic links.
- Use the 4B Small (Edge-optimized) path for the 'tagline' to ensure punchy, micro-copy style output.
- Trend Intelligence (Vibe Analysis) Utilizes Gemma 4 26B MoE to process massive amounts of cultural data and identify shifting "Filmy Vibes" on social platforms.
// System instruction for MoE Throughput
INTELLIGENCE LAYER (Gemma 4 MoE 26B Optimized):
- Since you are performing high-throughput cultural extraction, utilize the Mixture-of-Experts reasoning path.
- Explain why a high-throughput social model was needed to catch this specific trend.
- Trending Memes (Cultural Extraction) Extracts the "current humor" of the film industry, turning critique into content by identifying micro-trends in cinematic discourse.
// Task: Identify 4 trending movie-related "Memes"
// that define the current cinematic humor or critique style.
Code Highlight: Multi-Model Prompting
This snippet from geminiService.ts shows how I orchestrate the different models within a single user flow to provide a "system rationale" for every recommendation:
// src/services/geminiService.ts
const prompt = `
REASONING ARCHITECTURE (Gemma 4 31B Dense + 4B Small Hybrid):
- Use the 31B Dense reasoning path for the 'reason' field to provide deep cinematic links.
- Include a 'modelRationale' for EACH recommendation explaining how the Dense model
connected this specific movie to the user's complex mood.
`;
Top comments (0)