Rapid Prototyping and Scaling AI Applications Using Open Source Models
hassan_el_mghari · Tech · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Consumer AI app prototyping and scaling
Hassan El Mghari needed a repeatable way to build many AI applications quickly, validate user interest, and scale successful open-source model apps to millions of users without complex custom MLOps infrastructure.
Constraints:
- Success was hard to predict even after dozens of apps.
- The apps needed simple enough architectures to launch quickly and iterate.
- Costs and usage limits had to be considered before public launches.
- The product experience needed mobile-friendly UI and shareability, not just model quality.
Architecture
Hassan's standard architecture keeps AI apps simple: user input enters a Next.js/TypeScript app, one or two API calls go to an open-source model on Together AI, outputs are stored in a Neon/Postgres database or S3, and results are shown to the user. Clerk handles auth, Prisma handles database access, ShadCN/Tailwind handle UI, Vercel hosts the app, Plausible tracks web analytics, and Helone tracks LLM analytics and request debugging.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR A["User input"] --> B["Next.js application"] B --> C["Together AI"] B --> D["Neon Postgres"] E["Prisma"] --> D B --> F["Clerk"] B --> G["S3"] B --> H["Plausible"] C --> I["Helone"] B --> J["Vercel hosting"]
Components
| Component | Role | Interacts with |
|---|---|---|
User input |
Text prompt, image upload, git diff, resume, screenshot, or other app input. | Next.js application |
Next.js application |
Full-stack TypeScript app surface for user interaction and API calls. | User input, Together AI, Neon Postgres, Clerk, S3, Vercel hosting |
Together AI |
Open-source model inference platform for chat, reasoning, image, vision, and audio models. | Next.js application |
Neon Postgres |
Serverless PostgreSQL database for persistence. | Next.js application, Prisma |
Prisma |
TypeScript ORM for database access. | Next.js application, Neon Postgres |
Clerk |
Authentication and usage-control support. | Next.js application |
S3 |
Image upload and storage layer. | Next.js application |
Plausible |
Website analytics for visitors, geography, and devices. | Next.js application |
Helone |
LLM analytics for request inspection and troubleshooting. | Together AI, Next.js application |
Vercel hosting |
Serverless hosting for application deployment. | Next.js application |
Data flow
A user types text or uploads an image. The application sends the input to a Together AI model, receives a text/image/code output, persists it in a database or object store, and displays it through the app UI. Analytics from Plausible and Helone help monitor visitors, devices, traffic sources, LLM requests, and troubleshooting details.
3 supporting quotes
Why this architecture
The architecture is intentionally simple because the main loop is idea generation, quick launch, market feedback, and iteration. One or two model API calls are enough for many AI apps, and the serverless stack keeps effort focused on product/UI and virality instead of infrastructure.
3 supporting quotes
Models used: Qwen · DeepSeek · Flux · Together AI open source models
Scale
- Hassan built about 40 AI apps over four years.“Hassan has built approximately 40 AI applications over four years”summary, stated
- The text-to-app builder processed about 5 million requests and built about 1 million apps.“I've had about 5 million requests go through this app and about a million apps built”transcript, stated
- An image app generated about 48 million images.“has uh about 48 million images that were actually generated uh with this app.”transcript, stated
- A commit message generator reached about 40,000 installs/downloads.“I think I got about 40,000 people that have installed it and and downloaded it and it's also open source”transcript, stated
Alternatives considered (roads not taken)
Build complex multi-step AI workflows by default
Rejected because: Most apps could be validated faster with one or two API calls and a simple UI.
Spend months building before launch
Rejected because: The speaker still cannot predict which apps will work, so early launch de-risks ideas.
Optimize only the AI model and ignore UI
Rejected because: The speaker spends most time on UI because even simple AI ideas succeed when easy and attractive to use.
Patterns
model-routing (model-operations)
The stack leans on Together AI for access to multiple open-source model families and makes swapping models cheap.
observability-tracing (operations)
Plausible and Helone provide web and LLM-specific analytics for user behavior and request debugging.
latency-optimization (performance)
The recommended app shape keeps inference to one or two API calls, helping fast launch and simple runtime behavior.
Tradeoffs
Keep architecture simple.
Chose One or two API calls plus serverless app stack over Complex custom MLOps pipelines.
Rationale: Simplicity improves launch speed, validation, and iteration.
Launch early.
Chose Fast public release and iteration over Six-month build before feedback.
Rationale: If nobody cares, a week of work is an acceptable loss; six months is not.
Use sponsor/partner infrastructure for free open-source apps.
Chose Together AI, Neon, Clerk, and similar partner support over Direct user monetization from the beginning.
Rationale: Open-source visibility can align infrastructure sponsorship with app distribution.
Gotchas (what bit them)
AI app success is difficult to predict.
Root cause: Even after many apps, the speaker cannot know which ideas will go viral.
Resolution: Build simple versions, launch early, and let market feedback decide where to invest.
Complex concepts lead to overbuilding.
Root cause: Grandiose ideas encourage months of development before validation.
Resolution: Choose ideas that can be described in five words and reduced to a simple app.
Bad UI can sink simple AI apps.
Root cause: Users judge the whole experience, not only the model response.
Resolution: Invest heavily in UI, ease of use, and shareable presentation.
Evaluation
The case evaluates success through product analytics and market response rather than formal ML benchmarks: user counts, requests, outputs generated, GitHub/open-source adoption, viral sharing, web analytics, and LLM request traces.
Metrics: 5 million requests · 1 million apps built · 48 million images generated · 40,000 installs/downloads · Unique visitors and device/geography analytics · LLM request troubleshooting
3 supporting quotes
Outcomes
- Multiple apps reached million-user scale.
- One text-to-app builder processed about 5 million requests and generated about 1 million apps.
- One image app generated about 48 million images.
- The standard simple architecture proved sufficient for significant production load.
The source reports approximately 40 AI apps, 5 million text-to-app requests, 1 million generated apps, 48 million generated images, over 1 million users for some apps, and about 40,000 installs/downloads for an early app.