modelregistry

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package modelregistry implements MCP tools for GitLab model registry operations.

The package wraps the GitLab Model registry API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for Model Registry actions exposed as MCP tools. The download route is projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func FormatDownloadMarkdown

func FormatDownloadMarkdown(o DownloadOutput) string

FormatDownloadMarkdown formats a downloaded ML model package file as Markdown.

Types

type DownloadInput

type DownloadInput struct {
	ProjectID      toolutil.StringOrInt `json:"project_id"       jsonschema:"Project ID or URL-encoded path,required"`
	ModelVersionID toolutil.StringOrInt `json:"model_version_id" jsonschema:"Model version ID (numeric or string like candidate:5),required"`
	Path           string               `json:"path"             jsonschema:"Path within the model package,required"`
	Filename       string               `json:"filename"         jsonschema:"Name of the file to download,required"`
}

DownloadInput holds parameters for downloading a ML model package file.

type DownloadOutput

type DownloadOutput struct {
	toolutil.HintableOutput
	ProjectID      string `json:"project_id"`
	ModelVersionID string `json:"model_version_id"`
	Path           string `json:"path"`
	Filename       string `json:"filename"`
	ContentBase64  string `json:"content_base64"`
	SizeBytes      int    `json:"size_bytes"`
}

DownloadOutput represents the downloaded ML model package file.

func Download

func Download(ctx context.Context, client *gitlabclient.Client, in DownloadInput) (DownloadOutput, error)

Download retrieves a single file from a machine learning model package via the GitLab Model Registry API (GET /projects/:id/ml/models/:model_version_id/:path/:filename). Returns the raw bytes base64-encoded in ContentBase64, with SizeBytes describing the decoded size.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL