G.L.A.S.S. — Guided Language Agent for Software Synthesis


Inspiration

Modern AI code generation tools are often cluttered with redundant UI elements, intrusive chats, and opaque feedback loops that disconnect developers from the underlying software creation process. We wanted to build an industrial-grade engine where software synthesis feels immediate, weightless, and transparent—like looking through a sheet of pristine glass.

G.L.A.S.S. (Guided Language Agent for Software Synthesis) was conceived to combine high-performance LLM orchestration with an uncompromising, minimalist aesthetic. Inspired by glassmorphic dark UIs, ambient radial glows, and dynamic state-driven layouts, G.L.A.S.S. turns high-level prompt directives into production-ready, multi-file codebases inside isolated workspace environments.


How We Built It

G.L.A.S.S. is architected across a decoupled high-performance stack designed for zero-latency feedback and multi-provider AI routing:

1. Frontend & 3D Morphing Hero Engine

Built with React, Vite, TypeScript, Tailwind CSS, and Lucide Icons. The centerpiece of the interface is a custom 60 FPS HTML5 Canvas engine (MorphOrb) that renders a dynamic 3D Fibonacci point-cloud sphere.

To evenly distribute $N = 750$ particles on a 3D sphere surface, we implemented the golden ratio Fibonacci lattice algorithm. The spherical coordinates $(\theta_i, \phi_i)$ for particle $i$ are calculated as:

$$\Phi = \frac{1 + \sqrt{5}}{2}$$

$$\theta_i = \frac{2\pi \cdot i}{\Phi}$$

$$\phi_i = \arccos\left(1 - \frac{2(i + 0.5)}{N}\right)$$

To map 3D spherical positions $(x, y, z)$ onto the 2D canvas with depth sorting and continuous wave pulsation, we apply 3D Euler rotations followed by perspective projection:

$$x_{\text{proj}} = cx + x_{\text{rot}} \cdot \left( \frac{f}{f + z_{\text{rot}} + d} \right)$$

$$y_{\text{proj}} = cy + y_{\text{rot}} \cdot \left( \frac{f}{f + z_{\text{rot}} + d} \right)$$

where $f$ represents the camera field of view distance ($f = 300$), $d$ is the depth displacement, and $(cx, cy)$ marks the canvas center point.

2. Backend Gateway & Session Workspace Manager

The backend is powered by FastAPI (server.py) and an isolated execution workspace manager (agent.py).

  • Dynamic Workspace Isolation: Every user directive operates within an isolated session path (./workspaces/<session_id>/), preventing codebase collisions and maintaining clean environment boundaries.
  • Universal Code Extractor: A custom regex and comment-based parser (CodeExtractor) that dynamically parses markdown fence tags (e.g., ```java:TicTacToe.java) to extract filenames, language types, and executable contents across Python, Java, C++, Rust, TypeScript, and HTML.

3. Dual-Tier AI Execution Stack

  • Primary Engine: Integrated with Nebius AI Cloud utilizing high-capacity open-source models (such as meta-llama/Meta-Llama-3.1-70B-Instruct).
  • Local Fallback Engine: Native integration with local Ollama instances (qwen2.5-coder:7b) accelerated directly on Apple Silicon Metal GPUs (http://localhost:11434/v1), ensuring offline operational resiliency.

Challenges We Faced

  1. DOM & Canvas State Synchronization: Early iterations suffered from overlapping DOM elements where the prompt pill input bar and the 3D point-cloud canvas fought for render priority. We resolved this by implementing explicit state guards and Framer Motion transitions, ensuring the input unmounts cleanly as the 3D morphing sphere spins up.
  2. Robust Multi-Language Code Block Parsing: LLM outputs frequently vary in how code blocks are formatted. Building a regex parser capable of detecting embedded file paths in block headers, first-line comments (// file: Main.java or # file: script.py), or inferring appropriate defaults based on semantic context required careful edge-case handling.
  3. Graceful Operator & Environment Failover: Handling boolean evaluation order and missing environment variables (NEBIUS_API_KEY) without crashing the ASGI Uvicorn pipeline required strict type guards and fallback routing to local hardware acceleration.

What We Learned

  • Mathematical Canvas Animation: Writing raw 3D perspective projection loops with custom depth sorting ($z$-indexing) in pure Canvas 2D delivers significantly higher performance and lower bundle overhead than heavy 3D engine wrappers.
  • Resilient LLM Provider Architecture: Designing software around provider fallback chains—from cloud endpoints to local Metal GPU models—creates bulletproof developer tools that function regardless of network connectivity or API key status.
  • Focus-Driven UX: Hiding the file inspector panel until files are actively generated keeps developer cognitive load at zero during the initial ideation phase, opening into a full split-pane view only when code synthesis completes.

Built With

  • ai-agents
  • apple-silicon
  • canvas-2d
  • code-synthesis
  • fastapi
  • framer-motion
  • html5
  • llama-3.1
  • lucide-icons
  • metal
  • nebius-ai-cloud
  • nvidia
  • ollama
  • pydantic
  • python
  • qwen2.5-coder
  • react
  • rest-api
  • tailwind-css
  • typescript
  • uvicorn
  • vite
Share this project:

Updates

Submission history