Skip to content

docs: align architecture diagrams with homepage and codebase - #575

Merged
edenreich merged 5 commits into
mainfrom
docs/architecture-diagrams
Aug 17, 2026
Merged

edenreich merged 5 commits into
mainfrom
docs/architecture-diagrams

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

Reworked both diagrams on the architecture overview page to match the homepage diagram's approach (same entities, emojis, and wire labels: your app, Inference Gateway, LLM providers, MCP servers, A2A agents) and validated their content against the gateway codebase.

Validation against the codebase

Explored inference-gateway/inference-gateway (cmd/gateway/main.go, api/middlewares/, config/config.go):

  • The old General Overview diagram drew OIDC auth as a hop before the gateway; it is middleware inside the gateway. It also omitted guardrails, the MCP tool-call loop, and model routing entirely. The new diagram shows the pipeline in the exact order the binary registers it: OIDC auth -> guardrails -> MCP tool loop -> model routing -> provider proxy.
  • Added the A2A branch off the client (dashed, delegated by the CLI) - the middleware set is exactly auth, guardrails, logger, mcp, telemetry, so A2A is correctly not proxied by the gateway, consistent with the homepage caption.
  • Dropped the redundant 3-replica "gateway tier" from the overview (the Kubernetes diagram already shows replicas); statelessness stays in the prose.
  • Kubernetes diagram: the metrics edge was drawn from the API Service pushing to monitoring. Prometheus pulls: the ServiceMonitor scrapes each pod's dedicated :9464 metrics port (METRICS_PORT default in config/config.go). The arrow now goes Monitoring -> Gateway Pods labeled "scrape :9464 /metrics", and the monitoring stack sits inside the cluster where kube-prometheus-stack runs.

Checks

  • bun run lint:md, bun run format:check, bun run build all pass (build embeds the new diagram sources; mermaid renders client-side).

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner August 17, 2026 21:12
@inference-gateway-releaser

inference-gateway-releaser Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🗑️ Preview environment destroyed.

@edenreich

Copy link
Copy Markdown
Contributor

@claude Please improve these diagrams, make them more dynamic and beautiful like the main one. use /ponytail:ponytail

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 3m 8s —— View job


Diagrams now match the homepage

Both mermaid blocks on the architecture page are replaced with a single reusable FlowDiagram.vue that borrows the homepage diagram's look and motion: animated dashed rails, a highlight that travels stage by stage through the flow, dashed borders for optional/out-of-band hops, and clickable nodes linking to the relevant guide.

  • Read the current diagrams and the homepage ArchitectureDiagram.vue
  • Replace both mermaid blocks with an animated, theme-aware Vue diagram
  • bun run lint:md, bun run format:check, bun run build - all pass (18 nodes render server-side, so the diagrams are in the static HTML too)
  • Commit

What changed

  • New .vitepress/theme/components/FlowDiagram.vue, registered globally; the page uses <FlowDiagram flow="request" /> and <FlowDiagram flow="kubernetes" />. Both diagram definitions live in the component, so the markdown stays clean.
  • Same content as before, nothing re-litigated: pipeline order (OIDC auth -> guardrails -> MCP tool loop -> model routing -> provider proxy), A2A delegated by the CLI, Prometheus pulling :9464 /metrics off the pods.
  • Side benefit over mermaid: these render in dark mode with the site's own tokens instead of a baked light-background SVG, and they reflow to a vertical stack on mobile. prefers-reduced-motion kills the animation.

Skipped: refactoring the homepage ArchitectureDiagram.vue to share this component - it works, and merging the two shapes would cost more than the duplicated CSS does. Worth doing if a third diagram shows up.

Preview should redeploy on this commit - worth an eyeball at https://preview-docs-architecture-diagrams.inference-gateway.com/architecture-overview/

  • branch docs/architecture-diagrams

@edenreich

Copy link
Copy Markdown
Contributor

@claude On desktop the text is a bit overlapping (/v1/chat/completions):

image

Can you fix this? use /ponytail:ponytail

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 1m 28s —— View job


Rail labels no longer overlap

  • Reproduce: .flow-rail-label was position: absolute + white-space: nowrap over a fixed flex: 0 1 72px rail, so POST /v1/chat/completions (~180px) spilled left and right onto the neighbouring node text
  • Fix: on desktop the rail is now a column flex box - the label sits in normal flow and the dashed line moved to ::after, so the rail sizes to its own label instead of clipping through the nodes. min-width: 72px keeps short labels (provider request, load balanced) from collapsing the gap; a 20px bottom pad keeps the line on the node centerline
  • .flow-rail-step (the little vertical connectors inside the gateway frame) opts out via ::after { content: none } and min-width: 0
  • prefers-reduced-motion now also stops the ::after animation
  • bun run build and bunx prettier --check pass
  • Committed

Mobile is untouched - the base (vertical) styles already put the label beside the rail with room to spare.

