calibur
Back to Inventory
In ProgressAI / Cross-Platform / android, iOS, Web

PAUG AI

Premium AI models for Bangladesh — top up with bKash, pick your model from 10+ available models (Gemini, Claude, GPT, Grok etc), pay per use.

FlutterSupabaseNextjsDartRiverpodDeno Edge FunctionsOpenRouterPostgres + RLSSSE Streaming

The Problem

Premium AI models charge subscription fees in USD, putting tools like ChatGPT Plus out of reach for many Bangladeshi users. Local payment rails (bKash) and BDT-native pricing simply don't exist in the global AI market. Even people who buys the subscriptions, many don't use them to get their money's worth. Even if they don't use they have to pay, that's a subscription model problem. On the other hand, pay-per-use models exist but are fragmented across providers and often require credit cards.

The Solution

PAUG AI bridges 15+ frontier LLMs (CLaude Opus 4.7, GPT-5.5, Gemini 3.1 Prom, etc.) to Bangladeshi users, per-token billing through a Supabase + OpenRouter pipeline. Top-up with Bkash. A Flutter app targets Android, iOS, and Web from one codebase; SSE streams tokens straight from Edge Functions to the client; and the wallet updates in real time via Postgres Changes.

Key Features

  • Top-up with Bkash — the most popular local payment method
  • 15+ AI models from 7 providers (OpenAI, Anthropic, Google, xAI, Tencent, Nvidia, DeekSeek)
  • Single Flutter codebase shipping to Android, iOS, and Web
  • Real-time SSE streaming with cancellable mid-stream stop
  • Live wallet via Supabase Realtime
  • Edge-function proxy keeps OpenRouter API key off the client forever
  • RLS on every Postgres table — zero user-ID predicates needed client-side
  • Light/dark theming with brand blue→purple gradient

Technical Challenges

01 · Streaming SSE in Dart

Flutter has no production-grade SSE client; popular packages are stale. Solution: hand-rolled sse_parser.dart on top of http.Client.send(StreamedRequest) with line-by-line parsing — full control over cancellation, malformed-chunk recovery, and error handling.

02 · Temp-to-Real Conversation IDs

The first message in a conversation needs to render instantly — but the conversation row doesn't exist in Postgres yet. Solution: assign a temp_${timestamp} ID for UI state and atomically swap it for the real UUID via replaceId() once the insert returns.

03 · Auto-Scroll vs. User Scroll

Auto-scrolling to the bottom is great until the user scrolls up to re-read mid-stream — then it's hostile. Solution: a _userHasScrolledUp flag triggers off 100px of scroll-up movement and pauses auto-scroll until the user returns to the bottom.

04 · Cross-Platform Google OAuth

Google OAuth needs different redirect handlers per platform — deep links on mobile, URL redirects on web. Solution: paug-ai:// scheme registered via AndroidManifest intent-filter; Supabase Auth picks up the session automatically once the redirect lands.

Future Scope

  • bKash IPN integration for live wallet top-ups
  • Long-thread auto-summarization to save tokens
  • Transactions screen and profile/settings UI