< all projects

Bay-Gen

Pooled AI compute: people put their own API keys into an encrypted vault and agents share it under usage limits and a voting system.

status
Experiment
role
Architect
when
2026
kind
AI orchestration

Private code. Happy to walk through it on a call.

the TSPL2 that prints this label
SIZE 101.6 mm, 50.8 mm
GAP 3 mm, 0 mm
DIRECTION 1
CLS
TEXT 32,28,"4",0,1,1,"Bay-Gen"
TEXT 32,92,"2",0,1,1,"AI orchestration"
TEXT 32,124,"2",0,1,1,"2026"
BARCODE 32,196,"128",120,0,0,1,2,"https://ansh.bhalala.org/projects/bay-gen"
PRINT 1,1

How it's put together

  • Keys are encrypted with AES-256-GCM, and allocation is throttled by contribution.
  • Each user gets an isolated agent with its own encrypted memory.
  • A provider layer covers OpenAI, Gemini, Claude, and GitHub Copilot.
  • Agents negotiate shared decisions in a daily "town hall" with multi-threshold voting. A watchdog escalates anything risky to a human for approval.
  • Next.js, Prisma, PostgreSQL, and Clerk, with Puppeteer end-to-end tests and setup scripts for Bash and PowerShell.

It was an experiment in treating bring-your-own-key as part of the architecture instead of a settings page.

Built with

  • Next.js
  • React
  • Prisma
  • PostgreSQL
  • Clerk
  • Puppeteer