Skip to main content

Model Registry

Package: com.mimik.mimoe.models

CRUD operations for on-device AI models.

GgufConfig

@Serializable
data class GgufConfig(
val chatTemplateHint: String? = null,
val initContextSize: Int? = null,
val initGpuLayerSize: Int? = null
)

Configuration for GGUF models (LLM, VLM, Embed).

Constructors

constructor(
chatTemplateHint: String? = null,
initContextSize: Int? = null,
initGpuLayerSize: Int? = null
)

Properties

NameSummary
chatTemplateHintval chatTemplateHint: String? = null
Chat template hint ("chatml", "llama3", "gemma").
initContextSizeval initContextSize: Int? = null
Initial context window size.
initGpuLayerSizeval initGpuLayerSize: Int? = null
Number of GPU layers to offload.

ModelKind

enum ModelKind : Enum<ModelKind>

Kind of AI model.

Values match the Model Registry API kind field.

Entries

NameDescription
LLMLLM
Large Language Model (GGUF format).
VLMVLM
Vision Language Model (GGUF + mmproj).
EMBEDEMBED
Embedding Model (GGUF format).
ONNXONNX
ONNX Model.

Properties

NameSummary
entriesval entries: EnumEntries<ModelKind>
Returns a representation of an immutable list of all enum entries, in the order they're declared.
nameval name: String
ordinalval ordinal: Int
valueval value: String

Functions

valueOf

fun valueOf(value: String): ModelKind

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

values

fun values(): Array<ModelKind>

Returns an array containing the constants of this enum type, in the order they're declared.


ModelRegistryClient

class ModelRegistryClient

Model Registry sub-client.

Manages AI model storage: create, upload, download, list, and delete. Base path: /mimik-ai/store/v1 Requires the ai-foundation addon.

Access via client.models.

Functions

create

suspend fun create(id: String, version: String, kind: String, gguf: GgufConfig? = null, onnx: OnnxConfig? = null): Result<RegisteredModel>

Register model metadata.

delete

suspend fun delete(id: String): Result<Unit>

Delete a model.

download

suspend fun download(id: String, url: String, mmprojUrl: String? = null): Result<RegisteredModel>

Download a model from a URL.

get

suspend fun get(id: String): Result<RegisteredModel>

Get a model's details.

list

suspend fun list(kind: String? = null, ready: Boolean? = null): Result<List<RegisteredModel>>

List registered models.

update

suspend fun update(id: String, gguf: GgufConfig? = null, onnx: OnnxConfig? = null): Result<RegisteredModel>

Update model configuration.

upload

suspend fun upload(id: String, file: File): Result<RegisteredModel>

Upload a model file.


OnnxConfig

@Serializable
data class OnnxConfig(val executionProvider: String? = null)

Configuration for ONNX models.

Constructors

constructor(executionProvider: String? = null)

Properties

NameSummary
executionProviderval executionProvider: String? = null
Execution provider: "cpu", "cuda", "coreml", "tensorrt".

RegisteredModel

@Serializable
data class RegisteredModel(
val id: String,
val version: String = "",
val kind: String = "",
val readyToUse: Boolean = false,
val totalSize: Long = 0,
val createdAt: Long = 0,
val gguf: GgufConfig? = null,
val onnx: OnnxConfig? = null
)

A model registered in the Model Registry.

Fields match the Model Registry API response from GET /mimik-ai/store/v1/models.

Constructors

constructor(
id: String,
version: String = "",
kind: String = "",
readyToUse: Boolean = false,
totalSize: Long = 0,
createdAt: Long = 0,
gguf: GgufConfig? = null,
onnx: OnnxConfig? = null
)

Properties

NameSummary
createdAtval createdAt: Long = 0
Creation timestamp (milliseconds epoch).
ggufval gguf: GgufConfig? = null
GGUF model configuration (for llm/vlm/embed kinds).
idval id: String
Model identifier.
kindval kind: String
Model kind: "llm", "vlm", "embed", "onnx".
onnxval onnx: OnnxConfig? = null
ONNX model configuration (for onnx kind).
readyToUseval readyToUse: Boolean = false
Whether the model file is uploaded and ready for inference.
totalSizeval totalSize: Long = 0
Total model file size in bytes.
versionval version: String
Model version.