dropthejase puts users on a token budget

Louis now meters legal-AI usage per person, per month - and cuts you off when you're out.

multi-tenantinfrastructure

The fork adds per-user monthly credits, tracked in a cloud database, with the API refusing further requests once a user hits their cap and the frontend surfacing an over-quota message. A user's subscription tier is now visible in account settings, setting up the obvious next step of tying allowances to what someone pays for.

Notably, the team switched from counting requests to counting tokens - the underlying units of text the AI actually processes. Requests are cheap; tokens are where the real cost sits, so metering on tokens is the honest way to do it. One earlier credits modal shipped without being wired up and had to be removed, a useful reminder that quota features need to be tested end-to-end before they count as done.

So what Anyone running a legal-AI tool at a firm or in-house team should watch this: it's a credible template for keeping AI spend predictable as usage scales.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

5 commits from dropthejase/louis, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
ce16fcd1 Add per-user monthly credits tracking (DynamoDB, 429 enforcement, frontend modal) Jason Lee 2026-05-08 ↗ GitHub
commit body
- CDK: add CreditsTable (DynamoDB PAY_PER_REQUEST) with lambdaRole + agentCoreRole grants, CREDITS_TABLE_NAME env var on Lambda, and CreditsTableName/Arn outputs
- Backend: new credits.ts lib with checkCredits/incrementCredits using @aws-sdk/client-dynamodb; wire 429 credits_exhausted guard at top of POST /chat and POST /projects/:id/chat handlers
- Frontend: detect 429 credits_exhausted in useAssistantChat streamChat error path; surface CreditsExhaustedModal (already existed) with resetDate in ChatView, assistant page, chat/[id] page, and project assistant chat page
5969976c chore: remove dead credits enforcement UI (never wired) Jason Lee 2026-05-09 ↗ GitHub
5af54ade fix(agents): track totalTokens in credits_used instead of call count Jason Lee 2026-05-11 ↗ GitHub
7265ee79 feat: expose and display tier from user_profiles Jason Lee 2026-05-12 ↗ GitHub
Add tier column to user_profiles schema (default 'Free').
GET /user/profile now returns tier; UserProfileContext maps it.
AppSidebar and AccountPage display as '${tier} Tier' instead of hardcoded 'Free'.
7ccf1157 fix: account settings dropdown nav, profile PUT content-type, tier display Jason Lee 2026-05-12 ↗ GitHub
commit body
- stopPropagation on sidebar dropdown toggle and Account Settings button
  so outside-click listener doesn't race and swallow the navigation
- Add Content-Type: application/json to all three profile PUT calls in
  UserProfileContext - body was arriving as Buffer, UPDATE never executed
- Rename 'Models & API Keys' tab to 'Models' (no API keys with Bedrock)
- Add request + error logging middleware to Express app for CloudWatch

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-339.md from inside the repo you want the changes in.

⬇ Download capture-thread-339.md