Skip to content

docs(compute-mesh): add architecture diagram and execution flow documentation for local_compute_mesh_demo#1087

Closed
Avi-47 wants to merge 1 commit intomofa-org:mainfrom
Avi-47:docs/compute-mesh-architecture-demo
Closed

docs(compute-mesh): add architecture diagram and execution flow documentation for local_compute_mesh_demo#1087
Avi-47 wants to merge 1 commit intomofa-org:mainfrom
Avi-47:docs/compute-mesh-architecture-demo

Conversation

@Avi-47
Copy link
Copy Markdown
Contributor

@Avi-47 Avi-47 commented Mar 9, 2026

Summary

Added comprehensive architecture diagrams and execution flow documentation to the local_compute_mesh_demo. This documentation provides visual and textual explanations of how the compute mesh pipeline works, making it easier for developers to understand and use the demo.

Motivation

Issue #1085 requested adding interactive architecture diagrams and execution visualization documentation for the local_compute_mesh_demo. Without proper documentation, users may struggle to understand:

  • How data flows through the compute mesh system
  • What each component does during execution
  • How routing policies determine backend selection
  • What trace events are generated and when

This PR addresses these gaps by providing clear, visual documentation.

Changes Made

1. Compute Mesh Architecture Diagram

Created a detailed ASCII diagram showing the complete pipeline:

User Prompt → Workflow Engine → Inference Router → Local/Cloud Backend → Streaming Tokens → Performance Metrics → Execution Trace → Final Response

2. Execution Lifecycle Explanation

Documented all 7 stages with a comprehensive table:

Stage Component Description Log Event
1 Workflow Engine Initializes request processing workflow.start
2 Inference Router Evaluates routing policy router.policy
3 Inference Router Selects backend router.backend_selection
4 Inference Engine Starts inference inference.start
5 Token Stream Streams response tokens streaming.tokens
6 Metrics Collects performance data metrics.latency_ms
7 Workflow Engine Completes request workflow.complete

Each stage includes details on what component runs, what it does, and what log appears in the demo.

3. Routing Policy Explanation

Explained three routing policies:

  • LocalFirstWithCloudFallback: Attempts local inference first, falls back to cloud if local fails. Use case: Balance of speed and reliability.

  • LocalOnly: Uses only local inference backend. Use case: Offline mode, privacy-sensitive applications.

  • CloudOnly: Uses only cloud inference backend. Use case: Maximum model capacity, always-online scenarios.

Also included a backend selection logic flow diagram.

4. Execution Walkthrough

Added a step-by-step example using real logs from the demo, showing:

  • Console output
  • Execution trace events
  • JSON trace export example

5. ASCII Pipeline Visualization

Added a comprehensive visual representation of the entire pipeline.

Testing

  • Verified only documentation file was modified (no code changes)
  • Branch created cleanly from upstream/main
  • All formatting validated

Additional Notes

  • This is a documentation-only change
  • No modifications to core framework code
  • PR is focused and small for easy review

References

@Avi-47
Copy link
Copy Markdown
Contributor Author

Avi-47 commented Mar 15, 2026

The documentation from this PR has been incorporated into a consolidated compute mesh demo PR #1248 that includes:

  • architecture diagrams
  • execution trace visualization
  • latency benchmarking

Combining them into one PR keeps the demo easier to review and shows the complete compute mesh pipeline in a single example.

Closing this PR in favor of the consolidated version.
All documentation from this PR is preserved there.

Thanks!

@Avi-47 Avi-47 closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant