{"slug": "mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text", "title": "MosAIc: a reconfigurable surface where an LLM emits a layout, not just text", "summary": "Developer vonargo released MosAIc, a reconfigurable surface where large language models emit JSON overlays to reshape UI layouts instead of generating linear chat transcripts. The open-source project, hosted on Hugging Face Spaces, uses a viewer-billed architecture with client-side OAuth and no backend, allowing models to patch surfaces incrementally. The creator seeks technical feedback on the wire format tradeoffs between JSON, YAML, and other structured outputs.", "body_md": "I’ve been exploring an alternative to linear chat: instead of a transcript, the model emits a small JSON overlay that re-configures the UI, and the surface lays it out. The interesting parts are the mechanism and the contract and would love some technical feedback (or thrown spears).\n\nThe core mechanism is a couple dozen lines.\n\nA surface holds views that lay out “tesserae” (typed tiles: markdown / code / table / diagram / note / tasks).\n\nAn overlay is a surface-shaped patch, merged over a base by view id:\n\neffective(base) = base merged with overlay, and the entire render path reads only from effective(), so one overlay reshapes the sidebar and the tiles, no imperative DOM code. The schema is deliberately tiny and it’s meant as a render target any producer (model, agent, IDE) can write to SCHEMA.md\n\nIt evolves, not regenerates (a bit simplistic right now tbh). Successive tasks are sent the current surface and emit a patch while composeOverlay() folds each into the accumulated overlay with the same id-merge, so “add a PKCE section” extends the surface instead of starting over. (Composing a patch into the accumulator yields the same result as applying it to the rendered surface, so the accumulator stays one overlay.)\n\nArchitecture is viewer-billed with no back end. Static Space, pure HTML/ES-modules, no build. The model path is BYO LLM: client side HF OAuth with Inference Providers billed to the signed-in viewer and the token never leaves the browser (no server, no owner key). The OAuth app is provisioned just from hf_oauth in the README.\n\nRobustness. Every overlay (model or hand-edited) passes a validator that normalizes and degrades a bad emit to a message instead of breaking the render; the model path uses json_object, a balanced-brace extractor, and one corrective retry. The model is also told it has no file access, which curbs it from confidently inventing specifics about content it can’t see (though YMMV).\n\nOpen question I’d like input on: the wire format. It’s JSON today (precise, trivially validated, but models fumble escaping/brackets and it can’t stream). I wrote up the tradeoff matrix (JSON vs YAML block scalars vs markdown vs XML tags vs tool calls/json_schema) in ROADMAP.md. What have people found most reliable for getting structured UI out of a model?\n\nMIT Licensed code and docs are in the Space tree. No signin demo via the examples: [MosAIc - a Hugging Face Space by vonargo](https://huggingface.co/spaces/vonargo/mosAIc)", "url": "https://wpnews.pro/news/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text", "canonical_source": "https://discuss.huggingface.co/t/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text/177021#post_1", "published_at": "2026-06-21 09:44:47+00:00", "updated_at": "2026-06-21 10:12:07.451649+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "developer-tools"], "entities": ["vonargo", "Hugging Face", "MosAIc", "OAuth", "JSON"], "alternates": {"html": "https://wpnews.pro/news/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text", "markdown": "https://wpnews.pro/news/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text.md", "text": "https://wpnews.pro/news/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text.txt", "jsonld": "https://wpnews.pro/news/mosaic-a-reconfigurable-surface-where-an-llm-emits-a-layout-not-just-text.jsonld"}}