El Mghari builds AI apps for millions using a four-step framework

AI Engineer////3 min read

Open source dominance through modular architecture

El Mghari builds AI apps for millions using a four-step framework
Using OSS models to build AI apps with millions of users — Hassan El Mghari

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:

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.

Topic DensityMention share of the most discussed topics · 21 mentions across 18 distinct topics
Hassan El Mghari
10%· people
Next.js
10%· products
Together AI
10%· companies
Blinkshot
5%· products
Clerk
5%· companies
Other topics
62%
End of Article
Source video
El Mghari builds AI apps for millions using a four-step framework

Using OSS models to build AI apps with millions of users — Hassan El Mghari

Watch

AI 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.

Who and what they mention most
Anthropic
26.9%21
Claude
21.8%17
OpenAI
19.2%15
Cursor
15.4%12
3 min read0%
3 min read