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
| Name | Summary |
|---|---|
chatTemplateHint | val chatTemplateHint: String? = nullChat template hint ("chatml", "llama3", "gemma"). |
initContextSize | val initContextSize: Int? = nullInitial context window size. |
initGpuLayerSize | val initGpuLayerSize: Int? = nullNumber of GPU layers to offload. |
ModelKind
enum ModelKind : Enum<ModelKind>
Kind of AI model.
Values match the Model Registry API kind field.
Entries
| Name | Description |
|---|---|
LLM | LLMLarge Language Model (GGUF format). |
VLM | VLMVision Language Model (GGUF + mmproj). |
EMBED | EMBEDEmbedding Model (GGUF format). |
ONNX | ONNXONNX Model. |
Properties
| Name | Summary |
|---|---|
entries | val entries: EnumEntries<ModelKind>Returns a representation of an immutable list of all enum entries, in the order they're declared. |
name | val name: String |
ordinal | val ordinal: Int |
value | val 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
| Name | Summary |
|---|---|
executionProvider | val executionProvider: String? = nullExecution 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
| Name | Summary |
|---|---|
createdAt | val createdAt: Long = 0Creation timestamp (milliseconds epoch). |
gguf | val gguf: GgufConfig? = nullGGUF model configuration (for llm/vlm/embed kinds). |
id | val id: StringModel identifier. |
kind | val kind: StringModel kind: "llm", "vlm", "embed", "onnx". |
onnx | val onnx: OnnxConfig? = nullONNX model configuration (for onnx kind). |
readyToUse | val readyToUse: Boolean = falseWhether the model file is uploaded and ready for inference. |
totalSize | val totalSize: Long = 0Total model file size in bytes. |
version | val version: StringModel version. |