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 Legacy UI Base

From Leeroopedia
Knowledge Sources
Domains UI, Workspace, Storage, Projects
Last Updated 2026-02-14 12:00 GMT

Overview

Defines the legacy UI workspace layer including the Project entity, snapshot metadata management, and abstract storage interfaces for project metadata, blob data, and extracted data points.

Description

The legacy UI base module provides the foundational data models and abstract storage contracts used by the legacy Evidently workspace system for managing projects and their snapshots.

SnapshotMetadata: A lightweight metadata wrapper around snapshots that avoids loading the full snapshot data. It holds the snapshot ID, timestamp, tags, metadata, and a reference to its blob storage location. It supports lazy loading of dashboard info and additional graphs via its get_dashboard_info() and get_additional_graphs() async methods. Each SnapshotMetadata instance is bound to a Project through the bind() method.

BlobMetadata: A simple model tracking a blob's ID and optional size, used to reference stored snapshot blobs.

Project: The central entity for organizing monitoring work. A project has a name, description, dashboard configuration, team/org associations, and date range filters. It provides both async and sync APIs (using sync_api wrapper) for snapshot management (add, list, delete, load), dashboard building, and project persistence. Projects are bound to a ProjectManager and a user ID via the bind() method.

ProjectMetadataStorage (ABC): Abstract interface for persisting project metadata and snapshot metadata. Defines operations for adding, getting, deleting, listing, and searching projects, as well as adding/deleting/listing snapshots.

BlobStorage (ABC): Abstract interface for binary blob storage. Provides methods for reading blobs (open_blob), writing blobs (put_blob), and storing snapshots as JSON blobs (put_snapshot).

DataStorage (ABC): Abstract interface for extracted time-series data points. Supports loading metric data points with optional type conversion and loading test result points, both with time range filtering.

The module re-exports key entity types from evidently.ui.service.base including Entity, EntityType, Org, Team, and User.

Usage

This module is used by workspace implementations (local and remote) to manage projects and snapshots. Concrete implementations of ProjectMetadataStorage, BlobStorage, and DataStorage are provided by specific storage backends (filesystem, database, etc.). The Project class is the primary user-facing interface for interacting with monitoring projects in the legacy UI.

Code Reference

Source Location

Signature

class BlobMetadata(BaseModel):
    id: BlobID
    size: Optional[int]

class SnapshotMetadata(BaseModel):
    id: SnapshotID
    name: Optional[str] = None
    timestamp: datetime.datetime
    metadata: Dict[str, MetadataValueType]
    tags: List[str]
    is_report: bool
    blob: BlobMetadata
    links: SnapshotLinks = SnapshotLinks()
    async def load(self) -> Snapshot: ...
    async def as_report_base(self) -> ReportBase: ...
    def bind(self, project: "Project"): ...

class Project(Entity):
    id: ProjectID
    name: str
    description: Optional[str] = None
    dashboard: DashboardConfig
    team_id: Optional[TeamID] = None
    org_id: Optional[OrgID] = None
    def bind(self, project_manager, user_id): ...
    # Sync API methods:
    save = sync_api(save_async)
    load_snapshot = sync_api(load_snapshot_async)
    delete_snapshot = sync_api(delete_snapshot_async)
    list_snapshots = sync_api(list_snapshots_async)
    add_snapshot = sync_api(add_snapshot_async)

class ProjectMetadataStorage(ABC):
    async def add_project(self, project, user, team, org_id) -> Project: ...
    async def get_project(self, project_id) -> Optional[Project]: ...
    async def delete_project(self, project_id): ...
    async def list_projects(self, project_ids) -> List[Project]: ...
    async def add_snapshot(self, project_id, snapshot, blob): ...

class BlobStorage(ABC):
    def open_blob(self, id: BlobID) -> Iterator[IO]: ...
    async def put_blob(self, blob_id, obj): ...
    async def put_snapshot(self, project_id, snapshot) -> BlobMetadata: ...

class DataStorage(ABC):
    async def extract_points(self, project_id, snapshot): ...
    async def load_points(self, project_id, filter, values, ...): ...
    async def load_test_results(self, project_id, filter, ...): ...

Import

from evidently.legacy.ui.base import Project
from evidently.legacy.ui.base import SnapshotMetadata, BlobMetadata
from evidently.legacy.ui.base import ProjectMetadataStorage
from evidently.legacy.ui.base import BlobStorage
from evidently.legacy.ui.base import DataStorage
from evidently.legacy.ui.base import AnySnapshot

I/O Contract

Project

Parameter Type Description
id ProjectID Unique project identifier (auto-generated UUID)
name str Human-readable project name
description Optional[str] Optional project description
dashboard DashboardConfig Dashboard panel configuration
team_id Optional[TeamID] Associated team identifier
org_id Optional[OrgID] Associated organization identifier

SnapshotMetadata

Parameter Type Description
id SnapshotID Unique snapshot identifier
timestamp datetime.datetime When the snapshot was created
metadata Dict[str, MetadataValueType] Key-value metadata pairs
tags List[str] Tags for filtering snapshots
is_report bool Whether this is a report (vs. test suite)
blob BlobMetadata Reference to stored blob data

Usage Examples

from evidently.legacy.ui.base import Project

# Create a project and manage snapshots
project = Project(name="My Monitoring Project")
project.bind(project_manager, user_id)
project.save()

# Add a snapshot to the project
project.add_snapshot(snapshot)

# List snapshots
snapshots = project.list_snapshots(include_reports=True, include_test_suites=True)

# Show dashboard in Jupyter
project.show_dashboard()

Related Pages

Page Connections

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