Model Version

DearDiary.NO_STAGEConstant
NO_STAGE::Stage

An 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.

source
DearDiary.PRODUCTIONConstant
PRODUCTION::Stage

An 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.

source
DearDiary.get_modelversionFunction
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.

source
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.

source
DearDiary.get_modelversionsFunction
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.

source
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.

source
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.

source
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=….

source
DearDiary.create_modelversionFunction
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, or nothing when the bytes will be attached later.
  • description::AbstractString: A free-form description of the version.

Returns

  • The created model version id, or nothing on failure.
  • An UpsertResult.
source
create_modelversion(client::Client, model_id::Integer, iteration_id::Integer; resource_id=nothing, description=nothing)::Int64

Register 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.

source
DearDiary.update_modelversionFunction
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, or nothing to leave unchanged.
  • description::Optional{AbstractString}: The new description, or nothing to leave unchanged.
  • resource_id::Optional{Integer}: The new artifact pointer, or nothing to leave unchanged.

Returns

An UpsertResult.

source
update_modelversion(id::Integer, stage::Stage, description::Optional{AbstractString}, resource_id::Optional{Integer})::Type{<:UpsertResult}

Stage-typed overload of update_modelversion.

source
update_modelversion(client::Client, id::Integer; stage_id=nothing, description=nothing, resource_id=nothing)::Nothing

Patch a ModelVersion via PATCH /modelversion/{id}. Promoting to PRODUCTION automatically archives every sibling that was previously in PRODUCTION. Requires UpdatePermission on the owning project.

source
update_modelversion(client::Client, id::Integer, stage::Stage; description=nothing, resource_id=nothing)::Nothing

Stage-typed overload of update_modelversion.

source
DearDiary.delete_modelversionFunction
delete_modelversion(id::Integer)::Bool

Delete 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.

source
delete_modelversion(client::Client, id::Integer)::Nothing

Delete a ModelVersion via DELETE /modelversion/{id}. The underlying Resource artifact is not removed. Requires DeletePermission on the owning project.

source