vonargo/mosAIc
1
1---2title: MosAIc3emoji: ๐จ4colorFrom: indigo5colorTo: gray6sdk: static7pinned: true8license: mit9short_description: "Reconfigurable LLM surface that reshapes per task"10tags:11 - llm12 - inference-providers13 - oauth14 - ui15 - coauthoring16 - agent17 - okf18hf_oauth: true19hf_oauth_scopes:20 - inference-api21---22 23# MosAIc24 25**A reconfigurable surface for directing an LLM โ the panels reshape per task, instead of a linear chat transcript.**26 27> **โ ๏ธ Authenticity notice.** The only official home of MosAIc is28> **https://github.com/vonargo/mosAIc**. MosAIc is distributed as **source29> only โ there are no official binary or installer downloads.** Lookalike30> sites (including typosquatted domains that proxy this repo's pages, e.g.31> "ithub"-style Fastly mirrors) have distributed **malware** under this32> project's name via fake "release" downloads. If you see a "Loader",33> installer, or password-protected archive claiming to be MosAIc, it is not34> ours โ do not run it. Get the code only by cloning this repository.35 36Most LLM interfaces are a scroll: one conversation, no matter the work. MosAIc is a *surface* instead โ a sidebar of views and a field of typed tiles. The model emits a small JSON **overlay** describing the shape it wants; MosAIc lays it out. Keep asking and the surface **evolves** โ each task patches the current one instead of starting over. Same mechanism, any task.37 38It's **bring-your-own-LLM**: sign in with Hugging Face, type a task, and it's sent to a model on [Inference Providers](https://huggingface.co/docs/inference-providers) billed to **your own account** โ no shared key, and no *MosAIc* backend. MosAIc is the surface, not the model.39 40> **What leaves your browser:** "no backend" means no MosAIc server โ *not* local-only. The model path sends your **typed task, and any OKF bundle you've loaded**, to a third-party inference provider (`provider:"auto"`). The examples and the Composer run fully in the browser; the typed/model path does not.41 4243 44## Try it45 46It's a static site โ no backend, no build step.47 48```bash49python3 -m http.server 8000 # then open http://localhost:800050```51 52or just open `index.html`.53 54Three ways to drive it, all from the command bar:55 56- **Type a task** (signed in) โ a model emits an overlay and the whole shell โ sidebar *and* tiles โ reshapes, on your own HF credits.57- **An example** (`Explain a codebase`, `Debug an error`, `Plan a feature`, `Plan a trip`, or **Open a sample OKF bundle**) โ applies a canned overlay instantly, no sign-in.58- **The Composer** โ paste/edit overlay JSON and **Apply** it by hand.59 60The typed/model path needs the OAuth app that the deployed Space provides; running locally, the **examples and Composer** still work, so you can explore the surface with no sign-in. To deploy your own and light up the model path, see **[DEPLOY.md](DEPLOY.md)**.61 62## How it reshapes63 64The mechanism is **base + overlay**. A base surface plus an overlay a model emits, merged by view id: `effective(base) = base โ overlay`. The render path reads only from `effective()`, so one overlay reshapes everything. A small validator (`js/overlay.js`) checks every overlay first, so a bad emit degrades to a message instead of breaking the surface.65 66A **surface** holds **views**; a view lays out **tesserae** โ the typed content tiles a mosaic is made of (markdown, code, table, diagram, note, tasks). Controls (the prompt, examples, Composer, theme, sidebar toggle) live in the command bar โ chrome the surface can't reshape away. The overlay contract is small and documented in **[SCHEMA.md](SCHEMA.md)** โ the target a model writes to.67 68## 2.0 โ the subject surface69 70The sidebar now carries a **subject rail**: for whatever view you're on, everything else on the surface โ other views and any loaded OKF concepts โ is listed **ranked by relatedness, strongest on top**, each row a click-through with a strength bar. It's the mind map, realized as a list. The ranking is computed **in your browser** (instant, zero tokens, works signed-out); the rail shows which scorer ranked it. As of 2.1 the scorer is **field-weighted lexical with IDF**: title and tag matches outrank body matches, rare discriminative terms outrank ubiquitous ones, and the tokenizer is Unicode-aware (acronyms, Cyrillic, and compound tokens like `node.js` all score). The scorer design owes a debt to John6666's survey in [the announcement thread](https://discuss.huggingface.co/t/177021) โ as does the principle the whole rail runs on: *model proposes, host disposes*.71 72Signed in, a **โฆ rerank** button asks the model to re-score the same rows โ one small call, and nothing is sent until you click. Rerank sends the current view's title and each candidate's title plus a โค200-character snippet to the model on your Hugging Face account โ the same data flow as typing a task. The model can only *re-score* the rows the rail already computed; it can never add, remove, or retitle one.73 74The tiles got hands, too: **drag a tile** to rearrange a view, **drag a tile's corner** to resize it across columns (a click on the corner toggles wide/narrow) โ both persist across reloads โ and views with four or more tiles get a **pinned table of contents** that scrolls to a tile on click.75 76## Open a knowledge base (OKF)77 78MosAIc also reads **[Open Knowledge Format](https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf)** โ Google Cloud's portable "LLM-wiki" spec: a folder of markdown files with YAML frontmatter. Click **โฃ OKF** in the command bar to open a bundle (a folder), or pick **"Open a sample OKF bundle"** from the examples โ no sign-in. (Opening your own folder uses the directory picker, which Safari doesn't support โ use Chrome or Firefox, or the sample bundle.)79 80Where the reference viewer draws a force-directed graph, MosAIc renders an OKF bundle as a **calm reading surface**: one view per concept `type`, each concept a card, cross-links that navigate in place, and โ because OKF's frontmatter has no trust field โ a **provenance strip** that surfaces what each concept *does* carry (a source link, a freshness date, citations) and flags what it doesn't (`sourced` vs `unsourced`). The parser + adapter are pure and tested (`js/okf.js`); build notes in [OKF-VIEWER-BRIEF.md](OKF-VIEWER-BRIEF.md).81 82## Shape83 84- `index.html` + `style.css` โ the shell, command bar, and aesthetic (Syne + IBM Plex)85- `js/state.js` โ `STATE` + `effective(base)`, the base โ overlay merge86- `js/surface.js` โ the base surface; `js/demo.js` โ the task overlays87- `js/tesserae.js` โ one renderer per content tile (adding a type is one function)88- `js/composer.js` โ the Composer drawer (a command-bar driver)89- `js/llm.js` โ the typed/model path: HF OAuth (viewer token) + Inference Providers90- `js/overlay.js` โ validates a model/Composer overlay before it's applied91- `js/okf.js` + `js/okf-load.js` โ open a Google **OKF** knowledge bundle and render it as a reading surface92- `js/view.js`, `js/router.js`, `js/sidebar.js` โ the render path93- `js/diagram.js` โ diagram tiles via Mermaid (loaded lazily, degrades to source text offline)94 95See **[CODEMAP.md](CODEMAP.md)** for the file-by-file orientation, **[SCHEMA.md](SCHEMA.md)** for the overlay contract, **[ROADMAP.md](ROADMAP.md)** for what's next, and **[VISION.md](VISION.md)** for the north star (where this is ultimately headed). Pure-core tests run with `node --test`.96 97## License98 99MIT.100 