El Mghari builds AI apps for millions using a four-step framework
Open source dominance through modular architecture

Building AI applications that scale to millions of users requires a shift from complex monolithic thinking to a modular, lean architectural approach. Hassan El Mghari, Lead Developer Relations at Together AI, demonstrates that the most successful apps—like LlamaCoder or Blinkshot—rely on a streamlined four-step flow. The user provides input, the system makes a single targeted API call to an open-source model, the result is stored in a serverless database, and the output is served immediately. This simplicity allows developers to prioritize user experience and speed over complex backend orchestration.
The modern full-stack AI tech stack
To replicate this success, developers must leverage tools that minimize infrastructure friction. The recommended stack focuses on TypeScript-first libraries and serverless scaling:
- AI Inference: Together AI for querying open-source models like Llama 3 or DeepSeek.
- Framework: Next.js with TypeScript for a unified full-stack environment.
- Database: Neon for serverless Postgres and Prisma as the ORM.
- Authentication: Clerk for rapid user management setup.
- UI/UX: Tailwind CSS and Shadcn UI to ensure professional design without custom CSS bloat.
- Observability: Helicone for LLM-specific analytics and Plausible for web traffic.
Code walkthrough for rapid prototyping
The goal is to maintain a single API endpoint. In a typical Next.js Route Handler, you can trigger a model inference and return the stream directly to the client. This reduces latency and improves the perceived performance that users expect from modern AI tools.
import { Together } from "together-ai";
const together = new Together({ apiKey: process.env.TOGETHER_API_KEY });
export async function POST(req: Request) {
const { prompt } = await req.json();
// Step 2: Single API call to a high-performance OSS model
const response = await together.chat.completions.create({
model: "meta-llama/Llama-3-70b-chat-hf",
messages: [{ role: "user", content: prompt }],
stream: true,
});
// Step 4: Stream response back to the UI for instant feedback
return new Response(response.toReadableStream());
}
Seven rules for AI virality
Hassan El Mghari emphasizes that 80% of development time should be spent on the UI rather than the model itself. A beautiful, intuitive interface makes simple functions, such as PDF summarization, feel like premium products. Developers should launch within two days of a new model release to capture the "new tech" trend. By keeping apps free and open-source, builders create a viral loop where users share the output and other developers contribute to the code, effectively outsourcing marketing through community engagement. Success in this field is a numbers game; shipping one app a month is the baseline for finding a hit that resonates with millions.
- Hassan El Mghari
- 10%· people
- Next.js
- 10%· products
- Together AI
- 10%· companies
- Blinkshot
- 5%· products
- Clerk
- 5%· companies
- Other topics
- 62%

Using OSS models to build AI apps with millions of users — Hassan El Mghari
WatchAI Engineer // 18:47
We turn high signal in-person events for the top AI engineers, founders, leaders, and researchers in the world into the best free learning opportunities for millions around the world here on YouTube. Your subscribes, likes, comments, speaking, attendance, or sponsorships goes a long way toward making our biz model sustainable indefinitely. We strongly believe this industry deserves a better class of community and that we know how to do this well; we just need your support.