BuiltInMetrics
Provides convenient access to built-in Galileo metrics (formerly “scorers”). ExamplesMetric
Base class for all Galileo metrics. This is an abstract base class that defines common attributes and methods for all metric types. Use one of the concrete metric classes instead:- GalileoMetric: Built-in Galileo scorers (access via Metric.scorers)
- LlmMetric: Custom LLM-based metrics with prompt templates
- LocalMetric: Local function-based metrics
- CodeMetric: Code-based metrics (future support)
Common Attributes
id (str | None): The unique metric identifier (UUID). name (str): The metric name. scorer_type (ScorerTypes | None): The type of scorer. description (str): Description of the metric. tags (list[str]): Tags associated with the metric. created_at (datetime | None): When the metric was created. updated_at (datetime | None): When the metric was last updated. version (int | None): Metric version number.Class Attributes
metrics (BuiltInMetrics): Access built-in Galileo metrics. Examplesdelete
delete_by_name
Metric.get(name=...).delete()
when you only need to delete and don’t need the metric object.
Arguments
name: The name of the metric to delete.
get
id: The metric ID (UUID).name: The metric name.
list
name_filter: Filter metrics by exact name match.scorer_types: Filter by scorer types.
refresh
to_legacy_metric
update
name, description, and tags can be updated via this method.
On success the instance is updated with the API response and returned in SYNCED state.
Arguments
**kwargs(Any): Fields to update. Supported keys:name,description,tags.
LlmMetric
LLM-based metric with custom prompt templates. This metric type allows you to create custom metrics evaluated by an LLM judge using a prompt template. Arguments-
Configuration: -
-------------: Default values formodelandjudgescan be configured via:- Configuration.default_scorer_model (env: GALILEO_DEFAULT_SCORER_MODEL)
- Configuration.default_scorer_judges (env: GALILEO_DEFAULT_SCORER_JUDGES)
create
CodeMetric
Code-based metric. This metric type is for code-based scorers that execute custom code to evaluate traces/spans. Examplescreate
load_code
code_file_path: Path to the Python file containing the scorer code.
GalileoMetric
Built-in Galileo scorer metric. This metric type represents Galileo’s built-in scorers like correctness, completeness, toxicity, etc. Access these viaMetric.metrics.
Examples