Home / Case Studies

Technical Architectures & Case Studies

Production-grade system breakdowns showing how I solve data scrapings, integrate local CPU voice-inference runtimes, and enforce strict module security.

Case Study 01

AgentStack Calc (agentstackcalc.com)

Role: Principal Architect & Creator
Next.js App Router Markdown Compiler Dynamic GSC Indexing

The Challenge

Predicting SaaS operating expenses for AI infrastructure (speech, language models, call routing) is a massive headache for developers. Costs are spread across multiple vendors (Vapi vs Retell AI vs Bland AI).

To capture high-intent developer search traffic, I needed to build a sub-second live cost simulator integrated with a dynamic tech blog engine, optimized so Google Search Console indexers discover new markdown articles instantly without server delay.

Engineering Solution

  • Static Generation (SSG) & Local Execution: Programmed simulator states to calculate client-side in pure memory. Latency is under 15ms with zero backend database queries needed.
  • Decoupled Markdown Parser: Configured a dynamic filesystem reader inside Next.js using gray-matter and marked, rendering high-fidelity reports from static markdown content files.
  • Dynamic Sitemap Automation: Wrote an automated build-time sitemap compiler that recursively maps blog assets, ensuring Google immediately indexes new target keywords.
// sitemap.ts maps all markdown blog posts dynamically const blogRoutes = posts.map((post) => ({
  url: `https://www.agentstackcalc.com/blog/${post.slug}`,
  lastModified: new Date(post.date),
  changeFrequency: "monthly",
  priority: 0.7
}));
Key Performance
<15ms Simulator Latency

100% Static Pre-rendered SEO Pages

Dynamic XML Sitemap Auto-Crawl
Visit Live Platform
Case Study 02

StackVoice TTS Engine (Hetzner VPS Service)

Role: Lead AI Backend Engineer
Kokoro-82M ONNX FastAPI & Uvicorn Dockerized Container

The Challenge

Commercial Text-to-Speech APIs like ElevenLabs are prohibitively expensive ($150-$200 per million characters) for long-form creators. Open-source models exist, but running Python speech pipelines in cloud servers usually demands high-cost GPU nodes.

The target was to deploy a hyper-realistic, multilingual speech API on a $4/month CPU-only VPS, keeping memory usage low while generating high-fidelity audio streams in under 300ms.

Engineering Solution

  • ONNX Runtime Optimization: Compiled the Kokoro-82M neural model into an ONNX representation, loading the model into CPU RAM in under 0.5s for instant vector processing.
  • Memory-Cached Stream: Replaced standard file-writing with a non-blocking io.BytesIO structure using Python's soundfile library, sending raw audio bytes directly to the response stream with finalized WAV headers.
  • Docker & Nginx Reverse Proxy: Configured lightweight Debian containers and Nginx reverse proxies with Certbot SSL and custom CORS rules, enabling cross-origin stream queries.
// Non-blocking WAV stream writing using SoundFile context with sf.SoundFile(buffer, mode='w', format='WAV', samplerate=sample_rate, channels=1, subtype='PCM_16') as f:
  f.write(samples)
audio_data = buffer.getvalue()
Key Highlights
~98% Savings vs ElevenLabs API pricing

~220ms Average Generation Latency

54 Voices Multilingual character models
Try Audio Playground
Case Study 03

BidIQ Chrome Extension (AI Assistant)

Role: Extension Lead Architect
Manifest V3 Shadow DOM CSS Secure API Proxy

The Challenge

Freelancers waste hundreds of dollars buying Upwork bidding Connects due to poor vetting. Existing assistant extensions expose private API keys by storing them in local browser storage, making them vulnerable to cross-site scripting (XSS) theft.

I needed to build an isolated browser companion that scrapes complex client data (hire rate, average budget, country timezone) in real-time and drafts custom proposal copy while keeping API keys completely secure.

Engineering Solution

  • Shadow DOM Encapsulation: Isolated all injected HTML overlays inside a Shadow Root container. This guarantees host CSS stylesheets never leak into our companion UI.
  • Manifest V3 background worker: Leveraged asynchronous MV3 service workers to scan page DOM nodes dynamically without slowing down page load performance.
  • Secure Proxy Architecture: Decoupled LLM generation from client-side execution. The extension sends parsed DOM meta to an Express.js backend on Port 3001, which proxies requests to Gemini 1.5, shielding API keys from client-side exposure.
// Injected script creating an isolated Shadow Root container const host = document.createElement('div');
host.id = 'bidiq-root';
document.body.appendChild(host);
const shadowRoot = host.attachShadow({ mode: 'open' });
Key Metrics
0% Style Leak Shadow DOM encapsulation

100% Safe Server-Shielded Keys

MV3 Ready Manifest compliant