Model Version
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}Convenience wrapper around the paged form: 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.