Skip to content

Implement cost and latency tracking#10

Merged
ArtyomVancyan merged 9 commits intomainfrom
cost-and-latency-tracking
Mar 2, 2026
Merged

Implement cost and latency tracking#10
ArtyomVancyan merged 9 commits intomainfrom
cost-and-latency-tracking

Conversation

@ArtyomVancyan
Copy link
Member

This pull request introduces a new metrics display feature to the node inspector panel in the web UI and refactors how inspection data is passed and rendered. The main changes include adding a dedicated Metrics component for latency, token, and cost metrics, updating the inspector panel to use this component, and cleaning up related props and styles for a more streamlined and visually consistent experience.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds end-to-end latency/token/cost metrics to the node inspector in the web UI by emitting metrics from the Python tracer stream and introducing a dedicated Metrics UI component, while also simplifying how inspector data is passed/rendered.

Changes:

  • Add Formatter.metrics() and include metrics in streamed node_output messages.
  • Add NodeMetrics typing + a new Metrics component and render it in InspectPanel.
  • Add a helper script to (re)generate bundled model metadata (models.json) and remove the langsmith dependency.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/models.py New script to generate/update langgraphics/metadata/models.json from models.dev.
pyproject.toml Removes langsmith from runtime deps.
langgraphics/streamer.py Adds metrics to node_output payloads.
langgraphics/formatter.py Replaces LangSmith utils usage; adds metrics extraction + latency/cost formatting.
langgraphics-web/src/types.ts Adds NodeMetrics and metrics field on node output messages.
langgraphics-web/src/main.tsx Passes nodeEntries into GraphCanvas (inspector now owned there).
langgraphics-web/src/index.css Adds styles for the metrics chips/popovers.
langgraphics-web/src/components/Metrics.tsx New UI component to display latency/tokens/cost.
langgraphics-web/src/components/InspectPanel.tsx Renders Metrics when available; adds colorMode prop.
langgraphics-web/src/components/GraphCanvas.tsx Owns InspectPanel and wires nodeEntries through.
README.md Updates demo image sizing and refreshes the feature comparison table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Mar 2, 2026

@ArtyomVancyan I've opened a new pull request, #11, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Mar 2, 2026

@ArtyomVancyan I've opened a new pull request, #12, to work on those changes. Once the pull request is ready, I'll request review from you.

@ArtyomVancyan ArtyomVancyan merged commit 056b3e0 into main Mar 2, 2026
27 checks passed
@ArtyomVancyan ArtyomVancyan deleted the cost-and-latency-tracking branch March 2, 2026 22:23
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.

3 participants