How I Spent Over $10,000 on AI Compute to Build 500 Websites at Scale

    This article shares lessons from an R&D effort that spent over $10,000 in compute costs to produce more than 500 working websites with AI. It explains why AI-generated sites often look generic, how a template-driven retrieval-augmented generation architecture solves the problem, and how to structure an asset library of 270+ templates, full prompts, and design style documents. You will also find practical prompt engineering rules, advanced examples such as web-based slide decks, interactive lessons, and browser 3D games, plus notes on cloud deployment and cost optimization. The core takeaway: the bottleneck is not model capability but the quality of the context you supply.

    Introduction: The “Gacha” Problem in AI Coding and How Engineering Fixes It

    Many developers using large language models for frontend development have hit the same wall: type a simple prompt like “build me an official website” and the output is generic, with no sense of identity. Worse, fine-tuning colors, typography, layout, and motion means rewriting the prompt over and over. That burns time and drives up token costs.

    This article is based on an R&D effort that spent over $10,000 in compute and ultimately shipped more than 500 working websites. It breaks down how to turn AI website generation from random “gacha” pulls into engineered production. The core idea is an asset library containing 270+ standardized templates and 500+ live examples, with complex visual design rules and interaction logic captured as reusable prompts and design style documents. The result is low-cost, high-quality website delivery at volume.

    Core Pain Points: Why AI-Generated Websites Look Fake at a Glance

    To get production-grade interfaces out of an AI, you have to solve three technical challenges:

    1. Severe visual sameness: Without concrete constraints, large models default to the “safe” designs most common in their training data (centered layouts, blue-and-white palettes), so the output carries no industry character.
    2. The tradeoff between context window and token cost: A complete website with a distinctive look requires very long descriptions (copy for every section, specific CSS variable definitions, animation curve parameters). Regenerating means paying for those tokens again.
    3. A ceiling on interaction complexity: Static pages are easy, but dynamic applications with 3D rendering, linked data charts, and page-turning logic demand highly rigorous prompt logic.

    Solution Architecture: Template-Driven Retrieval-Augmented Generation

    To address these issues, we built a “template library + retrieval + incremental editing” architecture. The logic is simple: before the AI writes any code, retrieve the best-matching template from the existing asset library, then modify it incrementally.

    1. Structuring the Asset Library

    The asset library is not just a pile of code. It has three parts:

    • Runnable instances: Official websites across industries (restaurants, fitness, hotels, retail), web-based presentations, interactive courseware, hand-drawn explainer animations, and browser-based 3D games.
    • Full prompts: The original instructions used to generate each page, including role definition, constraints, and output format.
    • Design style documents: Design Tokens defined in Markdown or JSON, covering primary colors, accent colors, font stacks, spacing systems, and shadow specifications.

    Example: a design style document snippet (JSON illustration)

    1. {
    2. "theme": "vintage_handdrawn",
    3. "colors": {
    4. "primary": "#5D4037",
    5. "background": "#FFF8E1",
    6. "accent": "#FF7043"
    7. },
    8. "typography": {
    9. "heading": "Comic Sans MS, cursive",
    10. "body": "Georgia, serif",
    11. "scale": 1.25
    12. },
    13. "animation": {
    14. "type": "stroke-dashoffset",
    15. "duration": "2s ease-in-out"
    16. }
    17. }

    2. Retrieval and Matching

    When a user submits a new request (for example, “build a website for a seaside boutique hotel”), the system first extracts semantic features and runs vector retrieval or keyword matching against the template library.

    • Match found: Load the matching template’s prompt and code directly. The AI only needs to change copy, image links, and specific sections.
    • No match: Load a general industry layout template, inject the retrieved relevant design style documents, and let the AI compose the result.

    This compresses tasks that once took 20 rounds of conversation into 2–3 rounds and cuts token consumption by roughly 80%.

    Deep Application Cases: Interaction Beyond Traditional Web Pages

    With this architecture, the output is no longer limited to conventional websites. It extends to high-interaction applications:

    1. Web-Based Presentations (PPT)

    Implementing slides as a web application offers far more interaction freedom. Keyboard events control slide transitions, a frontend charting library handles data visualization, and animations fire at specific points.

    1. // Example: keyboard navigation and chart update logic
    2. document.addEventListener('keydown', (e) => {
    3. if (e.key === 'ArrowRight') {
    4. slideIndex++;
    5. updateSlide(slideIndex);
    6. chartInstance.updateData(getDataForSlide(slideIndex));
    7. }
    8. });

    2. Interactive Courseware and Explainer Animations

    Take a hand-drawn explanation of photosynthesis: SVG stroke animation (stroke-dashoffset) progressively draws the sun and leaves as the user scrolls to specific positions, with explanatory text shown in sync. This “scroll-telling” pattern uses the Intersection Observer API to watch element visibility changes and trigger animation sequences, greatly improving immersion in knowledge transfer.

    3. Browser-Based 3D Games

    Using WebGL or a wrapper library built on Three.js, the AI can generate simple 3D scenes with physics collision detection and lighting. The prompt must explicitly define the camera perspective, light source positions, object material parameters, and game loop logic.

    Prompt Engineering Best Practices

    To get stable, high-quality code from the AI, prompts should follow these structural principles:

    1. Role and context: Define the AI’s role as a senior UI designer and frontend architect.
    2. Constraints first: Paste the design style document at the top to force adherence to color and typography rules.
    3. Component-based description: Break the page into modules such as Header, Hero, Features, and Footer, and describe content requirements one by one to avoid the logic breaking down in a single-shot generation.
    4. Lock the tech stack: Specify a particular frontend framework or plain HTML/CSS/JS to prevent stack drift.

    Open Source and Ecosystem: The Value of Accumulated Knowledge

    Publishing validated prompts and design documents to a code hosting platform is a key step in turning this into a lasting technical asset. Developers can take the source for secondary development, or feed the prompts directly into AI coding tools (such as cloud IDEs or AI coding assistants) to reproduce the same output. This “template reuse + AI re-creation” model is a core direction for improving frontend development efficiency.

    Cloud Deployment and Cost Optimization

    Once the sites are generated and need to serve traffic, use general cloud capabilities for hosting:

    • Storage and delivery: Store static assets in object storage, with a CDN to accelerate global access.
    • Compute: For applications that need SSR (server-side rendering), deploy on a container platform or Serverless function compute, scaling elastically with request volume to avoid waste.
    • Monitoring and alerting: Connect logging and monitoring/alerting services to track page load performance and error rates in real time.

    Conclusion

    Validated with over $10,000 in compute spend, this methodology shows that the quality ceiling of AI-generated websites is not model capability but whether high-quality context is supplied. With a template library of 500+ instances, structured design documents, and precise retrieval, developers can abandon “gacha” coding entirely and move from 0 to 1 in industrialized website production.