Model registry
Models
DearDiary.get_model — Function
get_model(id::Integer)::Optional{Model}Get a Model by id.
Arguments
id::Integer: The id of the model to query.
Returns
A Model object. If the record does not exist, return nothing.
get_model(client::Client, id::Integer)::Optional{Model}Fetch a Model via GET /model/{id}. Returns nothing when the server replies 404 (record missing or viewer lacks ReadPermission on the owning project) and raises ClientError for other failures.
DearDiary.get_models — Function
get_models(project_id::Integer)::Array{Model, 1}Get all Model records registered under a given project.
Arguments
project_id::Integer: The id of the project to query.
Returns
An array of Model objects.
get_models(project_id::Integer, page::Pagination)::PaginatedResponse{Model}Get a page of Model records for a project, with total count populated.
Arguments
project_id::Integer: The id of the project to query.page::Pagination: The page bounds (limit + offset).
Returns
A PaginatedResponse of Model.
get_models(client::Client, project_id::Integer)::Array{Model,1}Returns the first page (default limit) of Model records under project_id, discarding the pagination envelope.
get_models(client::Client, project_id::Integer, page::Pagination)::PaginatedResponse{Model}Fetch a page of Model records under project_id via GET /model/project/{project_id}?limit=…&offset=…. Requires ReadPermission on the project.
DearDiary.create_model — Function
create_model(project_id::Integer, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}Register a new Model under project_id.
The name must be unique within the project; a collision returns Duplicate instead of Created. Registration against a non-existent project returns Unprocessable.
Arguments
project_id::Integer: The id of the project that owns the model.name::AbstractString: The registry name of the model.
Returns
- The created model id, or
nothingon failure. - An
UpsertResult.
create_model(client::Client, project_id::Integer, name::AbstractString; description=nothing)::Int64Register a Model under project_id via POST /model/project/{project_id}. Requires CreatePermission on the project. Returns the new model id.
DearDiary.update_model — Function
update_model(id::Integer, name::Optional{AbstractString}, description::Optional{AbstractString})::Type{<:UpsertResult}Update a Model's mutable fields. Any keyword left as nothing is left untouched.
Arguments
id::Integer: The id of the model to update.name::Optional{AbstractString}: The new registry name.description::Optional{AbstractString}: The new description.
Returns
An UpsertResult.
update_model(client::Client, id::Integer; name=nothing, description=nothing)::NothingPatch a Model via PATCH /model/{id}. Any keyword left as nothing is left untouched server-side. Requires UpdatePermission on the owning project.
DearDiary.delete_model — Function
delete_model(id::Integer)::BoolDelete a Model and cascade every ModelVersion under it. The underlying Resource artifacts referenced by those versions are not removed; model deletion owns only the registry rows, not the artifact bytes.
Arguments
id::Integer: The id of the model to delete.
Returns
true on success, false otherwise.
delete_model(client::Client, id::Integer)::NothingDelete a Model (and cascade its ModelVersions) via DELETE /model/{id}. The underlying Resource artifacts are not removed. Requires DeletePermission on the owning project.
Model versions
DearDiary.Stage — Type
@enum Stage NO_STAGE = 1 STAGING = 2 PRODUCTION = 3 ARCHIVED = 4An enumeration representing the lifecycle stage of a ModelVersion in the model registry. A freshly registered version starts in NO_STAGE; transitions are driven by update_modelversion.
DearDiary.NO_STAGE — Constant
NO_STAGE::StageAn enumeration value representing a ModelVersion that has been registered but not yet promoted to a downstream stage. This is the value assigned at registration time.
DearDiary.STAGING — Constant
STAGING::StageAn enumeration value representing a ModelVersion that is under review before being promoted to PRODUCTION.
DearDiary.PRODUCTION — Constant
PRODUCTION::StageAn enumeration value representing a ModelVersion that is currently the production checkpoint for its parent Model. At most one version per model may hold this stage at a time; promoting a new version auto-archives the previous incumbent.
DearDiary.ARCHIVED — Constant
ARCHIVED::StageAn enumeration value representing a ModelVersion that has been superseded and should not be used for new deployments.
DearDiary.get_modelversion — Function
get_modelversion(id::Integer)::Optional{ModelVersion}Get a ModelVersion by id.
Arguments
id::Integer: The id of the model version to query.
Returns
A ModelVersion object, or nothing if no record matches.
get_modelversion(client::Client, id::Integer)::Optional{ModelVersion}Fetch a ModelVersion via GET /modelversion/{id}. Returns nothing when the server replies 404 and raises ClientError for other failures.
DearDiary.get_modelversions — Function
get_modelversions(model_id::Integer)::Array{ModelVersion, 1}Get every ModelVersion registered under model_id, ordered by version ascending.
Arguments
model_id::Integer: The id of the parent model.
Returns
An array of ModelVersion objects.
get_modelversions(model_id::Integer, page::Pagination)::PaginatedResponse{ModelVersion}Get a page of ModelVersion records for a model, with total count populated.
Arguments
model_id::Integer: The id of the parent model.page::Pagination: The page bounds (limit + offset).
Returns
A PaginatedResponse of ModelVersion.
get_modelversions(client::Client, model_id::Integer)::Array{ModelVersion,1}Returns the first page (default limit) of ModelVersion records under model_id.
get_modelversions(client::Client, model_id::Integer, page::Pagination)::PaginatedResponse{ModelVersion}Fetch a page of ModelVersion records under model_id via GET /modelversion/model/{model_id}?limit=…&offset=….
DearDiary.create_modelversion — Function
create_modelversion(model_id::Integer, iteration_id::Integer, resource_id::Optional{Integer}, description::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}Register a new ModelVersion under model_id. The new version number is the next free integer for the model (assigned by the database via a subquery on MAX(version) + UNIQUE(model_id, version)).
The producing Iteration must belong to an Experiment in the same project as the parent Model; cross-project lineage is rejected with Unprocessable. If resource_id is supplied, the Resource must likewise belong to the same project. Freshly registered versions start in NO_STAGE; promote them via update_modelversion.
Arguments
model_id::Integer: The id of the parent model.iteration_id::Integer: The id of the iteration that produced the checkpoint.resource_id::Optional{Integer}: The id of the artifact resource, ornothingwhen the bytes will be attached later.description::AbstractString: A free-form description of the version.
Returns
- The created model version id, or
nothingon failure. - An
UpsertResult.
create_modelversion(client::Client, model_id::Integer, iteration_id::Integer; resource_id=nothing, description=nothing)::Int64Register a new ModelVersion under model_id via POST /modelversion/model/{model_id}. The server assigns the next free per-model version number. Requires CreatePermission on the owning project. Returns the new version id.
DearDiary.update_modelversion — Function
update_modelversion(id::Integer, stage_id::Optional{Integer}, description::Optional{AbstractString}, resource_id::Optional{Integer})::Type{<:UpsertResult}Update a ModelVersion. stage_id must be a valid Stage value; promoting a version to PRODUCTION automatically archives every sibling under the same model that was previously in PRODUCTION.
If resource_id is supplied, the Resource must belong to the same project as the parent Model; a mismatch returns Unprocessable.
Arguments
id::Integer: The id of the version to update.stage_id::Optional{Integer}: The new lifecycle stage, ornothingto leave unchanged.description::Optional{AbstractString}: The new description, ornothingto leave unchanged.resource_id::Optional{Integer}: The new artifact pointer, ornothingto leave unchanged.
Returns
An UpsertResult.
update_modelversion(id::Integer, stage::Stage, description::Optional{AbstractString}, resource_id::Optional{Integer})::Type{<:UpsertResult}Stage-typed overload of update_modelversion.
update_modelversion(client::Client, id::Integer; stage_id=nothing, description=nothing, resource_id=nothing)::NothingPatch a ModelVersion via PATCH /modelversion/{id}. Promoting to PRODUCTION automatically archives every sibling that was previously in PRODUCTION. Requires UpdatePermission on the owning project.
update_modelversion(client::Client, id::Integer, stage::Stage; description=nothing, resource_id=nothing)::NothingStage-typed overload of update_modelversion.
DearDiary.delete_modelversion — Function
delete_modelversion(id::Integer)::BoolDelete a ModelVersion. The underlying Resource artifact is not removed; clean it up explicitly via delete_resource if it is no longer needed.
Arguments
id::Integer: The id of the version to delete.
Returns
true on success, false otherwise.
delete_modelversion(client::Client, id::Integer)::NothingDelete a ModelVersion via DELETE /modelversion/{id}. The underlying Resource artifact is not removed. Requires DeletePermission on the owning project.