← back to optimizer
$2,685
Original Budget
$240
Actual Spend
91%
Cost Reduction
~$0.01
Per Query

The Project

EDA Copilot is a domain-specific technical assistant for chip design engineers. It ingests PDK documentation, timing reports, tool manuals, and community Q&A into a hybrid retrieval system — a Neo4j knowledge graph for structural relationships (tool → version → known bug) combined with a ChromaDB vector store for semantic search across 847 curated corpus chunks. When an engineer asks a question like "Why does my timing fail after upgrading OpenROAD?" or "What is the metal2 spacing rule in SKY130?", the system retrieves graph facts and text chunks, reranks them with a cross-encoder, and streams a grounded answer via Claude Sonnet with inline citations. The full stack — FastAPI backend, SSE streaming, rate limiting, query logging — runs on a single $12/month VPS.

Optimization Techniques Applied

Nine cost levers were stacked to collapse the budget from $2,685 to $240 — each one independently justified and empirically validated:

Model right-sizing
Switched from GPT-4 Turbo to Claude 3.5 Sonnet — 60% cheaper per token with equivalent domain accuracy.
−60%
Context window pruning
Reduced top_k from 10 to 3–5 chunks via reranker, cutting input tokens by 40–60% without quality loss.
−50% tokens
Graph-first retrieval
Structured graph queries resolve factual lookups (version, rule, parameter) without hitting the LLM at all.
0 tokens
QLoRA fine-tuning (4-bit)
Fine-tuned Mistral-7B on synthetic EDA Q&A. 4-bit quantization cut GPU memory from 28 GB to 6 GB, enabling single-GPU training.
−78% VRAM
Free-tier infrastructure
Neo4j Aura Free, ChromaDB on-disk, GitHub Pages hosting — eliminated $85/month in managed service fees.
−$85/mo
Local embeddings
all-MiniLM-L6-v2 runs on-device — zero API calls for embedding 847 chunks during indexing and retrieval.
$0 embed
Streaming responses (SSE)
Server-Sent Events deliver tokens as they arrive. No retry loops, no wasted compute on timeouts.
−latency
Rate limiting & query caps
10 requests/min per IP, 500-char query limit. Prevents abuse from inflating API costs.
abuse guard
Single-VPS deployment
API, reranker, and vector store co-located on one $12/month VPS — no load balancer, no container orchestration.
$12/mo

Read the full analysis

The complete cost optimization paper covers methodology, per-technique breakdowns, quality benchmarks (EDABench: 72.2% accuracy), and scaling projections.