Files
LocalAI/docs/static/images/diagrams/ds4-layer-split.html
LocalAI [bot] 7e59a5c7c5 docs: architecture & feature diagrams (blueprint style) (#10137)
* docs: add 'how LocalAI works' architecture diagram

Add a blueprint-style architecture diagram: clients -> small core (API,
router, WebUI, agents) -> gRPC -> backend processes pulled on demand as
OCI images. Place it on the overview page and replace the stale external
architecture image on the reference page.

Assisted-by: Claude:claude-opus-4-8 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* docs: add blueprint diagrams across feature, distributed & getting-started docs

Add 24 architecture/flow/comparison diagrams (PNG + HTML source) under
docs/static/images/diagrams/, wired into their docs pages, from an
impact-vs-effort audit of the docs. Broaden the API surface on the
overview architecture diagram (OpenAI, Anthropic, ElevenLabs, Ollama,
and LocalAI's own API) and move the gRPC boundary label clear of the arrows.

Pages: distributed mode (architecture, scheduling, ds4 layer-split),
distributed inferencing, MLX, realtime, quantization, MCP, agents,
mitm & cloud proxy, middleware, reverse-proxy TLS, VRAM, voice & face
recognition, reranker, function calling, fine-tuning (recipe + jobs),
diarization, audio transform, quickstart, model resolution.

Assisted-by: Claude:claude-opus-4-8 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* docs: add composable-core diagram to README hero

Commit the composable-core card (small core + on-demand backend tiles)
alongside the other diagrams and reference it from the README hero via a
repo-relative path, so it renders on GitHub.

Assisted-by: Claude:claude-opus-4-8 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* docs: fix composable-core connectors/badge and federated-vs-worker layout

- composable-core: thicken the plug-in connectors so they read clearly, and
  widen the SEPARATE IMAGE badge so its text no longer overflows the box.
- federated-vs-worker: shorten the WHOLE/SPLIT REQUEST pills to fit, and
  replace the tangled node-to-node activation arrows with a clean fan-out
  (request split across all sharded nodes), mirroring the federated panel.

Assisted-by: Claude:claude-opus-4-8 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-06-02 18:43:22 +02:00

165 lines
7.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Archivo:wght@500;600;700&display=swap" rel="stylesheet">
<style>
:root{
--paper:#F3E8D2; --paper2:#ECDFC2; --ink:#211C14; --ink-soft:#5A5142;
--rust:#B43A2C; --rust-deep:#8F2C20; --cold:#3F6E73; --hi:#E7D6AE; --dim:#A99F88;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:1600px;height:900px}
body{
background:var(--paper);color:var(--ink);font-family:"Archivo",sans-serif;
position:relative;overflow:hidden;
background-image:
linear-gradient(var(--paper2) 1px,transparent 1px),
linear-gradient(90deg,var(--paper2) 1px,transparent 1px);
background-size:40px 40px;
}
.frame{position:absolute;inset:26px;border:3px solid var(--ink);}
.wrap{position:absolute;inset:26px;padding:30px 56px 26px;display:flex;flex-direction:column}
header{display:flex;align-items:flex-end;justify-content:space-between;gap:30px}
.eyebrow{font-weight:700;letter-spacing:.22em;text-transform:uppercase;font-size:17px;color:var(--rust-deep)}
.eyebrow b{color:var(--ink)}
h1{font-family:"Bricolage Grotesque",sans-serif;font-weight:800;font-size:50px;line-height:.98;letter-spacing:-.015em;margin-top:6px}
h1 em{font-style:normal;color:var(--rust)}
.stamp{border:3px solid var(--ink);padding:10px 16px 8px;transform:rotate(3deg);text-align:center;background:var(--paper);box-shadow:6px 6px 0 var(--ink);flex:none}
.stamp .k{font-family:"Bricolage Grotesque";font-weight:800;font-size:21px;letter-spacing:.04em;line-height:1.05}
.stamp .s{font-weight:700;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink-soft);margin-top:5px}
.stage{flex:1;margin-top:8px}
svg{width:100%;height:100%;overflow:visible}
footer{display:flex;align-items:center;justify-content:space-between;margin-top:6px;gap:24px}
.note{font-weight:600;font-size:18px;color:var(--ink-soft);line-height:1.3;max-width:1080px}
.note b{color:var(--ink)}
.url{font-family:"Bricolage Grotesque";font-weight:800;font-size:22px;color:var(--rust-deep);letter-spacing:.01em;flex:none}
.url span{color:var(--ink)}
</style>
</head>
<body>
<div class="frame"></div>
<div class="wrap">
<header>
<div>
<div class="eyebrow">LocalAI <b>&middot;</b> ds4 layer split</div>
<h1>Workers dial <em>in</em></h1>
</div>
<div class="stamp">
<div class="k">LAYER</div>
<div class="s">split</div>
</div>
</header>
<div class="stage"><svg viewBox="0 0 1480 560" id="svg"></svg></div>
<footer>
<div class="note">ds4 workers connect to the coordinator <b>(llama.cpp RPC dials the other direction).</b></div>
<div class="url">localai.io<span>/features/distributed-mode</span></div>
</footer>
</div>
<script>
const INK="#211C14", PAPER="#F3E8D2", PAPER2="#ECDFC2", HI="#E7D6AE", SOFT="#5A5142", RUST="#B43A2C", RUSTD="#8F2C20", COLD="#3F6E73", DIM="#A99F88";
function el(t,a,x){const e=document.createElementNS("http://www.w3.org/2000/svg",t);for(const k in a)e.setAttribute(k,a[k]);if(x!=null)e.textContent=x;return e;}
const svg=document.getElementById("svg");
function shadowRect(x,y,w,h,fill,stroke,sw,dash){
svg.appendChild(el("rect",{x:x+7,y:y+7,width:w,height:h,fill:INK}));
svg.appendChild(el("rect",{x,y,width:w,height:h,fill,stroke:stroke||INK,"stroke-width":sw||3.5,"stroke-dasharray":dash||"none"}));
}
function txt(x,y,s,o){o=o||{};svg.appendChild(el("text",{x,y,"font-family":o.f||"Archivo","font-weight":o.w||700,"font-size":o.sz||15,"letter-spacing":o.ls||"0","text-anchor":o.a||"start",fill:o.fill||INK},s));}
function arrow(x1,y1,x2,y2,color,dash){
const mx=(x1+x2)/2;
svg.appendChild(el("path",{d:`M ${x1} ${y1} C ${mx} ${y1}, ${mx} ${y2}, ${x2-11} ${y2}`,fill:"none",stroke:color,"stroke-width":3.5,"stroke-linecap":"round","stroke-dasharray":dash||"none"}));
const a=7;
svg.appendChild(el("path",{d:`M ${x2-11} ${y2} l -${a+4} -${a} M ${x2-11} ${y2} l -${a+4} ${a}`,fill:"none",stroke:color,"stroke-width":3.5,"stroke-linecap":"round"}));
}
// ===================== PANELS =====================
// LEFT panel: ds4 (rust) - workers dial IN to coordinator
// RIGHT panel: llama.cpp RPC (cold teal) - main dials OUT to rpc-servers
// ---- panel frames + headers ----
const PY=24, PH=448, PW=692;
const LPX=18, RPX=770;
// LEFT panel frame
svg.appendChild(el("rect",{x:LPX,y:PY,width:PW,height:PH,fill:"none",stroke:RUSTD,"stroke-width":2,"stroke-dasharray":"2 7"}));
// LEFT header bar
shadowRect(LPX+16,PY+22,300,44,RUST,INK,3.5);
txt(LPX+34,PY+52,"ds4",{f:"Bricolage Grotesque",w:800,sz:26,fill:PAPER});
txt(LPX+316-18,PY+50,"layer split",{w:700,sz:13,ls:".1em",a:"end",fill:"#F1D9C8"});
// RIGHT panel frame
svg.appendChild(el("rect",{x:RPX,y:PY,width:PW,height:PH,fill:"none",stroke:COLD,"stroke-width":2,"stroke-dasharray":"2 7"}));
// RIGHT header bar
shadowRect(RPX+16,PY+22,372,44,COLD,INK,3.5);
txt(RPX+34,PY+52,"llama.cpp RPC",{f:"Bricolage Grotesque",w:800,sz:26,fill:PAPER});
txt(RPX+388-18,PY+50,"distributed",{w:700,sz:13,ls:".1em",a:"end",fill:"#DCEBEC"});
// ============== LEFT: workers -> coordinator ==============
// coordinator centered vertically in panel
const coW=246, coH=104;
const coX=LPX+PW-coW-40, coY=PY+172;
shadowRect(coX,coY,coW,coH,PAPER,INK,4);
svg.appendChild(el("rect",{x:coX,y:coY,width:coW,height:36,fill:RUST}));
svg.appendChild(el("line",{x1:coX,y1:coY+36,x2:coX+coW,y2:coY+36,stroke:INK,"stroke-width":3}));
txt(coX+coW/2,coY+26,"coordinator",{f:"Bricolage Grotesque",w:800,sz:21,a:"middle",fill:PAPER});
txt(coX+coW/2,coY+62,"merges slices",{w:700,sz:15,a:"middle"});
txt(coX+coW/2,coY+86,"serves the API",{w:600,sz:14,a:"middle",fill:SOFT});
// two worker boxes on the left of panel
const wW=232, wH=92;
const wX=LPX+40;
const wY=[PY+96, PY+264];
const wData=[
{n:"worker A",s:"layers 0:19"},
{n:"worker B",s:"layers 20:output"},
];
wData.forEach((d,i)=>{
shadowRect(wX,wY[i],wW,wH,"#EFE0BF",INK,3.5);
txt(wX+18,wY[i]+38,d.n,{f:"Bricolage Grotesque",w:800,sz:22});
txt(wX+18,wY[i]+66,d.s,{w:700,sz:16,fill:RUSTD});
});
// arrows: workers dial IN toward coordinator (arrowhead at coordinator)
arrow(wX+wW, wY[0]+wH/2, coX, coY+38, RUSTD, "none");
arrow(wX+wW, wY[1]+wH/2, coX, coY+coH-22, RUSTD, "none");
// caption under left arrows
txt(LPX+PW/2, PY+PH-22, "activations flow through the slices", {w:600,sz:14,a:"middle",fill:SOFT,ls:".02em"});
// ============== RIGHT: main -> rpc-servers ==============
// main server on the LEFT of right panel
const msW=246, msH=104;
const msX=RPX+40, msY=PY+172;
shadowRect(msX,msY,msW,msH,PAPER,INK,4);
svg.appendChild(el("rect",{x:msX,y:msY,width:msW,height:36,fill:COLD}));
svg.appendChild(el("line",{x1:msX,y1:msY+36,x2:msX+msW,y2:msY+36,stroke:INK,"stroke-width":3}));
txt(msX+msW/2,msY+26,"main server",{f:"Bricolage Grotesque",w:800,sz:21,a:"middle",fill:PAPER});
txt(msX+msW/2,msY+62,"holds the model",{w:700,sz:15,a:"middle"});
txt(msX+msW/2,msY+86,"offloads layers",{w:600,sz:14,a:"middle",fill:SOFT});
// two rpc-server boxes on the RIGHT of right panel
const rW=232, rH=92;
const rX=RPX+PW-rW-40;
const rY=[PY+96, PY+264];
const rData=[
{n:"rpc-server",s:"remote GPU/CPU"},
{n:"rpc-server",s:"remote GPU/CPU"},
];
rData.forEach((d,i)=>{
shadowRect(rX,rY[i],rW,rH,"#DCE7E7",INK,3.5);
txt(rX+18,rY[i]+38,d.n,{f:"Bricolage Grotesque",w:800,sz:22});
txt(rX+18,rY[i]+66,d.s,{w:700,sz:16,fill:COLD});
});
// arrows: main dials OUT toward rpc-servers (arrowhead at rpc-servers)
arrow(msX+msW, msY+38, rX, rY[0]+rH/2, COLD, "2 8");
arrow(msX+msW, msY+msH-22, rX, rY[1]+rH/2, COLD, "2 8");
// caption under right arrows
txt(RPX+PW/2, PY+PH-22, "main opens connections to workers", {w:600,sz:14,a:"middle",fill:SOFT,ls:".02em"});
</script>
</body>
</html>