Skip to content

platform stack : web studio ui, dual track observability, python sdk, and s1-s7 scenarios - #18

Open
ashum9 wants to merge 84 commits into
mainfrom
platform
Open

ashum9 wants to merge 84 commits into
mainfrom
platform

Conversation

@ashum9

@ashum9 ashum9 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Overview

Integrates the complete MoFA Platform Stack into main. This PR connects the core Rust engine with the React Web Studio UI, dual-track Prometheus/Grafana observability, the Python SDK & MCP server, automated quickstart tooling, and all 7 flagship multimodal scenarios.


Visual Previews

Web Studio & Waveform Player Dual-Track Grafana Observability
Web Studio Grafana

What’s Included

  • Quickstart & Zero-Config Setup (quickstart.sh)
    • Automated hardware detection, dependency installer, and service orchestrator.
    • Interactive CLI commands: setup, keys (cloud wizard), doctor (diagnostic suite), demo (30s golden path), and s1..s7 launchers.
Quickstart CLI & Doctor
  • Web Studio Frontend (mofa-frontend/)

    • Real-time animated pipeline visualizer with live SSE streaming.
    • WaveSurfer audio player with hover scrubbing, zoom, and instant download.
    • Collapsible Deep-Thinking Thought Chain viewer for reasoning models.
    • 3-scene visual storyboard grid and HTML5 explainer video player.
  • Dual-Track Observability (mofa-observability/)

    • Real-time GPU cost ($0.00) vs. Cloud token spend tracking with Prometheus exposition (GET /metrics).
    • 4 pre-configured Grafana dashboards (Overview, Memory, Preflight Routing, and Cost Tracking).
Financial Cost & Cloud Billing Preflight & Routing Accuracy
Financial Cost & Billing Preflight & Routing
Dual-Track Hardware vs. Cloud Telemetry
Dual-Track Telemetry
  • Python SDK & MCP Tooling (mofa-fm/)

    • Fluent, type-safe Python client (from mofa_sdk import MofaEngine) supporting sync/async & streaming.
    • Production Model Context Protocol (MCP) server for IDE and agent integration.
  • 7 Flagship Multimodal Scenarios (examples/)

    • S1: Meeting Audio $\rightarrow$ Structured Minutes + Spoken Audio Brief
    • S2: Git Diff $\rightarrow$ Deep-Thinking Code Review with Reasoning Trace
    • S3: Receipt / Invoice Image $\rightarrow$ VLM Structured JSON Extraction
    • S4: Topic $\rightarrow$ Script $\rightarrow$ AI Slides $\rightarrow$ Voiceover $\rightarrow$ FFmpeg 1080p MP4 Video
    • S5: Air-Gapped Confidential Data Flow Privacy Audit ($0.00 egress)
    • S6: Article $\rightarrow$ Multi-Speaker Dialogue $\rightarrow$ 24kHz Neural Podcast
    • S7: Real-Time Local (Ollama) vs. Cloud (Gemini) Provider Race Benchmark

Verification & Quality Gate

