Model registry

Models

DearDiary.get_model — Function
get_model(id::AbstractString)::Optional{Model}

Get a Model by id.

Arguments

  • id::AbstractString: 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::AbstractString)::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_models — Function
get_models(project_id::AbstractString)::Array{Model, 1}

Get all Model records registered under a given project.

Arguments

  • project_id::AbstractString: The id of the project to query.

Returns

An array of Model objects.

source
get_models(project_id::AbstractString, page::Pagination)::PaginatedResponse{Model}

Get a page of Model records for a project, with total count populated.

Arguments

  • project_id::AbstractString: 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::AbstractString)::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::AbstractString, 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_model — Function
create_model(project_id::AbstractString, name::AbstractString)::NamedTuple{id::Optional{String},status::DataType}

Register a new Model under project_id.

The name must be unique within the project; a collision returns Duplicate instead of Created. The check lives here because the model table has no uniqueness constraint on the name. Registration against a non-existent project returns Unprocessable.

Arguments

  • project_id::AbstractString: 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::AbstractString, name::AbstractString; description=nothing)::String

Register a Model under project_id via POST /model/project/{project_id}. Model names are unique within a project: a name already in use fails with ClientError "CONFLICT". Requires CreatePermission on the project. Returns the new model id.

source
DearDiary.update_model — Function
update_model(id::AbstractString, name::Optional{AbstractString}, description::Optional{AbstractString})::Type{<:UpsertResult}

Update a Model's mutable fields. Any argument passed as nothing is left untouched. A new name must be unique within the project; a collision returns Duplicate.

Arguments

  • id::AbstractString: 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::AbstractString; name=nothing, description=nothing)::Nothing

Patch a Model via PATCH /model/{id}. Any keyword left as nothing is left untouched server-side. Renaming to a name another model in the project already uses fails with ClientError "CONFLICT"; registered versions follow the model under its new name. Requires UpdatePermission on the owning project.

source
DearDiary.delete_model — Function
delete_model(id::AbstractString)::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::AbstractString: The id of the model to delete.

Returns

true on success, false otherwise.

source
delete_model(client::Client, id::AbstractString)::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_STAGE — Constant
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.PRODUCTION — Constant
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_modelversion — Function
get_modelversion(id::AbstractString)::Optional{ModelVersion}

Get a ModelVersion by id.

Arguments

  • id::AbstractString: The id of the model version to query.

Returns

A ModelVersion object, or nothing if no record matches.

source
get_modelversion(client::Client, id::AbstractString)::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_modelversions — Function
get_modelversions(model_id::AbstractString)::Array{ModelVersion, 1}

Get every ModelVersion registered under model_id, ordered by version ascending.

Arguments

  • model_id::AbstractString: The id of the parent model.

Returns

An array of ModelVersion objects.

source
get_modelversions(::Type{<:Iteration}, iteration_id::AbstractString)::Array{ModelVersion,1}

Get every ModelVersion registered from iteration_id, across all models. A non-empty result blocks delete_iteration.

Arguments

  • ::Type{<:Iteration}: The iteration type.
  • iteration_id::AbstractString: The id of the iteration the versions were registered from.

Returns

An array of ModelVersion objects.

source
get_modelversions(::Type{<:Resource}, resource_id::AbstractString)::Array{ModelVersion,1}

Get every ModelVersion whose artifact is resource_id. A non-empty result blocks delete_resource.

Arguments

  • ::Type{<:Resource}: The resource type.
  • resource_id::AbstractString: The id of the resource the versions point at.

Returns

An array of ModelVersion objects.

source
get_modelversions(::Type{<:Experiment}, experiment_id::AbstractString)::Array{ModelVersion,1}

Get every ModelVersion registered from one of the experiment's iterations or pointing at one of its artifacts. A non-empty result blocks delete_experiment.

Arguments

  • ::Type{<:Experiment}: The experiment type.
  • experiment_id::AbstractString: The id of the experiment.

Returns

An array of ModelVersion objects, without duplicates.

source
get_modelversions(model_id::AbstractString, page::Pagination)::PaginatedResponse{ModelVersion}

Get a page of ModelVersion records for a model, with total count populated.

Arguments

  • model_id::AbstractString: 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::AbstractString)::Array{ModelVersion,1}

Returns the first page (default limit) of ModelVersion records under model_id.

source
get_modelversions(client::Client, model_id::AbstractString, page::Pagination)::PaginatedResponse{ModelVersion}

Fetch a page of ModelVersion records under model_id via GET /modelversion/model/{model_id}?limit=…&offset=….

source
DearDiary.create_modelversion — Function
create_modelversion(model_id::AbstractString, iteration_id::AbstractString, resource_id::Optional{AbstractString}, description::AbstractString)::NamedTuple{id::Optional{String},status::DataType}

Register a new ModelVersion under model_id. The new version number is the next free integer for the model, assigned inside the INSERT as MAX(version) + 1; UNIQUE(model_id, version) rejects a racing duplicate.

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::AbstractString: The id of the parent model.
  • iteration_id::AbstractString: The id of the iteration that produced the checkpoint.
  • resource_id::Optional{AbstractString}: 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::AbstractString, iteration_id::AbstractString; resource_id=nothing, description=nothing)::String

Register a new ModelVersion under model_id via POST /modelversion/model/{model_id}. The server assigns the next free per-model version number and starts the version in NO_STAGE. The iteration (and the resource, when given) must belong to the model's project; a mismatch fails with ClientError "INVALID_PAYLOAD". Requires CreatePermission on the owning project. Returns the new version id.

source
DearDiary.update_modelversion — Function
update_modelversion(id::AbstractString, stage_id::Optional{Integer}, description::Optional{AbstractString}, resource_id::Optional{AbstractString})::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::AbstractString: 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{AbstractString}: The new artifact pointer, or nothing to leave unchanged.

Returns

An UpsertResult.

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

Stage-typed overload of update_modelversion.

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

Patch a ModelVersion via PATCH /modelversion/{id}. Any keyword left as nothing is left untouched server-side. Promoting to PRODUCTION archives every sibling currently in PRODUCTION. Requires UpdatePermission on the owning project.

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

Stage-typed overload of update_modelversion.

source
DearDiary.delete_modelversion — Function
delete_modelversion(id::AbstractString)::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::AbstractString: The id of the version to delete.

Returns

true on success, false otherwise.

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

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

source