AIPro • Web application
AI chat that streams fast and stays stable under load.
Overview
AIPro is a conversational AI assistant built with Next.js and the Vercel AI SDK. It pairs a polished chat UX with OpenAI model streaming, validated image attachments, and middleware-enforced rate limiting so responses stay fast and the public endpoint stays protected from abuse.
At a Glance
- Role
- Full-stack · Solo build
- Timeline
- Feb 2025 - May 2025
- Status
- Prototype
- Type
- Web application
Highlights
Dual-window rate limiting
Upstash sliding-window (per-minute) and fixed-window (per-day) checks run in middleware before any model call, capping abuse and cost before compute starts.
Real-time streaming responses
Output streams from OpenAI with word-level chunking via the Vercel AI SDK, cutting perceived latency on long answers.
Validated image attachments
Client filtering plus zod server validation gate file type and size before uploads land in Vercel Blob.
Technical content rendering
Markdown, syntax highlighting, and LaTeX rendering keep code and math readable in AI responses.
How It Works
The chat input sends prompts, optionally with image attachments, to the /api routes.
Middleware checks per-minute and per-day limits and returns 429 before any model call runs.
The chat route streams text from OpenAI via the Vercel AI SDK's streamText().
Attachments are validated and stored in Vercel Blob, with their URLs attached to the message.
The client renders streamed output with markdown, code highlighting, and LaTeX support.
Key Challenge
Keeping a public AI endpoint cheap and abuse-resistant. Enforcing rate limits in middleware—before the model is ever invoked—means burst spam and daily overuse are rejected without wasting OpenAI calls.
Tech Stack
Languages
Frameworks
Infrastructure
Tooling
Want to see it in action or read the code?
Back to all projects