Core
Package: com.mimik.mimoe
Main entry point, configuration, error types, and runtime state.
Capability
enum Capability : Enum<Capability>
Runtime capabilities to enable.
Entries
| Name | Description |
|---|---|
AI | AIAI inference support. |
MESH | MESHMesh networking support. |
Properties
| Name | Summary |
|---|---|
entries | val entries: EnumEntries<Capability>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 |
Functions
valueOf
fun valueOf(value: String): Capability
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<Capability>
Returns an array containing the constants of this enum type, in the order they're declared.
CapabilitySetBuilder
class CapabilitySetBuilder
DSL builder for capability sets.
Functions
unaryPlus
operator fun Capability.unaryPlus()
LogLevel
enum LogLevel : Enum<LogLevel>
Log level for the mimOE runtime.
Entries
| Name | Description |
|---|---|
NONE | NONE |
ERROR | ERROR |
WARN | WARN |
INFO | INFO |
DEBUG | DEBUG |
TRACE | TRACE |
Properties
| Name | Summary |
|---|---|
entries | val entries: EnumEntries<LogLevel>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 |
Functions
valueOf
fun valueOf(value: String): LogLevel
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<LogLevel>
Returns an array containing the constants of this enum type, in the order they're declared.
MimOEClient
class MimOEClient(context: Context)
Main entry point for the mimOE Android SDK.
Create a single instance per application (typically in Application.onCreate) and access feature APIs via sub-clients:
val client = MimOEClient(context)
// Lifecycle
client.start(config)
client.stop()
// Feature APIs
client.auth.loginWithDeveloperToken(...)
client.account.getMe()
client.mcm.deployMim(...)
client.addons.installBundledAddons()
client.inference.chatCompletion(...)
client.models.list()
client.insight.discoverLinkLocal()
Parameters:
| Name | Description |
|---|---|
| context | Android context (Application context recommended). |
Constructors
constructor(context: Context)
Properties
| Name | Summary |
|---|---|
account | val account: AccountClientAccount Association API. |
addons | val addons: AddonClientAddon management API. |
auth | val auth: AuthClientAuthentication API. |
inference | val inference: InferenceClientAI Inference API. |
info | val info: MimOEInfo?Information about the running runtime, or null if not running. |
insight | val insight: InsightClientInsight (mesh discovery) API. |
isRunning | val isRunning: BooleanWhether the mimOE runtime is currently running. |
mcm | val mcm: McmClientMCM (mim compute management) API. |
models | val models: ModelRegistryClientModel Registry API. |
stateFlow | val stateFlow: StateFlow<MimOEState>Flow of runtime state changes. |
Functions
bindToLifecycle
fun bindToLifecycle(lifecycleOwner: LifecycleOwner)
Bind the mimOE runtime lifecycle to an Android LifecycleOwner.
clearData
suspend fun clearData(): Result<Unit>
Clear all mimOE data (tokens, keys, cached data).
close
fun close()
Release all resources. Call when the client is no longer needed.
start
suspend fun start(config: MimOEConfig): Result<MimOEInfo>
Start the mimOE runtime with the given configuration.
fun start(config: MimOEConfig, callback: (Result<MimOEInfo>) -> Unit)
Start the mimOE runtime with a callback (Java interop).
stop
suspend fun stop(): Result<Unit>
Stop the mimOE runtime.
fun stop(callback: (Result<Unit>) -> Unit)
Stop the mimOE runtime with a callback (Java interop).
MimOEConfig
data class MimOEConfig
Configuration for starting the mimOE runtime.
Create using the DSL builder:
val config = mimOEConfig {
port = 8083
license = "ey..."
logLevel = LogLevel.INFO
capabilities {
+Capability.AI
+Capability.MESH
}
}
Properties
| Name | Summary |
|---|---|
capabilities | val capabilities: Set<Capability>Enabled capabilities. Default: empty (mesh + AI determined by build variant). |
enableFileLog | val enableFileLog: BooleanEnable file-based logging. Default: false. |
installBundledAddons | val installBundledAddons: BooleanAutomatically install bundled addons before start. Default: false. |
jsonRpcApiKeyEnabled | val jsonRpcApiKeyEnabled: BooleanEnable JSON-RPC API key authentication. Default: true. |
license | val license: StringLicense JWT string. Required. |
logLevel | val logLevel: LogLevelRuntime log level. Default: INFO. |
mdbConfigB64 | val mdbConfigB64: String?Base64-encoded MDB configuration. Internal use. |
networkInterface | val networkInterface: String?Bind to a specific network interface (e.g., "wlan0"). Default: null (auto). |
port | val port: IntAPI gateway port. Default: 8083. |
MimOEConfigBuilder
class MimOEConfigBuilder
DSL builder for MimOEConfig.
Properties
| Name | Summary |
|---|---|
enableFileLog | var enableFileLog: BooleanEnable file-based logging. Default: false. |
installBundledAddons | var installBundledAddons: BooleanAutomatically install bundled addons before start. Default: false. |
jsonRpcApiKeyEnabled | var jsonRpcApiKeyEnabled: BooleanEnable JSON-RPC API key authentication. Default: true. |
license | var license: StringLicense JWT string. Required. |
logLevel | var logLevel: LogLevelRuntime log level. Default: INFO. |
mdbConfigB64 | var mdbConfigB64: String?Base64-encoded MDB configuration. Internal use. |
networkInterface | var networkInterface: String?Bind to a specific network interface. |
port | var port: IntAPI gateway port. Default: 8083. |
Functions
capabilities
fun capabilities(block: CapabilitySetBuilder.() -> Unit)
Configure capabilities using DSL syntax:
MimOEError
sealed class MimOEError : Exception
Sealed error hierarchy for all mimOE SDK operations.
Use exhaustive when expressions for compile-time safety:
when (val error = result.exceptionOrNull()) {
is MimOEError.LicenseInvalid -> showLicenseError(error.reason)
is MimOEError.PortInUse -> suggestDifferentPort(error.port)
// ... compiler error if cases missing
}
Types
| Name | Summary |
|---|---|
AlreadyRunning | data object AlreadyRunning : MimOEErrorRuntime is already running. Call stop() first. |
AuthenticationFailed | data class AuthenticationFailed(val code: Int, val message: String) : MimOEErrorAuthentication request failed. |
ConnectionFailed | data class ConnectionFailed(val url: String, val cause: Throwable) : MimOEErrorHTTP connection to local runtime failed. |
DeploymentFailed | data class DeploymentFailed(val reason: String) : MimOEErrorMim deployment failed. |
HttpError | data class HttpError(val statusCode: Int, val body: String?) : MimOEErrorHTTP error from the local runtime. |
ImageNotFound | data class ImageNotFound(val name: String) : MimOEErrorImage with the given name was not found. |
LicenseInvalid | data class LicenseInvalid(val reason: String) : MimOEErrorLicense JWT is missing or invalid. |
MimNotFound | data class MimNotFound(val name: String) : MimOEErrorMim with the given name was not found. |
NativeLibraryFailed | data class NativeLibraryFailed(val cause: Throwable) : MimOEErrorNative library (libedge.so) failed to load. |
NoTokens | data object NoTokens : MimOEErrorNo tokens available. Login required. |
NotRunning | data object NotRunning : MimOEErrorRuntime is not running. Call start() first. |
PortInUse | data class PortInUse(val port: Int) : MimOEErrorRequested port is already in use. |
ServiceBindFailed | data object ServiceBindFailed : MimOEErrorAndroid service binding failed. |
StartupTimeout | data class StartupTimeout(val timeoutMs: Long) : MimOEErrorRuntime startup timed out. |
Timeout | data class Timeout(val operation: String) : MimOEErrorOperation timed out. |
TokenExpired | data class TokenExpired(val tokenType: String) : MimOEErrorToken has expired. |
Unexpected | data class Unexpected(val message: String, val cause: Throwable? = null) : MimOEErrorUnexpected error. |
MimOEInfo
data class MimOEInfo(
val port: Int,
val workingDir: String,
val serviceUrl: String,
val websocketUrl: String
)
Information about a running mimOE instance.
Available via MimOEClient.info when the runtime is running.
Constructors
constructor(
port: Int,
workingDir: String,
serviceUrl: String,
websocketUrl: String
)
Properties
| Name | Summary |
|---|---|
port | val port: IntPort the runtime API is listening on. |
serviceUrl | val serviceUrl: StringHTTP base URL (e.g., http://127.0.0.1:8083). |
websocketUrl | val websocketUrl: StringWebSocket base URL (e.g., ws://127.0.0.1:8083). |
workingDir | val workingDir: StringWorking directory path. |
MimOEState
enum MimOEState : Enum<MimOEState>
Represents the current state of the mimOE runtime.
Observe state changes via MimOEClient.stateFlow.
Entries
| Name | Description |
|---|---|
STOPPED | STOPPEDRuntime is not started. |
STARTING | STARTINGRuntime is in the process of starting. |
RUNNING | RUNNINGRuntime is running and ready to accept requests. |
ERROR | ERRORRuntime encountered an error. Check logs for details. |
Properties
| Name | Summary |
|---|---|
entries | val entries: EnumEntries<MimOEState>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 |
Functions
valueOf
fun valueOf(value: String): MimOEState
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<MimOEState>
Returns an array containing the constants of this enum type, in the order they're declared.
Package Functions
mimOEConfig
fun mimOEConfig(block: MimOEConfigBuilder.() -> Unit): MimOEConfig
Create a MimOEConfig using DSL syntax.