DeftGPT
One platform, every LLM — chat, vision, documents, and image gen
Users were juggling separate accounts, API keys, and invoices across OpenAI, Anthropic, and open-source models. I built DeftGPT so anyone could buy a credit-based plan and access every major LLM from one place — including chat, image analysis, document Q&A, and AI image generation. Two-person team, twelve months.
Role
Lead Full-Stack Engineer
Timeline
12 Months (Bootstrapped)
Deliverables
SaaS, RAG, Multi-LLM API
Platform
Web App (Dashboard)

50+
Teams onboarded
Across organizations
6↑
LLM providers
OpenAI · Anthropic · more
12
Months to ship
Two-person team
100+
Concurrent sessions
Flat latency from 1 to 100
The Problem
Anyone who wanted to use GPT-4, Claude, and open-source models had to manage separate accounts, API keys, and billing dashboards. If you worked with a team, someone had to configure access across every provider individually. Want to show an image to GPT-4o, ask Claude about a PDF, or generate a picture with Stable Diffusion? That was three different tools. I wanted one place where you buy credits once and use any model, any feature, with your team.
How I Built It
Auth, Teams & Role Management
Months 1–4
Every feature depended on knowing who the user was and what they could access. I built auth with Laravel using Gates and Policies — skipped the Spatie permission package because it consumed too much memory handling orgs, teams, and members with different roles across multiple teams. Gates and Policies gave me the same capability with a fraction of the overhead.
Each team has two roles: admin and member. Admins buy credits, assign credits to specific members, and manage the team. Members use credits to chat, upload images, query documents, and generate content. Admins invite new members through secure links — no manual account creation.
AI Features — Chat, Vision, Documents & Image Gen
Months 4–8
The platform started with basic text chat but quickly grew to support image analysis (upload a photo and ask GPT-4o or Claude about it), document chat (upload PDFs and query them with RAG via Pinecone), and tool calls that generate images, documents, and reports. Users can also run multi-model comparisons — send the same prompt to several models side by side and pick the best response.
We started with sockets for streaming. They were slow and nginx’s open connection limit became a hard ceiling as the user base grew. I rewrote the streaming layer with Server-Sent Events — memory dropped about 40% per session, latency stayed flat from 1 user to 100, and the browser’s EventSource API handled reconnection for free. The migration took a week.
Credit System — Plans, Quotas & Top-ups
Months 8–12
I designed three credit-based plans: Starter, Premium, and Ultimate. Each comes with a pool of credits that users spend per request — different models cost different amounts of credits. GPT-4o might cost 5 credits per query while a faster model costs 1. Image generation and document processing cost more depending on the model and output size.
Users can also buy additional credits as top-ups without switching plans. The quota engine tracks every request at the middleware level and deducts credits before the LLM call goes out. I wired payments through Stripe via Laravel Cashier, which handled subscriptions, the customer portal, and invoicing out of the box. The hardest part was Stripe’s webhook race conditions — upgrade and cancellation webhooks can fire milliseconds apart. I wrote idempotent handlers with priority ordering so upgrades always win.
System Architecture
Tech Stack
Laravel
Gates · Policies · Cashier
Python
LangChain · AI Service
React
Admin Dashboard
Pinecone
Vector Search · RAG
Redis
Queues · Caching
SSE
Server-Sent Events
Docker
Deployment · VPS
Stripe
Payments · Plans
Nginx
Reverse Proxy
Results & Performance
Memory per 50 Concurrent Streaming Sessions
SSE vs sockets: the migration that doubled our ceiling
Streaming at scale
SSE handles 100 concurrent sessions with the same latency as 1. The nginx connection bottleneck is gone. Native EventSource API means zero reconnection code.
Credit-based billing
Users buy credits once and spend them across all models and features. Admins assign credits to team members. Stripe handles subscriptions, top-ups, and invoicing without manual intervention.
Multiple interaction modes
Text chat, image analysis, document Q&A, AI image generation, and multi-model comparison — all from one interface with a unified credit system.
Efficient RBAC without bloat
Laravel Gates and Policies handle org/team/member permissions with a fraction of the memory that Spatie’s package consumed in early prototypes. Admin and member roles are clear and enforced at the gate level.
See It Live
DeftGPT is live and handling real teams every day. You can try the platform, or if you’re building something similar and want to compare notes, I’d be happy to hear what you’re working on.