Demo: one product, three repositories
Three public repositories treated as the services of one product: an AI assistant, a document-sharing app and a link platform. This is what a multi-repository project looks like in Skeram. Each tab in a real project opens that source’s full interactive report.
By source
| Source | Stack | AI usage | Infrastructure | Findings |
|---|---|---|---|---|
| vercel/ai-chatbot | next | $211–$3,534 | $112 | 1 |
| mfts/papermark | next | $6.67 | $131 | 1 |
| dubinc/dub | next | $3.65–$73.00 | $132 | 1 |
What to look at first
- CriticalOpen source report
vercel/ai-chatbot: 1 route calls an LLM on your key with no output cap
No max_tokens is passed, so each response is as long as the model decides. These calls are $211–$3,534/mo at 1,000 monthly users assuming 600 output tokens — a verbose model or a prompt that invites long answers moves that figure with no ceiling.
Suggested fix: Pass an explicit max_tokens on every call sized to the UI (chat ~1K, titles ~50); alert on per-user daily token spend.
assistant/app/(chat)/api/chat/route.ts:269-330assistant/app/(chat)/actions.ts:28-34assistant/app/(chat)/api/chat/route.ts:125-133
- WarningOpen source report
mfts/papermark: 3 background jobs run inline in request handlers
Email-change verification email sent via waitUntil after the response.; Mirrors signed agreement PDF to storage via waitUntil after the signing webhook.; Blocked-keyword alert logged via waitUntil in PDF page conversion.. Work fired from a handler without a queue dies with the process on deploys and crashes, fails silently with no retry, and competes with requests for the same instance.
Suggested fix: Move to a queue (SQS + a worker service, as in the architecture shown, sized for this load). The handler has to be rewritten to publish to it instead of firing inline.
documents/pages/api/account/index.ts:81-87documents/app/api/webhooks/signing/route.ts:92-101documents/pages/api/mupdf/convert-page.ts:186-193
- WarningOpen source report
dubinc/dub: 8 background jobs run inline in request handlers
Cache warm + partner enrollment lookup via waitUntil in link redirect handler; Send password-reset confirmation email post-response; Increment workspace aiUsage counter post-response (+5 more). Work fired from a handler without a queue dies with the process on deploys and crashes, fails silently with no retry, and competes with requests for the same instance.
Suggested fix: Move to a queue (SQS + a worker service, as in the architecture shown, sized for this load). The handler has to be rewritten to publish to it instead of firing inline.
links/lib/middleware/link.ts:95-120links/app/api/auth/reset-password/route.tslinks/app/api/ai/completion/route.ts
vercel/ai-chatbot: 1 route holds connections open on LLM calls
At 1,000 monthly users this route sees ~0.07 req/s at peak, each pinned ~3s on the LLM — on the container service shown, ~0.2 connections held open, on a $211–$3,534/mo token bill. If the provider slows to 30s, that becomes ~2, and without a concurrency cap the service runs out of room for every other request.
Suggested fix: Cap concurrency + set timeouts on every LLM call; queue non-interactive generations; keep streaming for chat UX.
assistant/app/(chat)/api/chat/route.ts:70-445assistant/lib/ratelimit.ts:22-47
mfts/papermark: 2 routes hold connections open on LLM calls
At 1,000 monthly users these routes see ~0.01 req/s at peak, each pinned ~3s on the LLM — on the container service shown, ~0 connections held open, on a $6.67/mo token bill. If the provider slows to 30s, that becomes ~0, and without a concurrency cap the service runs out of room for every other request.
Suggested fix: Cap concurrency + set timeouts on every LLM call; queue non-interactive generations; keep streaming for chat UX.
documents/app/(ee)/api/ai/chat/[chatId]/messages/route.ts:16-120documents/ee/features/ai/lib/chat/send-message.ts:437-575documents/pages/api/teams/[teamId]/datarooms/generate-ai-structure.ts:42-190
dubinc/dub: 1 route holds connections open on LLM calls
At 1,000 monthly users this route sees ~0.01 req/s at peak, each pinned ~3s on the LLM — on the container service shown, ~0 connections held open, on a $3.65–$73.00/mo token bill. If the provider slows to 30s, that becomes ~0, and without a concurrency cap the service runs out of room for every other request.
Suggested fix: Cap concurrency + set timeouts on every LLM call; queue non-interactive generations; keep streaming for chat UX.
links/app/api/ai/completion/route.ts
dubinc/dub: No error tracking or metrics detected
No error-tracking, tracing or analytics SDK was found being called in the code that was analyzed. At scale, the first sign of every failure below will be users tweeting about it.
Suggested fix: Minimum bar: CloudWatch alarms on ALB 5xx + latency, and an error tracker (Sentry) in the app.
What this combined view does not know
- Each component is sized as a separate deployment. Shared infrastructure is not deduplicated, so this sum can overstate a shared deployment's cost.
- The monthly-user scenario applies to every component unless a component audience is supplied. Internal service-to-service traffic and shared user journeys are not inferred.
- Cross-repository dependencies and duplicate LLM calls require explicit topology and workload mappings before this becomes a whole-system forecast.
- vercel/ai-chatbot: No maxOutputTokens set on any LLM call; chat allows up to 5 steps, and tools make nested streamText calls with no cap.
- vercel/ai-chatbot: app/(auth)/auth.ts and the rest of lib/db/queries.ts were not shown; auth routes and DB patterns inferred.
- vercel/ai-chatbot: app/(chat)/api/document DELETE handler was truncated; details inferred from imports.
- vercel/ai-chatbot: Redis rate limit is production-only and silently skipped if Redis is unavailable.
- vercel/ai-chatbot: Uploaded blobs are stored with public access.
- vercel/ai-chatbot: Other server actions (app/(chat)/actions.ts, artifacts/actions.ts) not emitted as routes; client imports not shown.
- mfts/papermark: Truncated sources: views-dataroom (120 of 1545 lines), chat messages route (120 of 190), convert-page (200 of 369). Reads, writes, waitUntil jobs and title generation beyond those lines are unverified.
- mfts/papermark: maxOutputTokens for gpt-4o-mini sits in providerOptions.openai in generate-ai-structure and generate-chat-title. These caps may not be applied, so output could effectively be uncapped.
- mfts/papermark: The chat stream's onFinish makes an extra gpt-4o-mini call for suggested questions on every message. It sits on top of the file_search call, which has its own OpenAI cost.
- mfts/papermark: Many handlers were not shown, including the weekly digest, domains, welcome-user and year-in-review crons, /api/views, links, and most team routes. They are not emitted as routes.
- mfts/papermark: The daily digest cron verifies the QStash signature only when VERCEL=1.
- mfts/papermark: convert-page fetches the entire PDF on every page call, so conversion cost scales with pages times file size.
- mfts/papermark: The ee conversations and automatic-unpause handlers are delegated and were not shown, so their auth and work are unknown.
- dubinc/dub: Deterministic inventory lists ~600+ routes; only routes with directly shown source were modeled in detail (~48 of them).
- dubinc/dub: Cron job internals (app/(ee)/api/cron/**) not shown as source; job entries derived from vercel.json schedule facts plus inventory path existence (medium confidence).
- dubinc/dub: HubSpot/Intercom/AppsFlyer/Shopify/Veriff webhook and OAuth routes exist per inventory but source wasn't shown, so most were excluded from routes[] except veriff/resend/dub/postbacks which had source.
- dubinc/dub: No websocket/SSE/polling implementation observed in shown files; realtime left empty though large surface area wasn't fully inspected.
- dubinc/dub: @upstash/qstash and 'ai' SDK usage confirmed via source; other installed SDKs (stripe, next-auth) confirmed used; not all installed SDKs were verified as called.