Model registry

Models

DearDiary.get_modelFunction
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.

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

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

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

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

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

source
DearDiary.create_modelFunction
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 nothing on failure.
  • An UpsertResult.
source
create_model(client::Client, project_id::Integer, name::AbstractString; description=nothing)::Int64

Register a Model under project_id via POST /model/project/{project_id}. Requires CreatePermission on the project. Returns the new model id.

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

source
update_model(client::Client, id::Integer; name=nothing, description=nothing)::Nothing

Patch a Model via PATCH /model/{id}. Any keyword left as nothing is left untouched server-side. Requires UpdatePermission on the owning project.

source
DearDiary.delete_modelFunction
delete_model(id::Integer)::Bool

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

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

Delete a Model (and cascade its ModelVersions) via DELETE /model/{id}. The underlying Resource artifacts are not removed. Requires DeletePermission on the owning project.

source

Model versions

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}

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