v1.2.0: Claude Opus 4.7 + ephemeral prompt cache + Zod-validated IR

Frontend personalization without frontend customization.

Fluid runs a dual-path engine: preset archetypes return instantly without LLM calls, while novel intents compile through Claude Opus 4.7 into Zod-validated IR and render with FluidView.

fluid-compiler-flow
Schema JSON
User Intent
Claude Opus 4.7
Zod Validator
<FluidView ir data />

Watch Fluid in Action

See how Fluid compiles natural language intents into fully functional, personalized UI components in real time.

Watch on YouTube
YouTube

Click the video to open the full walkthrough on YouTube →

See the Compiler in Action

Select a schema and intent, then watch the engine build an intent hash, check 1-hour IR cache, and only call Claude on misses before validating JSON IR with Zod and rendering via FluidView.

1. INPUT CONFIGURATION
Capability Schema (JSON) TypeScript Compatible
User Intent & Context

2. ENGINE TRANSFORMATION
Build cache key: ir:{schema}:{sha256(intent)[:16]} DONE
Check in-memory IR cache (TTL: 1 hour) DONE
Call Anthropic provider (claude-opus-4-7 stream) DONE
Parse JSON + Zod validate (retry once on failure) DONE
Compiled Fluid IR
3. FluidView RENDER LIVE RENDER

The Personalization Dilemma

Traditional frontend stacks require writing separate layouts or maintaining massive bundles of conditions to customize UI for different users. Fluid ends the code sprawl.

Traditional Architecture (Code Sprawl)

Conditional Rendering Bloat

Adding dynamic features means stuffing codebase with A/B testing flags, feature toggles, device checks, and localizations. The output? Heavy JS files, slow compile times, and spaghetti code.

// ❌ Legacy Frontend Conditional Rendering
if (user.isMobile && user.geo === 'JP') {
  return <TokyoMobileCheckout methods={JP_PAYMENTS} />;
} else if (user.plan === 'enterprise' && user.role === 'admin') {
  return <EnterpriseDesktopCheckout />;
} else {
  // 12 more conditions...
}
Fluid Architecture (Schema Driven)

Declarative Schema Renderer

Define what the interface is capable of doing once. Fluid handles the evaluation, constraints, and dynamic generation of the view layer at the edge. Clean client codebase with 0kb layout engine overhead.

//  Fluid Edge Architecture
// Single React component resolves context and renders valid IR
<FluidView 
  schema={paymentSchema}
  intent={userIntent} 
  data={runtimeData}
/>

The Boundary-Safe Cycle

How Fluid enforces schema-to-engine, LLM-to-IR, and IR-to-renderer boundaries while keeping latency low.

01

Schema Defines Capability

Define entities, fields, and endpoints once. The prompt builder uses this schema so generation can only reference declared capability boundaries.

02

Normalize Intent, Then Cache

Normalize user intent, derive the key ir:{schema}:{sha256(intent)[:16]}, and short-circuit to cached IR when available.

03

Generate, Validate, Render

On cache miss, stream IR from Claude, strip code fences, parse JSON, validate with Zod, retry once on validation errors, then render via recursive FluidView nodes.

Minimal Integration. Maximum Control.

Look under the hood at the schema declaration, the Intermediate Representation (IR), and client-side rendering.

Typescript
import { defineSchema } from "@fluid/core";

export const feedbackSchema = defineSchema({
  id: "user-feedback",
  entities: {
    Feedback: {
      rating: { type: "integer", required: true },
      message: { type: "string", required: true },
      email: { type: "string", required: false }
    }
  },
  endpoints: {
    submit: {
      path: "/api/feedback",
      method: "POST"
    }
  }
});
{
  "$schema": "https://fluid.dev/ir/v1.json",
  "id": "user-feedback",
  "layout": {
    "style": "glassmorphic",
    "spacing": "compact"
  },
  "components": [
    {
      "type": "header",
      "props": { "title": "Outage Feedback", "alert": true }
    },
    {
      "type": "stars-selector",
      "binding": "rating",
      "props": { "label": "Rate your outage experience" }
    },
    {
      "type": "textarea",
      "binding": "message",
      "props": { "placeholder": "What went wrong?" }
    },
    {
      "type": "submit-btn",
      "action": "submit",
      "props": { "variant": "danger", "text": "Escalate Feedback" }
    }
  ]
}
import { FluidView } from "@fluid/react";
import { feedbackSchema } from "./schema";

export default function App() {
  const userIntent = "Emergency outage feedback on mobile screen";
  
  return (
    <main className="dark bg-black p-12">
      <FluidView 
        schema={feedbackSchema} 
        intent={userIntent}
        data={{}}
      />
    </main>
  );
}

Why an IR Compiler Wins

Generating JavaScript directly from AI is slow, insecure, and breaks on updates. Fluid uses an Intermediate Representation (IR) to ensure speed, security, and predictability.

Deterministic Sandbox

Since the output is a JSON-based schema, it runs within a sandbox with strict boundaries. Code injections, script runs, and unexpected crashes are mathematically impossible.

Dual-Layer Caching

Saves resolved layouts in Map/Redis edge cache for 1 hour. Normalizes client-side spaces and case options to resolve intents inside 2ms, bypassing the LLM entirely.

Cross-Platform Native

You aren't locked to HTML. The same Fluid IR compiles natively into React Components, Swift UI for iOS apps, Jetpack Compose for Android, or Flutter views. Code once, personalize everywhere.

Engineered for Reliability

Fluid was built to satisfy security teams, performance budgets, and developer workflows alike.

Performance

1.4ms Cache Resolution

Hot path resolution hits edge Map/Redis cache under 2ms. Cold path uses Ephemeral prompt caching to lower streaming time to 5s while reducing Anthropic API input costs.

Claude Opus Cold Path
8,200ms
IR Cache HIT
1.4ms
Type Safety

Zod Constraints

Enforce strict layer boundaries. Every JSON output from the LLM is validated against schemas with Zod, throwing errors if non-declared fields are used.

Security

Malicious Safe

LLMs cannot run script code, read environment secrets, or execute arbitrary HTTP fetches. Only developer-authored endpoints can run from the React client.

Multi-Platform

Unified SDK Suite

Deliver identical personalization schemas to React, Solid, iOS Swift, and Android Jetpack layouts. Ensure perfect architectural cohesion across mobile, desktop and web apps.

React SwiftUI Jetpack Compose Flutter
Extensibility

Recursive renderNode()

Map JSON elements to native React element structures using a clean switch statement. Easily register custom components into the registry without modifying core validation.

Built for Developer Flow

Fluid integrates seamlessly into your terminal, CI pipelines, and version control. Push schemas just like you push code.

bash — fluid deploy
$ npm install -g @fluid/cli
added 24 packages in 1.2s
$ fluid push ./schemas
✓ Discovered 3 interfaces in `./schemas`
✓ Schema validation complete (0 errors)
✓ Compiled Intermediate Representation (IR) files
✓ Deployed to global registry edge. Diff: 2 added, 1 modified. [9ms propagation]
$ _

We are moving beyond the static interface era. Fluid decouples layout design from user capability, enabling software to morph around human intent in real time.

Alex Rivera CTO, Fluid Labs

Ready to ship fluid interfaces?

Deploy your first capability schema in 5 minutes. Start personalizing experiences without frontend refactoring cycles.

npm install @fluid/react