[FR] Render trace image attachments in custom trace views
[!WARNING] Before submitting a PR, please make sure that:
- A maintainer has triaged this issue and applied the
readylabel- This issue has no assignee
- No duplicate PR exists
PRs not meeting these requirements may be automatically closed.
Willingness to contribute
Yes. I can contribute this feature independently.
Proposal Summary
Add a custom-trace-view primitive that renders image attachments from the current MLflow trace (for example original vs generated images) by binding to stable span fields instead of pasting a per-trace attachment URI.
Motivation
What is the use case for this feature?
GenAI image models log the source image and generated image as trace attachments, then score the result with LLM-as-a-judge. Users need a custom trace view that shows those images side by side, plus the judge scores, for every trace in an experiment.
Why is this use case valuable to support for MLflow users in general?
Custom views already support text, markdown, key-value, and assessments, but not images.
Image-generation and multimodal traces are common in GenAI, and the existing attachment renderer already knows how to display mlflow-attachment:// images in the default explorer. Custom views should reuse that.
Why is this use case valuable to support for your project(s) or organization?
Users evaluating image-generation pipelines need to inspect the source image, generated result, and evaluation scores together. Without image support in custom trace views, they must stick to the default view but with noisy information that they do not need for their evaluation. Showing these artifacts together in an environment adjusted to their scope makes it easier to understand failures, compare results consistently, and decide what to improve.
Why is it currently difficult to achieve this use case?
Custom-view A2UI catalog components cannot bind to and render image attachments. Pasting a concrete mlflow-attachment:// URI from one sample trace is wrong because it is unique to that trace. The assistant also has no documented component for images, so generated views omit them. We would only see the base 64 version of the image.
Details
Proposed UI primitive: TraceImage.
Props:
uri: spanField binding that resolves to anmlflow-attachment://URItitle(optional)weight(optional)
Suggested bindings for this pipeline:
- Original image:
{ "$source": "spanField", "spanRef": "root", "field": "inputs", "path": ["identity_image"] } - Generated image:
{ "$source": "spanField", "spanRef": { "name": "instantid_generate" }, "field": "outputs", "path": ["image"] }
Implementation sketch:
- Register
TraceImagein both custom-view catalogs (v1 and v2) - Parse the URI with the existing attachment parser
- Reuse
ModelTraceExplorerAttachmentRendererfor actual image display - Allowlist the component in A2UI validation
- Teach the custom-view assistant in
buildAgentPrompt.ts - Fallback copy: "Image unavailable" when the binding is missing or not
image/*
Local prototype exists in this checkout (uncommitted):
mlflow/server/js/src/shared/web-shared/model-trace-explorer/custom-view/catalog-primitives/TraceImage.tsx- catalog, validator, and prompt updates
- tests in
validateA2uiMessages.test.ts,buildAgentPrompt.test.ts,resolveTemplate.test.ts
What machine learning domain(s) is this feature request about?
-
domain/genai: LLMs, Agents, and other GenAI-related use cases -
domain/classical-ml: Traditional machine learning, such as linear regression. -
domain/deep-learning: Deep learning and neural networks. -
domain/platform: MLflow platform foundation, not specific to a particular machine learning domain.
What area(s) of MLflow is this feature request about?
-
area/tracking: Tracking Service, tracking client APIs, autologging -
area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry -
area/scoring: MLflow model serving, deployment tools, Spark UDFs -
area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows -
area/prompt: MLflow prompt engineering features, prompt templates, and prompt management -
area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality -
area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations -
area/projects: MLproject format, project running backends -
area/uiux: Front-end, user experience, plotting -
area/docs: MLflow documentation pages
Source: mlflow/mlflow