Target Status Notes
Rust Workspace PASS cargo check --workspace (0.51s, 0 errors across all 9 crates)
Frontend Production Build PASS npm run build completed with 0 TypeScript/lint errors
Golden Path Demo PASS Chat + TTS + ASR verified under 15s locally
Scenarios S1–S7 PASS End-to-end execution verified (Local & Cloud Burst)
Upstream Sync PASS 0 merge conflicts against origin/main (PR #4 included)

ashum9 added 30 commits July 6, 2026 11:40
ashum9 added 21 commits August 9, 2026 16:00
Copilot AI lite review requested due to automatic review settings August 28, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates the full MoFA “platform stack” into main, spanning engine-level observability/config updates, a new React Web Studio UI, dockerized Prometheus/Grafana dashboards, and expanded Python/CLI examples + docs to support scenarios S1–S7.

Changes:

  • Adds mofa-observability (crate + dashboards + docker) and wires new observability/preflight events into the engine.
  • Introduces a new React/Vite frontend (mofa-frontend/) with Studio/Artifacts/Observability views and SSE-driven monitoring UI.
  • Expands quickstart/docs/examples and updates engine routing/config/backends to support “local vs cloud” dual-track behavior.

Reviewed changes

Copilot reviewed 143 out of 164 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test_obs_config.toml Adds a small test config enabling observability with a mock provider.
start_mofa.sh Adds a stack launcher script for observability + local services + engine.
QUICKSTART.md Adds an end-to-end quickstart guide covering stack + scenarios.
mofa-observability/src/lib.rs Exposes observability modules as a crate.
mofa-observability/docker/prometheus/prometheus.yml Adds Prometheus scrape configuration for engine + mock harness.
mofa-observability/docker/grafana/provisioning/datasources/prometheus.yml Provisions Prometheus datasource for Grafana.
mofa-observability/docker/grafana/provisioning/dashboards/dashboards.yml Provisions dashboard folder/path mapping.
mofa-observability/docker/Dockerfile Builds and packages the mock_harness example binary.
mofa-observability/docker/docker-compose.yml Adds Grafana + Prometheus compose setup for local observability.
mofa-observability/dashboards/preflight_routing.json Adds a Grafana dashboard for preflight/routing metrics.
mofa-observability/dashboards/memory_lifecycle.json Adds a Grafana dashboard for memory + lifecycle metrics.
mofa-observability/dashboards/engine_overview.json Adds a Grafana dashboard for overall engine metrics.
mofa-observability/dashboards/dual_track_cost.json Adds a Grafana dashboard for dual-track cost/token metrics.
mofa-observability/Cargo.toml Defines the new observability crate dependencies.
mofa-kernel/src/types.rs Adds Message::{user,system,assistant} helpers and defines SSE event schema.
mofa-frontend/vite.config.ts Adds Vite config with aliasing + /v1 proxy to engine.
mofa-frontend/tsconfig.json Adds strict TS config + path mapping.
mofa-frontend/src/vite-env.d.ts Adds Vite client type reference.
mofa-frontend/src/studio/useElapsed.ts Adds a hook for elapsed-time UI.
mofa-frontend/src/studio/theater/TheaterView.tsx Adds Theater view UI for pipeline status + events + script.
mofa-frontend/src/studio/Studio.tsx Adds view switching and history persistence when runs complete.
mofa-frontend/src/studio/result/ThoughtChainView.tsx Adds a collapsible reasoning/thought-chain UI.
mofa-frontend/src/studio/gallery/ArtifactPreview.tsx Adds artifact preview modal for audio/video/report/data.
mofa-frontend/src/studio/gallery/ArtifactCard.tsx Adds artifact list card component.
mofa-frontend/src/studio/compose/OnboardingBanner.tsx Adds dismissible onboarding banner persisted in localStorage.
mofa-frontend/src/storage/useSettings.ts Adds local settings state + persistence.
mofa-frontend/src/storage/useHistory.ts Adds local run history + draft persistence hooks.
mofa-frontend/src/storage/HistoryDrawer.tsx Adds a history drawer UI that loads prior phases.
mofa-frontend/src/shell/TopBar.tsx Adds top navigation and settings/history controls.
mofa-frontend/src/shared/StatusDot.tsx Adds status dot component with animated pulse states.
mofa-frontend/src/shared/Sparkline.tsx Adds lightweight SVG sparkline component.
mofa-frontend/src/shared/Skeleton.tsx Adds skeleton loading component.
mofa-frontend/src/shared/DeltaIndicator.tsx Adds a small delta indicator component.
mofa-frontend/src/shared/Card.tsx Adds a motion-enabled Card wrapper.
mofa-frontend/src/shared/Button.tsx Adds a motion-enabled Button wrapper.
mofa-frontend/src/shared/Badge.tsx Adds capability-aware badge styling.
mofa-frontend/src/shared/AreaChart.tsx Adds a simple SVG area chart with gradient fill.
mofa-frontend/src/shared/AnimatedNumber.tsx Adds number animation via Framer Motion spring.
mofa-frontend/src/observability/TelemetryTicker.tsx Adds a routing telemetry ticker driven by SSE events.
mofa-frontend/src/observability/SessionCharts.tsx Adds session charts for local velocity/cost/memory.
mofa-frontend/src/observability/RoutingDecisionLog.tsx Adds live routing decision log UI from SSE.
mofa-frontend/src/observability/ModelEfficiencyTable.tsx Adds a model registry/efficiency table UI.
mofa-frontend/src/observability/MetricsStrip.tsx Adds top-level metrics strip (requests/latency/models/memory/savings).
mofa-frontend/src/observability/ActivityFeed.tsx Adds a buffered activity feed UI.
mofa-frontend/src/monitor/ProviderHealth.tsx Adds provider health widget based on engine status.
mofa-frontend/src/monitor/PreflightIndicator.tsx Adds preflight warming/eviction indicator using SSE + status fetch.
mofa-frontend/src/monitor/MonitorSidebar.tsx Adds right-hand monitoring sidebar composition.
mofa-frontend/src/monitor/ModelGrid.tsx Adds active model grid driven by capabilities + SSE refresh.
mofa-frontend/src/monitor/MemoryGauge.tsx Adds memory gauge driven by status + MemoryChanged SSE.
mofa-frontend/src/monitor/CostTokenDashboard.tsx Adds simple token/cache ratio widget from RequestCompleted SSE.
mofa-frontend/src/main.tsx Boots React app with React Query provider.
mofa-frontend/src/lib/utils.ts Adds cn() and formatMs() helpers.
mofa-frontend/src/lib/motion.ts Adds shared motion variants.
mofa-frontend/src/lib/audio.ts Adds completion chime sound.
mofa-frontend/src/index.css Adds Tailwind v4 + design tokens + scrollbar styling.
mofa-frontend/src/errors/InlineError.tsx Adds inline error component with retry/copy and auto-recover timer.
mofa-frontend/src/errors/errorCatalog.ts Adds error descriptor mapping for common engine failures.
mofa-frontend/src/errors/EngineOffline.tsx Adds full-screen offline overlay with copyable start command.
mofa-frontend/src/engine/useEngineStatus.ts Adds status polling hook conditioned on connection state.
mofa-frontend/src/engine/useEngineConnection.ts Adds health polling + connection state hook.
mofa-frontend/src/engine/types.ts Adds frontend engine contract types.
mofa-frontend/src/engine/index.ts Adds engine client singleton + base URL persistence + hooks.
mofa-frontend/src/App.tsx Adds main app shell with navigation, views, overlays, and error boundary.
mofa-frontend/replace-colors.mjs Adds a script to mass-replace color utilities for dark mode.
mofa-frontend/README.md Adds frontend readme (features/quick start/mock mode).
mofa-frontend/public/favicon.svg Adds a new SVG favicon.
mofa-frontend/postcss.config.mjs Adds Tailwind v4 PostCSS plugin wiring.
mofa-frontend/package.json Adds frontend dependencies/scripts/tooling.
mofa-frontend/index.html Adds Vite HTML entrypoint.
mofa-frontend/eslint.config.js Adds ESLint config for TS/React hooks/refresh.
mofa-frontend/Dockerfile Adds multi-stage build for static nginx deployment.
mofa-frontend/.gitignore Adds frontend ignores.
mofa-fm/setup.py Adds setuptools packaging for the Python SDK module.
mofa-fm/pyproject.toml Adds PEP 621 packaging metadata + console script entrypoint.
mofa-fm/mcp_config.json Adds MCP server config + setup snippets for clients.
mofa-fm/gemini_tts.py Adds Gemini native audio TTS adapter producing WAV.
mofa-fm/assemble_video.py Adds FFmpeg-based image+audio→MP4 assembler.
mofa-fm/article_to_podcast.py Refactors S6 into a declarative Pipeline-based example.
mofa-engine-sdk/src/lib.rs Exposes new observability_bridge module.
mofa-engine-sdk/src/client.rs Updates test config defaults to include observability.
mofa-engine-sdk/Cargo.toml Adds dependency on mofa-observability.
mofa-engine-core/src/router.rs Adjusts local-vs-cloud filtering using residency signal.
mofa-engine-core/src/engine.rs Updates discovery/memory accounting and emits new preflight events.
mofa-engine-core/src/config.rs Adds observability config section; relaxes api_key validation for openai_compatible.
mofa-engine-core/src/backends/openai_compat.rs Infers “local” residency for localhost endpoints; updates lifecycle outputs.
mofa-engine-core/src/backends/liter_llm.rs Adds a longer client timeout for LiteLLM provider config.
mofa-engine-app/Cargo.toml Adds observability + OpenTelemetry-related dependencies.
examples/samples/sample_transcript.txt Adds a sample meeting transcript input.
examples/samples/sample_diff.patch Adds a sample diff for code review scenario.
examples/samples/sample_article.txt Adds a sample article input for podcast scenario.
examples/provider_race.py Adds S7 provider benchmark script variant.
examples/doc_ai.py Adds S3 VLM extraction example.
examples/code_review.py Adds S2 code review + reasoning stream example.
examples/01_provider_race.py Adds S7 provider race script (duplicated name variant).
docs/why-mofa.md Adds “why MoFA” positioning + architecture documentation.
docs/scenario_guides/S7_provider_race.md Adds S7 scenario guide and acceptance criteria.
docs/scenario_guides/S6_podcast_matrix.md Adds S6 scenario guide and runbook.
docs/scenario_guides/S5_privacy_moat.md Adds S5 privacy moat guide and verification steps.
docs/scenario_guides/S4_explainer_video.md Adds S4 explainer video scenario guide.
docs/scenario_guides/S3_document_ai.md Adds S3 document AI scenario guide.
docs/scenario_guides/S2_code_review.md Adds S2 code review scenario guide.
docs/model_catalog.md Adds model catalog and pricing table documentation.
docs/contracts/inference_request_schema.json Adds a JSON-schema contract for inference request payloads.
docs/contracts/engine_event_schema.json Adds a JSON-schema contract for SSE engine events.
docs/contracts/design_doc.md Adds contract governance and verification design doc.
Dockerfile Adds a multi-stage Dockerfile for building the engine gateway.
docker-compose.yml Adds top-level compose for ollama + engine + frontend.
Cargo.toml Adds workspace member and OpenTelemetry deps; enables axum multipart.
.gitignore Expands ignores for local venvs/artifacts/output and configs.
.env.example Replaces env example with multi-provider key template.
.dockerignore Adds basic dockerignore entries for build context.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +98 to +100
{[...Array(6)].map((_, i) => (
<div key={i} className={`h-4 bg-background-hover rounded animate-pulse w-${['3/4', 'full', '5/6', 'full', '2/3', '1/2'][i]}`} />
))}
Comment thread mofa-engine-core/src/engine.rs Outdated
Comment on lines +506 to +509
if matches!(card.residency, ModelResidency::Loaded) && card.memory_estimate_bytes > 0 {
self.memory.try_reserve(&card.id, card.memory_estimate_bytes);
self.memory.touch(&card.id);
}
if freed {
self.emit_memory_changed();
}
self.emit_memory_changed();
Comment thread mofa-observability/docker/docker-compose.yml
Comment thread mofa-observability/docker/docker-compose.yml
Comment thread docs/model_catalog.md Outdated
Comment thread docs/scenario_guides/S7_provider_race.md Outdated
Comment thread start_mofa.sh Outdated
Comment on lines +15 to +16
cd "$ENGINE_DIR/mofa-observability/docker"
docker-compose up -d
@aayank13
aayank13 requested review from BH3GEI and aayank13 August 28, 2026 17:56
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.

2 participants