- Schema (
ModelSchema): Defines the structure and data types of model inputs/outputs - Spec (
ModelSpec): Defines how columns are used (features, targets, predictions, etc.) - Task (
ModelTask): The ML task type (classification, regression, ranking, etc.) - Artifacts (
ModelArtifact): Deployable model code and dependencies - Surrogates (
Surrogate): Simplified models for fast explanations
- Create model with schema/spec (from data or manual definition)
- Upload model artifacts for serving (optional)
- Publish baseline/training data for drift detection
- Publish production data for monitoring
- Set up alerts and monitoring rules
- Tabular Models: Traditional ML models with structured data
- Text Models: NLP models with text inputs and embeddings
- Mixed Models: Models combining tabular and unstructured data
- Ranking Models: Recommendation and search ranking systems
- LLM Models: Large language model monitoring
Parameters
Model name, must be unique within the project version.
Should be descriptive and follow naming conventions.
UUID or string identifier of the parent project.
ModelSchema defining column structure and data types.
Can be created manually or generated from data.ModelSpec defining how columns are used (inputs, outputs, targets).
Specifies the model’s interface and column roles.Optional version identifier for model versioning and A/B testing.
Falls back to ‘v1’ when not specified.
ModelInputType - Type of input data the model processes.- TABULAR: Structured/tabular data (default)
- TEXT: Natural language text data
- MIXED: Combination of structured and unstructured data
ModelTask - Machine learning task type.- BINARY_CLASSIFICATION: Binary classification (0/1, True/False)
- MULTICLASS_CLASSIFICATION: Multi-class classification
- REGRESSION: Continuous value prediction
- RANKING: Ranking/recommendation tasks
- LLM: Large language model tasks
- NOT_SET: Task not specified (default)
ModelTaskParams - Task-specific parameters like classification thresholds,
class weights, or ranking parameters.Human-readable description of the model’s purpose,
training data, or other relevant information.
Column name containing unique identifiers for each
prediction event. Used for event tracking and updates.
Column name containing event timestamps.
Used for time-based analysis and drift detection.
Format string for parsing timestamps in event_ts_col.
Examples: ‘%Y-%m-%d %H:%M:%S’, ‘%Y-%m-%dT%H:%M:%SZ’
XaiParams - Configuration for explainability features like
explanation methods and custom feature definitions.The model exists only locally until .create() is called. Use Model.from_data()
for automatic schema/spec generation from DataFrames or files.
Examples
download_data()
Download production or pre-production event data to a local Parquet or CSV file. Replaces the removedget_slice() and download_slice() methods.
Parameters
Directory where the output file is written. Created if it does
not exist.
Environment to query. One of
EnvType.PRODUCTION or
EnvType.PRE_PRODUCTION.When
env_type=EnvType.PRE_PRODUCTION, the UUID of the dataset
to query. Ignored for PRODUCTION.Start of the query window. PRODUCTION only. Naive datetimes
are interpreted as UTC.
UUID of a saved Segment associated with the model. Mutually
exclusive with
segment_definition.Inline FQL (Fiddler Query Language) segment expression.
The segment is applied transiently and not saved. Mutually exclusive
with
segment_id.Maximum number of rows to return. When omitted, the server
applies a limit of 1,000 rows. Maximum allowed value is 10,000,000.
Column names to include. When omitted, all model columns are
returned.
Row count per download chunk. You can increase this for faster
downloads when querying fewer than 1000 columns and no vector columns.
When
True, vector columns are included in the output.
When omitted or False, vector columns are filtered out.Output file format. One of
DownloadFormat.PARQUET or
DownloadFormat.CSV.Returns
None. Writes a file named
output.parquet (default) or output.csv
(when output_format=DownloadFormat.CSV) into output_dir.Raises
ApiError – If the request fails, the model is a draft model, or no data matches the query.Example
This method is not available for draft models. Caller must have READ
permission on the model’s project.
classmethod get()
Retrieve a model by its unique identifier. Fetches a model from the Fiddler platform using its UUID. This is the most direct way to retrieve a model when you know its ID.Parameters
The unique identifier (UUID) of the model to retrieve.
Can be provided as a UUID object or string representation.
Returns
The model instance with all its configuration and metadata.
Raises
- NotFound – If no model exists with the specified ID.
- ApiError – If there’s an error communicating with the Fiddler API.
Example
This method makes an API call to fetch the latest model state from the server.
The returned model instance reflects the current state in Fiddler.
classmethod from_name()
Retrieve a model by name within a project. Finds and returns a model using its name and project context. This is useful when you know the model name but not its UUID. Supports version-specific retrieval and latest version lookup.Parameters
The name of the model to retrieve. Model names are unique
within a project but may have multiple versions.
UUID or string identifier of the project containing the model.
Specific version name to retrieve. If None, behavior depends
on the ‘latest’ parameter.
If True and version is None, retrieves the most recently created
version. If False, retrieves the first (oldest) version.
Ignored if version is specified.
Returns
The model instance matching the specified criteria.
Raises
- NotFound – If no model exists with the specified name/version in the project.
- ApiError – If there’s an error communicating with the Fiddler API.
Example
When version is None and latest=False, returns the first version created.
This provides consistent behavior for accessing the “original” model version.
create()
Create the model on the Fiddler platform. Persists this model instance to the Fiddler platform, making it available for monitoring, data publishing, and other operations. The model must have a valid schema, spec, and be associated with an existing project.Returns
This model instance, updated with server-assigned fields like
ID, creation timestamp, and other metadata.
Raises
- Conflict – If a model with the same name and version already exists in the project.
- ValidationError – If the model configuration is invalid (e.g., invalid schema, spec, or task parameters).
- ApiError – If there’s an error communicating with the Fiddler API.
Example
After successful creation, the model instance is updated in-place with
server-assigned metadata. The same instance can be used for subsequent
operations without needing to fetch it again.
update()
Update an existing model.add_column()
Add a new column to the model schema. Updates both the schema and spec to include the new column. This allows you to extend your model with additional columns after initial creation. New in version 3.11.0Parameters
Column object defining the new column’s properties (name, data_type, etc.)
Type of column in spec. One of: ‘inputs’, ‘outputs’, ‘targets’,
‘decisions’, ‘metadata’. Defaults to ‘metadata’.
Raises
- ValueError – If column already exists or column_type is invalid
- BadRequest – If column definition is invalid per backend validation
Example
- Adding a column doesn’t populate historical data; new column will be null for past events
- Column names must be unique within the model
- After adding a column, include it in future event publishing
classmethod list()
List models in a project with optional filtering. Retrieves all models or model versions within a project. Returns lightweight ModelCompact objects that can be used to fetch full Model instances when needed.Parameters
UUID or string identifier of the project to search within.
Optional model name filter. If provided, returns all versions
of the specified model. If None, returns all models in the project.
Yields
ModelCompact – Lightweight model objects containing id, name, and version. Call .fetch() on any ModelCompact to get the full Model instance.Returns
Iterator[ModelCompact]
Example
This method returns an iterator for memory efficiency when dealing with
many models. The ModelCompact objects are lightweight and don’t include
full schema/spec information - use .fetch() when you need complete details.
duplicate()
Duplicate the model instance with the given version name. This call will not save the model on server. After making changes to the model instance call .create() to add the model version to Fiddler Platform.Parameters
Version name for the new instance
Returns
Model instance
property datasets
Get all datasets associated with this model. Returns an iterator over all datasets that have been published to this model, including both production data and pre-production datasets used for baselines and drift comparison.Yields
Dataset –
Dataset objects containing metadata and data access methods.
Each dataset represents a collection of events published to the model.
Example
This includes both production event data and named pre-production datasets.
Use the Dataset objects to download data, analyze distributions, or
set up baseline comparisons for drift detection.
property baselines
Get all baselines configured for this model. Returns an iterator over all baseline configurations used for drift detection and performance monitoring. Baselines define reference distributions and metrics for comparison with production data.Yields
Baseline –
Baseline objects containing configuration and reference data.
Each baseline defines how drift and performance should be measured
against historical or reference datasets.
Example
Baselines are essential for drift detection and alerting. They define
the “normal” behavior against which production data is compared.
Static baselines use fixed reference data, while rolling baselines
update automatically with recent data.
property deployment
Fetch model deployment instance of this model.Returns
The deployment configuration for this model.
classmethod from_data()
Create a Model instance with automatic schema generation from data. This is the most convenient way to create models when you have training data or representative samples. The method automatically analyzes the data to generate appropriate schema (column types) and spec (column roles) definitions.Parameters
Data source for schema generation. Can be:
- pandas.DataFrame: Direct data analysis
- Path/str: File path (.csv, .parquet, .json supported) The data should be representative of your model’s inputs/outputs.
Model name, must be unique within the project version.
Use descriptive names like “fraud_detector_v1” or “churn_model”.
UUID or string identifier of the parent project.
Optional
ModelSpec defining column roles. If None, automatic
detection attempts to identify inputs, outputs, and targets
based on column names and data patterns.Model version identifier. If None, defaults to “v1”.
Use semantic versioning like “v1.0”, “v2.1”, etc.
ModelInputType - Type of input data the model processes.- TABULAR: Structured/tabular data (default)
- TEXT: Natural language text data
- MIXED: Combination of structured and unstructured data
ModelTask - Machine learning task type:- BINARY_CLASSIFICATION: Binary classification (0/1, True/False)
- MULTICLASS_CLASSIFICATION: Multi-class classification
- REGRESSION: Continuous value prediction
- RANKING: Ranking/recommendation tasks
- LLM: Large language model tasks
- NOT_SET: Task not specified (default)
ModelTaskParams - Task-specific parameters:- binary_classification_threshold: Decision threshold (0.5)
- target_class_order: Class label ordering
- group_by: Column for ranking model grouping
- top_k: Top-k evaluation for ranking
Human-readable description of the model’s purpose,
training approach, or other relevant information.
Column name for unique event identifiers. Used for
tracking individual predictions and enabling updates.
Column name for event timestamps. Used for time-based
analysis, drift detection, and temporal monitoring.
Timestamp format string for parsing event_ts_col.
Examples: ‘%Y-%m-%d %H:%M:%S’, ‘%Y-%m-%dT%H:%M:%SZ’
XaiParams - Explainability configuration including explanation methods
and custom feature definitions.Maximum unique values to consider a column categorical.
Columns with more unique values are treated as continuous.
Default is typically 100-1000 depending on data size.
Number of rows to sample for schema generation. Useful
for large datasets to speed up analysis. If None, uses
entire dataset (up to reasonable limits).
Returns
A new Model instance with automatically generated schema and spec.
The model is not yet created on the platform - call .create() to persist.
Raises
- ValueError – If the data source is invalid or cannot be processed.
- FileNotFoundError – If source is a file path that doesn’t exist.
- ValidationError – If the generated schema/spec is invalid.
Example
The automatic schema generation uses heuristics to detect column types
and roles. Review the generated schema and spec before calling .create()
to ensure they match your model’s actual interface. You can modify the
schema and spec after creation if needed.
delete()
Delete a model and it’s associated resources.Returns
model deletion job instance
remove_column()
Remove a column from the model schema and spec This method is only to modify model object before creating and will not save the model on Fiddler Platform. After making changes to the model instance, call .create() to add the model to Fiddler Platform.Parameters
Column name to be removed
If True, do not raise an error if the column is not found
Returns
None
Raises
KeyError – If the column name is not found and missing_ok is Falsepublish()
Publish data to the model for monitoring and analysis. Uploads prediction events, training data, or reference datasets to Fiddler for monitoring, drift detection, and performance analysis. This is how you send your model’s real-world data to the platform.Parameters
Data to publish. Supported formats:
- File path (str/Path): CSV or Parquet files.
Best for large datasets and batch uploads.
- DataFrame: Pandas DataFrame with prediction events. Good for programmatic uploads and real-time data.
- List of dicts: Individual events as dictionaries. Perfect for streaming/real-time publishing (max 1000 events). Each dict should match the model’s schema.
EnvType - Data environment type:- PRODUCTION: Live production prediction data.
Used for real-time monitoring and alerting.
- PRE_PRODUCTION: Training, validation, or baseline data. Used for drift comparison and model evaluation.
Name for the dataset when using PRE_PRODUCTION environment.
Creates a named dataset for baseline comparisons.
Not used for PRODUCTION data.
Whether these events update previously published data.
Set to True when republishing corrected predictions or
adding ground truth labels to existing events.
Returns
Event IDs when source is list of dicts or DataFrame.
Use these IDs to reference specific events later.
Job: Async job object when source is a file path. Use job.wait() to wait for completion or check job.status.
Raises
- ValidationError – If the data doesn’t match the model’s schema or contains invalid values.
- ApiError – If there’s an error uploading the data to Fiddler.
- ValueError – If the source format is unsupported or parameters are incompatible (e.g., dataset_name with PRODUCTION).
Example
Production data publishing enables real-time monitoring, alerting, and
drift detection. Pre-production data creates reference datasets for
comparison and model evaluation.
publish_stream()
Publish events via streaming for real-time monitoring. Sends events synchronously to Fiddler. Events are written to an in-memory queue and asynchronously persisted.Parameters
List of event dicts matching the model’s schema. Each dict
represents a single prediction event with feature values,
predictions, and optional metadata (event_id, timestamp).
EnvType - Data environment type:- PRODUCTION: Live production prediction data.
- PRE_PRODUCTION: Training, validation, or baseline data.
Name for the dataset when using PRE_PRODUCTION environment.
Not used for PRODUCTION data.
Whether these events update previously published data.
Set to True when adding ground truth labels to existing events.
Returns
Event IDs for the published events. Use these IDs to
reference specific events later.
Raises
- ValidationError – If the data doesn’t match the model’s schema.
- ApiError – If there’s an error publishing the events to Fiddler.
Example
For large datasets, consider using
publish_batch() with a file
path or DataFrame instead. Streaming is best suited for real-time
or near-real-time event publishing.publish_batch()
Publish data via batch upload for monitoring and analysis. Uploads data as a file and kicks off an asynchronous server-side job. Use the returned Job object to track progress. Best suited for large datasets, historical data uploads, and baseline/reference datasets.Parameters
Data to publish. Supported formats:
- File path (str/Path): CSV or Parquet files.
Best for large datasets already on disk.
- DataFrame: Pandas DataFrame with prediction events. Automatically converted to Parquet (falls back to CSV).
EnvType - Data environment type:- PRODUCTION: Live production prediction data.
- PRE_PRODUCTION: Training, validation, or baseline data.
Name for the dataset when using PRE_PRODUCTION environment.
Creates a named dataset for baseline comparisons.
Not used for PRODUCTION data.
Whether these events update previously published data.
Set to True when republishing corrected predictions or
adding ground truth labels to existing events.
Returns
Async job object. Use
job.wait()
to block until completion, or check job.status to poll.Raises
- ValidationError – If the data doesn’t match the model’s schema.
- ApiError – If there’s an error uploading the data to Fiddler.
- ValueError – If the source format is unsupported.
Example
For real-time or near-real-time event publishing, consider using
publish_stream() instead.add_artifact()
Upload and deploy model artifact.Parameters
Path to model artifact tar file
Model deployment parameters
Returns
Async job instance
update_artifact()
Update existing model artifact.Parameters
Path to model artifact tar file
Model deployment parameters
Returns
Async job instance
download_artifact()
Download existing model artifact.Parameters
Path to download model artifact tar file
add_surrogate()
Add a new surrogate modelParameters
Dataset to be used for generating surrogate model
Model deployment parameters
Returns
Async job
update_surrogate()
Update an existing surrogate modelParameters
Dataset to be used for generating surrogate model
Model deployment parameters
Returns
Async job