Skip to content

Write results back to Langfuse

Metergraph only reads from Langfuse unless you turn on write-back for one Langfuse connection. With write-back on, Metergraph adds its model-swap results to that Langfuse project, so you can see next to each generation whether a cheaper candidate model matched it, and filter traces by that verdict. It is off until an admin sets it up, and it uses a key pair you make for this purpose only.

Write-back is available for the hosted Langfuse connector. The relay and dual export hold no Langfuse key in Metergraph, so they cannot write back.

Three kinds of object, and nothing else.

One score config, created once per project and reused after that:

Field Value
Name metergraph.candidate_case
Type Categorical: pass (1), fail (0)
Description Whether a candidate model Metergraph tested matched this generation. Written by Metergraph write-back.

One score per replayed generation and candidate model. When an analysis replays a generation this connection imported (or a Langfuse dataset item with a source trace in this project) on a candidate model, the generation gets a metergraph.candidate_case score:

Field Value
Value pass or fail. A case whose result is incomplete gets no score.
Trace and observation The generation Metergraph replayed
Environment The generation’s own Langfuse environment
Comment <candidate model>: <verdict>. Open in Metergraph: <link>
Metadata {"metergraph": {"v": 1, "candidate_model", "evaluation_id", "analysis_id", "workload_id", "link"}}

Every candidate shares the one score name; the candidate is in the comment and the metadata. When a later analysis tests the same generation and candidate again, Metergraph replaces the score rather than adding a second one. When a later analysis of the same workload no longer includes a generation or a candidate, Metergraph removes its earlier score, so a trace only ever shows Metergraph’s latest verdict.

One comment on a prompt version, when the replayed calls carry a Langfuse prompt (the langfuse.prompt.name and langfuse.prompt.version tags) and the analysis made a recommendation:

Metergraph tested 2 cheaper models on this prompt’s traffic (40 cases, 2026-12-01). Recommendation: recommended for openai/gpt-4.1-mini. Open the recommendation in Metergraph (a link to the analysis)

Metergraph adds a new comment only when the recommendation for that prompt version changes.

  • Prompts, responses, tool calls or any other captured content, whether or not the connection imports content.
  • Judge rationales or the reasoning behind a recommendation.
  • Workload names, tag values, metadata values, cost or savings figures.
  • Traces, observations, datasets, dataset runs, experiments, prompts, evaluation rules, LLM connections or model definitions.

Metergraph never changes or deletes your own scores, and never uses the key to call a model.

Links in scores and comments open Metergraph, and need a Metergraph login.

  1. In Langfuse, open the project this connection imports and create a new API key, for example named “Metergraph write-back”. Use a new key, not the one the connection imports with.

  2. In Metergraph, open Imports, and on the Langfuse connection’s row choose Write results to Langfuse, then Set up.

  3. Read what will be added, paste both halves of the new key, tick I understand Metergraph will add scores and comments to this Langfuse project, and choose Turn on.

    Metergraph checks the key first and stores nothing if a check fails: the key must work, belong to the same Langfuse project as the import key, not be the import key, and the server must serve Langfuse’s score config API. Metergraph records who turned it on and when.

  4. Results arrive from the next analysis. To write the latest results you already have, choose Send latest results.

Write-back runs with the connection’s scheduled import, a few minutes after an analysis finishes. While the import is paused, no new results are written, but removing scores you asked to remove still goes ahead.

Turn off on the same panel stops writes at once and offers two choices:

  • Keep what Metergraph wrote. The key is deleted from Metergraph now.
  • Remove the scores Metergraph wrote. Metergraph deletes every score it recorded writing, over the next import runs, then deletes the key.

Langfuse does not let an API key delete comments, so prompt comments stay. The activity list on the panel shows each one, so you can delete them in Langfuse.

You can also delete the key in Langfuse. Metergraph stops writing on its next attempt and the panel says that Langfuse rejected the key. Removing scores after that needs a working key again.

Pause stops writes without removing anything. If you archive the metergraph.candidate_case score config in Langfuse, Metergraph pauses write-back for that connection and says why.

Anyone with your project’s public key can write a score with any name. A metergraph.candidate_case score was written by Metergraph only if it carries the metergraph.v marker in its metadata and appears in the connection’s activity list. Metergraph never imports metergraph.* scores back, genuine or not, so they cannot influence a Metergraph decision or a judge calibration.