Skip to main content

SuperModel Architecture

SuperModel achieves zero server inference through a carefully designed layered architecture where every decision point uses MCP sampling to delegate reasoning to the client’s LLM.

Core Architecture Diagram

Three-Layer Architecture

SuperModel operates through three distinct layers, each using MCP sampling to maintain zero server inference:

Layer 1: Request Processing & Routing

Purpose: Analyze incoming requests and determine which UI tool should handle them.
1

Request Reception

Gateway receives user request through standard MCP tool call
2

Routing via Sampling

Gateway uses MCP sampling to ask client’s LLM: “Which tool should handle this request?”
3

Route Decision

Client’s LLM analyzes available tools and returns routing decision
Example Routing Sampling Request:

Layer 2: Gateway Pattern & Tool Orchestration

Purpose: Route requests to the appropriate specialized UI generation tool based on sampling decisions. The gateway implements a pattern inspired by mcp-agent and mcp-use, but with critical differences:
Cost: $$$ (Server pays for LLM inference)
Tool Registry Configuration:

Layer 3: UI Generation & Packaging

Purpose: Generate AG-UI compatible components and package them as MCP-UI resources.
1

Tool Execution

Selected tool processes the request and determines specific UI requirements
2

UI Generation via Sampling

Tool uses MCP sampling to generate AG-UI component code
3

Code Validation

Tool validates generated code for security and AG-UI compatibility
4

MCP-UI Packaging

Tool wraps generated UI as MCP-UI resource with proper MIME type
UI Generation Sampling:

Zero-Inference Guarantee

SuperModel maintains its zero-inference guarantee through several architectural principles:

Deterministic Server Logic

All server operations are deterministic. The server executes decisions made by the client’s LLM rather than making its own decisions.

Sampling-Only AI

Every point where AI reasoning is needed uses MCP sampling to delegate to the client’s LLM.

Stateless Tools

UI generation tools are stateless and only execute based on explicit instructions from sampling responses.

Context Passthrough

Context flows through the system without server-side interpretation or modification.

Framework Modularity

SuperModel is designed to support multiple generative UI frameworks through adapter patterns:

Next Steps

Zero-Inference Deep Dive

Learn how SuperModel eliminates server inference costs completely.

Gateway Pattern

Understand intelligent routing and tool orchestration.

Hello World Example

See the architecture in action with a simple calculator example.

Multi-App Workflows

Explore complex user journeys across multiple UI apps.