AI Tooling
Working appAI Project Workspace
A private workspace for coding and job hunting that shows what every AI request will cost before it is sent, and switches provider when a quota runs out.
Sole Developer at Personal project · October 2026
Runs locally on the owner's own API keys, so there is no public demo. Screens are from the running app, with the bundled example project; API keys are masked and company names hidden.
3
AI Providers With Automatic Fallback
284
Automated Tests Passing
4
Viewpoints Score Every Job Match
9
One-Click AI Helper Actions on Any File
At a Glance
- Problem
- AI spend and the data each request sends are hard to see, and free tiers fail without warning.
- What I built
- A Next.js workspace that estimates, budgets, routes and records every call across three AI providers.
- Result
- One tool for coding and job hunting, with 284 passing tests.
Screens
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)
(open full-size AI Project Workspace screenshot)The Problem
Using AI every day makes it hard to know what each request costs and what it sends. Free tiers run out mid-task, and job hunting means juggling boards, resumes and generic cover letters.
My Role
Sole developer: the model router and fallback, cost estimates and budgets, project context and memos, file uploads, the job-discovery pipeline and the tests.
Architecture
Route handlers validate every request and hand it to services, which use one AI orchestrator, a job-discovery pipeline and a file pipeline, all backed by PostgreSQL.
User
Route Handlers
Zod-validated API routes with a same-origin check on every state-changing call.
AI Orchestrator
Plan, estimate, check budget, call, retry or fall back, and record usage.
Model Router
One registry of models and prices, a tier heuristic with no model call, and a fixed order of preference.
Job Discovery
Source adapters, filters, de-duplication and eligibility checks before any AI scoring.
PostgreSQL (Prisma)
Projects, files, memos, usage records, resumes, jobs and cached source responses.
AI Providers (OpenAI, Anthropic, Gemini)
Engineering Decisions
Estimate first, then send
Every request shows tokens, model and cost before it runs, and a request over budget is blocked until confirmed.
Trade-off An estimate step on every call, and prices have to be kept current in one registry.
Route without asking a model
The tier is chosen from the task, the text and the context size, and cheap and normal work goes to Gemini's free tier first, so everyday use is not billed.
Trade-off The free tier has small daily limits (a Flash key was measured at 20 requests a day), so heavier work falls back to a paid provider, and a heuristic can pick a tier that is too small.
Never switch a chosen model silently
A model picked for one request that is unusable fails with a clear message instead of being replaced.
Trade-off More errors shown to the user, in exchange for no surprise bills or answers from a different model.
What I Built
- Built the orchestrator: every request is estimated, checked against daily, monthly and per-request budgets, sent to the cheapest capable model (Gemini free tier first), and recorded on a Usage page.
- Added retry with backoff and same-tier fallback to another provider, only when the error is a quota or outage and the fallback fits the cost cap.
- Built the project workspace: streaming chat, file tree and editor, one-click AI Helper actions, and a context panel that shows exactly what will be sent.
- Made projects easy to start: create one from scratch (name, stack, rules), or import a ZIP as a new project or merge or replace it into an existing one, with an 8-section memo built for free from the files.
- Made AI file changes safe: Generate, Fix and Refactor return validated operations with a preview, confirmation for deletes and renames, and transactional apply.
- Added three memo levels (global, project, task), rolling conversation summaries and validated uploads (PDF, DOCX, images) with secret redaction.
- Built the career side: a resume library and a job-fit analysis that scores from four viewpoints and drafts a cover letter, ATS keywords and interview prep without inventing experience.
- Built Find Jobs: many sources merged and de-duplicated, requirements quoted from each listing, only the best candidates AI-scored, and every response cached against monthly quotas.
- Added per-operation model selection, availability checks and budgets in Settings, with API keys kept server-side and masked.
Constraints
- Free tiers have hard daily or monthly limits, so spending had to be predictable.
- Code, resumes and keys are sensitive: keys stay server-side and secret files never reach a model.
- Job APIs have small monthly quotas, so repeated actions must not repeat requests.
Outcome
One workspace where each AI request is estimated, budgeted, routed and recorded, with a working job-discovery pipeline and 284 passing tests.
For Engineers
9
Models in One Registry
5
Levels of Model Preference
6
Safe AI Error Codes
3
Memo Levels Keep Context Short
Fallback only when it can help
lib/ai/fallback.ts
export function classifyError(err: AppError, attempt: number, maxRetries = RETRY_DELAYS_MS.length): ErrorAction {
if (err.retryable && attempt < maxRetries) return "retry";
if (err.fallbackEligible) return "fallback";
return "fail";
}Quality & Security
- Every feature shows what it did and what it cost: the context panel, the pre-send estimate, the usage table and the per-source report on job runs.
- 284 Vitest unit tests pass (12 skipped): orchestrator and fallback, model selection, provider adapters, cost, job scoring, dedupe and caching.
- API keys stay server-side and are shown masked; saved keys are encrypted when a secret is set.
- Provider errors are mapped to six safe codes, so raw provider messages never reach the browser.
- Uploads are checked by content (type whitelist and magic bytes), and executables are rejected even if renamed.
- Secret files are never imported, uploaded or sent, and secrets in text are redacted before a model sees it.
What I'd Do Next
- Add end-to-end browser tests; there are none yet.
- Add accounts and roles; the data is already scoped per user.
Technology
For Clients
Want AI in your team's tools without losing track of the bill?
What I can build for you, based on this project:
- Multi-provider AI with cost estimates, budgets and fallback
- AI assistants that only send the context a request needs
- Safe AI-driven file and data changes with preview and approval
- Document and resume analysis that quotes evidence instead of inventing it
- Search that merges many sources, de-duplicates and AI-scores matches
Downloads