This is a submission for the Gemma 4 Challenge: Build with Gemma 4
What I Built
Gemma 4 CAD Orchestrator is a cloud-native, AI-powered parametric CAD application that lets engineers describe mechanical parts in plain English and instantly see them rendered in 2D blueprint view and 3D interactive viewport β powered by Google DeepMind's Gemma 4 26B A4B IT via Vertex AI Model Garden.
π₯ Live Demo
π Try the Application:
Gemma 4 CAD Orchestrator Live Demo
π₯ How I Used Gemma 4
ποΈ Engineering the Future of CAD with AI
- The Vision
Traditional CAD workflows are powerful β but painfully slow.
Mechanical engineers already visualize components mentally long before they open design software. Yet translating those ideas into production-ready geometry still requires repetitive manual operations.
I wanted to eliminate that friction completely.
The goal was ambitious:
βWhat if engineers could design mechanical parts exactly the way they think?β
So I built a deterministic text-to-geometry orchestration engine powered by Gemma 4.
A user can type:
Create a mounting plate 100mm long, 60mm wide, 8mm thick with four 10mm bolt holes.
β¦and within seconds the system generates:
A structured parametric model
A live 3D interactive viewport
A synchronized 2D engineering blueprint
An editable feature tree
Accurate dimensional calculations
No installation.
No workstation-heavy CAD software.
Just AI-native engineering.
π€ Why Gemma 4?
The hardest challenge wasn't rendering geometry.
It was teaching an LLM to reliably understand engineering intent while producing deterministic JSON structures without hallucinating invalid dimensions or impossible geometry.
Gemma 4 handled this exceptionally well.
Its MoE architecture enabled:
Faster structured generation
Lower inference overhead
Stable schema adherence
High-context engineering interpretation
Strong reasoning across dimensional constraints
To maximize reliability, I built the orchestration layer with a multi-provider cascading architecture.
AI Backend Cascade
Ollama β Local workstation inference fallback (gemma4:31b, gemma4:26b)
Vertex AI Gemma 4 MaaS β Primary production inference engine
Hugging Face Inference API β Serverless resilience layer
Google Gemini API β Operational failover endpoint
The backend automatically detects available providers and gracefully reroutes requests during failures.
3. System Architecture
User Browser Cloud Run Vertex AI
ββββββββββββββββ HTTP ββββββββββββββββββββ gRPC ββββββββββββββββββββ
β Three.js 3D βββββββββββββββΊβ Express Backend βββββββββββΊβ Gemma 4 26B A4B β
β Canvas 2D β /api/* β @google/genai β β MaaS (Global) β
β Copilot UI β β JSON Parser β β β
ββββββββββββββββ β System Prompt β ββββββββββββββββββββ
ββββββββββββββββββββ
β
βββββββββΌβββββββββ
β google.json β
ββββββββββββββββββ
β‘ Operational Pipeline
- Intent Capture Users define mechanical concepts directly inside a terminal-style AI Copilot interface.
Contextualization
Middleware injects highly constrained system prompts defining:
Valid geometric primitives
Parametric boundaries
Execution examples
Dimensional validation rules
Typed schema contractsInference Execution
Gemma 4 generates deterministic structured payloads containing:
shapeType
params
featureTree
coordinates
engineering explanationGeometry Translation
The frontend converts the generated schema into live geometry.
Three.js renders the interactive WebGL viewport
HTML5 Canvas produces synchronized orthographic engineering blueprints
Responsive orbit controls enable real-time interaction
5. Key Technical Decisions
| Decision | Tactical Benefit |
|---|---|
| Serverless Cloud Run | Zero cluster overhead, auto-scaling execution to 0, isolated 512MB RAM footprintsβideal for hyper-efficient, cost-conscious microservice hosting. |
| Pure Client-Side Renders | Leveraged vanilla HTML5 Canvas and native Three.js via CDN. Zero heavy server-side image processing, reducing latency to near real-time. |
| MoE Routing Constraints | Utilizing the 26B A4B variant routes work to 3.8B active parameters per token, slashing generation times while holding high-level structural intelligence. |
Unified @google/genai Integration |
Erased SDK technical debt by utilizing the new standardized Google SDK, establishing clean async patterns via ai.models.generateContent(). |
Structured JSON Contracts Guaranteed geometry-safe deterministic outputs
π οΈ Engineering Challenges Solved
π SDK Migration During Development
Mid-development API changes required rebuilding inference routing from legacy model instantiation methods into unified client pipelines.
π Vertex AI MaaS Routing
Debugging global endpoint routing behavior for Model Garden MaaS instances required runtime-level validation and failover engineering.
π¦ JSON Conformance Stability
LLMs often break structured output when prompts become highly technical.
I solved this by:
Separating reasoning blocks from payload blocks
Enforcing strict tagged response zones
Designing schema-first prompts
Using deterministic parsing validation
π Core Parametric Geometry Library
| Primitive | Param 1 | Param 2 | Param 3 | Param 4 |
|---|---|---|---|---|
| plate | length | width | thickness | holeDia |
| bracket | leg1 | leg2 | width | thickness |
| spacer | length | outer | bore | β |
| block | length | width | height | bore |
| cube | length | width | height | β |
| cylinder | radius | height | β | β |
| sphere | radius | β | β | β |
| cone | radius1 | radius2 | height | β |
| torus | ringRadius | tubeRadius | β | β |
π Whatβs Next
πΌοΈ Multimodal Blueprint Reconstruction
Gemma 4 already supports multimodal inputs.
The next phase is enabling users to upload:
Whiteboard sketches
Hand-drawn blueprints
Engineering photos
β¦and automatically reconstruct them into editable CAD geometry.
π Industrial Export Pipelines
Planned support includes:
STEP
STL
DXF
Manufacturing-ready CAD exports
β¨ Advanced Geometry Modifiers
Upcoming AI-assisted geometric operations:
Chamfer generation
Fillet computation
Shell modifiers
Parametric edge reconstruction
Snip about my ideas:
π Final Thoughts
Gemma 4 CAD Orchestrator represents more than a hackathon project.
It explores a future where:
Engineers communicate with software naturally
AI understands manufacturable intent
CAD becomes conversational
Design iteration happens instantly
This project combines:
AI reasoning
Cloud-native infrastructure
Real-time rendering
Parametric engineering
Deterministic geometry systems
β¦into a single AI-native mechanical design workflow.
The future of engineering software won't start with menus.
It will start with language.

Top comments (0)