Docs
See Mabarint at work
Real text annotated by Meta Muse Spark. Pick a tab, switch between Plain and Mabarint, and hover a marked word to read why it was marked.
One sentence, many meanings
“I didn't say she stole it.” has six readings, one for each word you can lean on. Each card below gives Muse Spark a different preceding context. The sentence is identical every time; only the stress moves.
Contexts written for Mabarint. Annotations precomputed with Muse Spark (muse-spark-1.3) through the Mabarint engine.
Classic novels, read aloud in your head
Two public-domain scenes full of politeness that is not quite polite. Switch between Plain and Mabarint, and hover a marked word to read Muse Spark's reasoning.
A Mad Tea-Party
Tone: indignant · 13 marks · muse-spark-1.3
Lewis Carroll, Alice's Adventures in Wonderland (1865), chapter VII. Public domain.
Netherfield Park is let at last
Tone: eager, bustling curiosity · 25 marks · muse-spark-1.3
Jane Austen, Pride and Prejudice (1813), chapter 1. Public domain.
Notation guide
Hover or focus an annotated word to see why Muse Spark marked it.
News: the voices carry feeling, the reporter stays neutral
In the news profile, emotion and stress are only allowed inside quotations from sources. The reporter's narration gets pauses and tempo only. The engine enforces this rule after Muse Spark answers, so the facts are never dramatized.
Riverside library reopens after flood repairs
Tone: neutral · 14 marks · muse-spark-1.3
Sample article written for Mabarint. Names and places are fictional.
Corner bakery closes after 61 years
Tone: neutral · 15 marks · muse-spark-1.3
Sample article written for Mabarint. Names and places are fictional.
For developers
Mabarint has three layers: the annotation engine (Muse Spark plus a validate-and-repair loop), an open offset-based JSON format, and a renderer that turns it into typography.
Every demo on this site is a plain JSON file you can open: for example demo-data/alice.json. The Playground shows readers only the marks; the same request with Accept: application/json returns the full annotation.
1. Drop-in script tag
Render precomputed annotations, or let the script call the engine for each element.
<script src="https://mazharrasyad.tech/mabarint/mabarint.js"
data-endpoint="https://your-host/api/annotate"></script>
<!-- precomputed JSON -->
<div data-mabarint data-mabarint-src="/annotations/chapter-1.json" data-mabarint-controls>
Plain text of the chapter…
</div>
<!-- annotate on load through the engine -->
<div data-mabarint="novel">"No," she whispered.</div>2. Renderer API
import { render, setIntensity, unrender } from "@mabarint/renderer";
render(element, annotation, { intensity: "full" }); // "full" = Mabarint, "off" = plain text
setIntensity(element, "off"); // cheap attribute switch
unrender(element); // back to the original plain textOverlapping spans are flattened into runs that carry every covering class, so the DOM never needs crossing elements. The words are never changed; markers are aria-hidden and the AI's reasons are available as keyboard-focusable tooltips.
3. Engine API
POST /mabarint/api/annotate
Content-Type: application/json
Accept: application/json (or text/event-stream for live progress)
{ "text": "…", "profile": "auto" | "novel" | "news" | "script", "context": "optional preceding text", "clientId": "optional browser id for history" }
// "auto" (the default) lets Muse Spark detect the type first; the result reports meta.detectedProfile.Pipeline for every paragraph:
- Detect the type of text (story, news or read-aloud script) with Muse Spark when the profile is
auto. - Segment into paragraphs, keeping the original character offsets.
- Annotate with Muse Spark (
muse-spark-1.3, JSON mode), passing the preceding paragraphs as context. - Validate: recompute offsets from each exact quote, check the schema, stress density (about 1 per 6 words), one emotion per utterance, and the news neutrality rule.
- Repair: send the errors back to Muse Spark, up to two rounds; spans that still fail are dropped.
- Cache by SHA-256 of text, profile, context, schema version, model and prompt.
Each run is saved on the server with its time, text and result (one JSON line per run, IP stored only as a salted hash); GET /mabarint/api/history returns the latest 50 runs from every visitor. The live playground is open to everyone and rate limited per IP and per day. A server can optionally require an access code (PLAYGROUND_ACCESS_CODE).
How it was built: Claude Code × Meta Model API
Meta Muse Spark is the product's brain: every annotation on this site, live or precomputed, comes from muse-spark-1.3. Claude Code, Anthropic's terminal coding agent, was the development partner. It wrote the engine, renderer, site and tests, checked each prompt change against live Muse Spark, and deployed this server.
Meta supports this pairing directly. The Model API exposes an Anthropic-format Messages API at https://api.meta.ai, so Claude Code's own agent loop can run on Meta's models (from Meta's coding agents guide):
export ANTHROPIC_BASE_URL="https://api.meta.ai" export ANTHROPIC_AUTH_TOKEN="$MODEL_API_KEY" export ANTHROPIC_MODEL="muse-wonder-1.0" export ANTHROPIC_DEFAULT_OPUS_MODEL="muse-wonder-1.0" export ANTHROPIC_DEFAULT_SONNET_MODEL="muse-spark-1.3" export ANTHROPIC_DEFAULT_HAIKU_MODEL="muse-spark-1.3" export CLAUDE_CODE_SUBAGENT_MODEL="muse-spark-1.3" export ENABLE_TOOL_SEARCH="true" claude
4. Format (v0.1)
{
"version": "0.1", "profile": "novel", "lang": "en", "tone": "grief",
"text": "\"No,\" she whispered. \"He was fine this morning.\"",
"spans": [
{ "type": "utterance", "start": 0, "end": 5, "quote": "\"No,\"", "speaker": "Mara",
"emotion": "sadness", "intensity": 0.8, "reason": "Denial at terrible news" },
{ "type": "volume", "start": 0, "end": 5, "quote": "\"No,\"", "level": "whisper" },
{ "type": "pause", "start": 20, "end": 20, "length": "short" },
{ "type": "stress", "start": 29, "end": 33, "quote": "fine", "level": 2, "reason": "Contrasts with now" }
]
}| type | fields | notation |
|---|---|---|
utterance | emotion, speaker, intensity 0–1, reason | Soft coloured underline per emotion (sarcasm dashed) |
stress | level 1 | 2 | 3, reason | Heavier weight: 560 / 680 / 800 |
elongate | level 1 | 2 | 3 | Letter spacing 0.08 / 0.15 / 0.25em |
pause | length short | long (start = end) | Marker ‧ or ‖ |
pitch | contour rise | fall | rise-fall | Last word shifts ±0.15em, glyph ↗ ↘ |
tempo | rate slow | normal | fast | Word spacing +0.25em / -0.05em |
volume | level whisper | soft | normal | loud | shout | Opacity 0.55 / 0.75, size 1.08 / 1.15em |
Emotions: neutral joy sadness anger fear surprise tenderness sarcasm. Offsets are UTF-16 indices,[start, end), and quote always equals text.slice(start, end). Full JSON Schema: schema/mabarint.schema.json.