Preview redeploys on this commit: https://preview-docs-architecture-diagrams.inference-gateway.com/architecture-overview/

Skipped: truncating/wrapping very long labels. Add when a label gets long enough to stretch a rail past a node's width.

  • branch docs/architecture-diagrams

@edenreich

Copy link
Copy Markdown
Contributor

@claude [browser] still looks terrible, it's squished can you fix this?

image

DO NOT stop until you got it clear. I think also we should use the same approach like on the main page diagram where A2A clients are grouped with the other clients and they all can talk to the gateway.

Use /ponytail:ponytail

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 4m 11s —— View job


Diagrams no longer squish - verified in a real browser

Root cause: the desktop layout put 4 columns plus rails side by side inside the VitePress content column (~690px), so every column got ~130px and every label wrapped 3 lines. Fixed by flipping the axis - the diagram now stacks bands vertically, and the nodes inside each band lay out horizontally across the full width. Nothing can get squeezed into a narrow column any more, and the layout is identical at 390px and 1440px, so the desktop media query and the absolute-positioned rail label are gone (net -50 lines).

  • Read FlowDiagram.vue, homepage ArchitectureDiagram.vue, and the screenshot
  • Rework the layout - bands stack, nodes span the band width
  • Group A2A agents with the other clients, like the homepage diagram
  • bun run build, bun run format:check, bun run lint:md all pass
  • Screenshotted the built site in headless chromium at 1440px (light + dark) and 390px

What changed

  • Clients group - Your app and A2A agents now sit side by side inside a dashed Clients box, same as the homepage, and the wire out of the group is the shared POST /v1/chat/completions. Sub-line borrowed from the homepage too: "Delegated by the CLI, and they call the gateway themselves". Prose above the diagram updated to match - A2A agents are clients; what the gateway doesn't proxy is the A2A protocol.
  • Gateway pipeline is compact numbered rows (1 OIDC auth ........ optional) instead of five tall stacked cards, so the middle no longer towers over the sides.
  • Rail labels sit beside the dashed line in normal flow - no absolute positioning, so overlap is not possible.
  • Added text-decoration: none - linked nodes were rendering every line underlined.
  • Kubernetes diagram gets the same treatment: Clients group, cluster edge as numbered rows, 3 pods across one row, monitoring spanning the row below.

Preview redeploys on this commit: https://preview-docs-architecture-diagrams.inference-gateway.com/architecture-overview/

Skipped: sharing one component between this and the homepage diagram - still not worth it for two shapes.

  • branch docs/architecture-diagrams

@edenreich
edenreich merged commit c2d9ffc into main Aug 17, 2026
1 check passed
@edenreich
edenreich deleted the docs/architecture-diagrams branch August 17, 2026 22:29
inference-gateway-releaser Bot added a commit that referenced this pull request Aug 24, 2026
## [0.9.12](0.9.11...0.9.12) (2026-08-24)

### 🐛 Bug Fixes

* auto-generate footer copyright year ([#570](#570)) ([bd7a0ad](bd7a0ad))
* **ci:** install Bun in the preview teardown job ([#567](#567)) ([68aed64](68aed64))
* **ci:** remove preview deployments with the workflow token on close ([527200a](527200a))
* connect app directly to gateway in homepage diagram ([#576](#576)) ([f74823b](f74823b))

### 👷 CI

* move docs deployment and PR previews to Cloudflare Pages ([#566](#566)) ([c369b52](c369b52))
* skip preview environment creation for dependabot PRs ([#583](#583)) ([bd22f31](bd22f31))

### 📚 Documentation

* add animated architecture diagram to homepage hero ([#568](#568)) ([aa85ad4](aa85ad4))
* add computer-use approval and pause/resume IPC ([#579](#579)) ([c4a7d9a](c4a7d9a))
* add quick-start terminal to homepage hero ([#565](#565)) ([d5c55aa](d5c55aa))
* align architecture diagrams with homepage and codebase ([#575](#575)) ([c2d9ffc](c2d9ffc))
* **cli:** update computer use to Computer tool and cgo-free build ([#584](#584)) ([cd670aa](cd670aa))
* de-duplicate provider list on homepage ([#569](#569)) ([a4726ae](a4726ae))
* drop floating window, desktop app for computer use ([#580](#580)) ([85e0a73](85e0a73))
* drop redundant 'How it works' from homepage ([#571](#571)) ([79d203c](79d203c))
* give the homepage a real contribution path ([#573](#573)) ([5ddfc8a](5ddfc8a))
* simplify the homepage ADL section for newcomers ([#572](#572)) ([684a1e2](684a1e2))

### 🔧 Miscellaneous

* **deps-dev:** bump mermaid from 11.16.1 to 11.17.0 in the bun group ([#582](#582)) ([bb85ea9](bb85ea9))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.12 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant