Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Evidentlyai Evidently SDK Models

From Leeroopedia
Revision as of 12:29, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Evidentlyai_Evidently_SDK_Models.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains SDK, Data Models
Last Updated 2026-02-14 12:00 GMT

Overview

Defines core Pydantic data models for the Evidently SDK including project, dashboard, panel, snapshot, and metric configuration models.

Description

The SDK Models module provides the foundational data models used across the Evidently SDK for representing projects, dashboards, panels, metrics, and snapshots. These models are used for API communication with the Evidently workspace and for configuring dashboard visualizations.

Key models:

  • DashboardTabModel -- Represents a tab in a dashboard. Contains an auto-generated id (UUID7), an optional title, and a list of panels (panel IDs) that belong to the tab.
  • PanelMetric -- Configures a metric to display in a dashboard panel. Includes legend text, tags, metadata, a metric identifier string (automatically prefixed with "evidently:metric_v2:" if not already), metric_labels for display customization, and view_params for rendering configuration. The metric_is_alias validator ensures metric identifiers are in the canonical format.
  • DashboardPanelPlot -- Represents a single visualization panel in a dashboard. Contains an auto-generated id, title, optional subtitle and size, a list of PanelMetric values, and plot_params for configuring the visualization type (text, counter, line, bar, pie).
  • DashboardModel -- The complete dashboard configuration containing lists of tabs and panels.
  • ProjectModel -- Represents an Evidently project with id, name, optional description, optional org_id (for cloud workspaces), and a version string (default: "2").
  • SnapshotLink -- Associates a snapshot with a dataset, specifying the snapshot_id, dataset_type (e.g., "reference", "current"), and dataset_subtype (e.g., "production", "training").
  • SnapshotMetadataModel -- Metadata for a snapshot (evaluation run) including id, name, metadata, tags, timestamp, and links to associated datasets.

Usage

Use these models when programmatically creating or reading project configurations, dashboard layouts, and snapshot metadata through the Evidently SDK. The panel and dashboard models are used with the panel factory functions in evidently.sdk.panels to build dashboard configurations.

Code Reference

Source Location

Signature

class DashboardTabModel(BaseModel):
    id: TabID = Field(default_factory=uuid6.uuid7)
    title: Optional[str]
    panels: List[PanelID]

class PanelMetric(BaseModel):
    legend: Optional[str] = None
    tags: List[str] = Field(default_factory=list)
    metadata: Dict[str, str] = Field(default_factory=dict)
    metric: str  # auto-prefixed with "evidently:metric_v2:"
    metric_labels: Dict[str, str] = Field(default_factory=dict)
    view_params: Dict[str, Any] = Field(default_factory=dict)

class DashboardPanelPlot(BaseModel):
    id: PanelID = Field(default_factory=uuid6.uuid7)
    title: str
    subtitle: Optional[str]
    size: Optional[str]
    values: List[PanelMetric]
    plot_params: Dict[str, Any] = Field(default_factory=dict)

class DashboardModel(BaseModel):
    tabs: List[DashboardTabModel]
    panels: List[DashboardPanelPlot]

class ProjectModel(BaseModel):
    id: ProjectID = Field(default_factory=new_id)
    name: str
    description: Optional[str] = None
    org_id: Optional[OrgID] = None
    version: str = "2"

class SnapshotLink(BaseModel):
    snapshot_id: SnapshotID
    dataset_type: str
    dataset_subtype: str

class SnapshotMetadataModel(BaseModel):
    id: SnapshotID
    name: Optional[str]
    metadata: Dict[str, str]
    tags: List[str]
    timestamp: datetime
    links: SnapshotLinks

Import

from evidently.sdk.models import (
    DashboardTabModel,
    PanelMetric,
    DashboardPanelPlot,
    DashboardModel,
    ProjectModel,
    SnapshotLink,
    SnapshotMetadataModel,
)

I/O Contract

Inputs

Name Type Required Description
title str Yes (for DashboardPanelPlot, DashboardTabModel) Title of the panel or tab
name str Yes (for ProjectModel) Name of the project
metric str Yes (for PanelMetric) Metric identifier; auto-prefixed with "evidently:metric_v2:" if not already present
values List[PanelMetric] Yes (for DashboardPanelPlot) List of metrics to display in the panel
snapshot_id SnapshotID Yes (for SnapshotLink) ID of the snapshot to link
dataset_type str Yes (for SnapshotLink) Type of dataset (e.g., "reference", "current")
dataset_subtype str Yes (for SnapshotLink) Subtype of dataset (e.g., "production", "training")

Outputs

Name Type Description
DashboardTabModel BaseModel A tab configuration with auto-generated ID
PanelMetric BaseModel A validated metric configuration with canonical metric identifier
DashboardPanelPlot BaseModel A panel configuration with auto-generated ID
ProjectModel BaseModel A project model with auto-generated ID
SnapshotMetadataModel BaseModel Snapshot metadata with timestamp and dataset links

Usage Examples

from evidently.sdk.models import (
    ProjectModel,
    DashboardModel,
    DashboardTabModel,
    DashboardPanelPlot,
    PanelMetric,
    SnapshotLink,
)

# Create a project model
project = ProjectModel(name="My ML Project", description="Production monitoring")

# Create a panel metric (auto-prefixed)
metric = PanelMetric(
    metric="ColumnSummary",  # becomes "evidently:metric_v2:ColumnSummary"
    legend="Mean Value",
    metric_labels={"column": "prediction"},
)

# Create a panel
panel = DashboardPanelPlot(
    title="Prediction Distribution",
    subtitle="Over time",
    size="full",
    values=[metric],
    plot_params={"plot_type": "line"},
)

# Create a dashboard
dashboard = DashboardModel(
    tabs=[DashboardTabModel(title="Overview", panels=[panel.id])],
    panels=[panel],
)

# Create a snapshot link
link = SnapshotLink(
    snapshot_id="snapshot-uuid",
    dataset_type="current",
    dataset_subtype="production",
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment