All Projects

AI Tooling

Working app

AI 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

Find Jobs, start to finish. Load a saved search, review the settings, run it (each source reports live), see the AI cost before any scoring, score the best candidates, then read the matches and what each job requires. Recorded in real time, without sound.
Quick tour. Ask a question, see the cost and the files sent, read the answer, then Usage and Find Jobs. Recorded from the dev build without sound, so the first estimate is slow.
Preview changes dialog showing a red removed line and two green added lines in lib/invoice.ts, with Close and Apply buttons (open full-size AI Project Workspace screenshot)
Safe file changes: the AI proposes an edit, and you review the diff before anything is applied.
Project chat with a typed question; the composer shows input and output tokens, the model and the estimated cost, and the side panel lists the four files that will be sent and why (open full-size AI Project Workspace screenshot)
Before sending: the estimated tokens, model and cost, plus exactly which files go out and why.
Find Jobs result cards with an AI match percentage, four viewpoint scores, top matches and potential gaps (open full-size AI Project Workspace screenshot)
Job matching: a score from four viewpoints, with what fits and what is missing.
Chat answer explaining why an invoice total is wrong, with a code block, and a footer showing the model, tokens in and out, and the cost of the reply (open full-size AI Project Workspace screenshot)
Every answer shows the model that wrote it and what it cost, here $0.0011.
Project memo panel with description, architecture and stack notes that are sent with AI requests (open full-size AI Project Workspace screenshot)
Memos: project knowledge the AI always sees, so you do not re-explain it.
Projects page with a new-project form, an import button and a list of active projects (open full-size AI Project Workspace screenshot)
Projects: start from scratch, import a ZIP, or merge into an existing project.
Job analysis history showing a fit score, a generated cover letter and CV recommendations, with company names hidden (open full-size AI Project Workspace screenshot)
Job analysis: a fit score, cover letter, CV advice and interview drafts for one saved job. Company names are hidden.
Find Jobs run showing each source, whether it came from cache, and a funnel from 659 listings to 93 candidates (open full-size AI Project Workspace screenshot)
Find Jobs: dates, locations and duplicates are filtered before any AI is paid for.
Usage and cost page with daily and monthly budget bars, totals per provider and a table of recent requests (open full-size AI Project Workspace screenshot)
Usage: tokens and cost per provider against daily and monthly budgets.
Settings section for choosing a global default model and a model for each operation (open full-size AI Project Workspace screenshot)
Settings: one default model, or a different model for each operation.
Diagram: route handlers, AI orchestrator, model router and three providers, with context builder, job discovery, file pipeline and PostgreSQL (open full-size AI Project Workspace screenshot)
Structure: one orchestrator estimates, routes and records every call; discovery and files run beside it.

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.

  1. User

  2. Route Handlers

    Zod-validated API routes with a same-origin check on every state-changing call.

  3. AI Orchestrator

    Plan, estimate, check budget, call, retry or fall back, and record usage.

  4. Model Router

    One registry of models and prices, a tier heuristic with no model call, and a fixed order of preference.

  5. Job Discovery

    Source adapters, filters, de-duplication and eligibility checks before any AI scoring.

  6. PostgreSQL (Prisma)

    Projects, files, memos, usage records, resumes, jobs and cached source responses.

  7. AI Providers (OpenAI, Anthropic, Gemini)

Request
Validated input
Pick tier and provider
Call, retry, fall back
Search
Usage records

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";
}
Rate limits and outages retry with backoff; a spent quota falls back to another provider; a bad key or request fails straight away, so errors are never hidden.

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

Next.jsReact 19TypeScriptPrismaPostgreSQLOpenAI APIAnthropic APIGemini APIZodVitest

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