Skip to main content

Core

Package: com.mimik.mimoe

Main entry point, configuration, error types, and runtime state.

Capability

enum Capability : Enum<Capability>

Runtime capabilities to enable.

Entries

NameDescription
AIAI
AI inference support.
MESHMESH
Mesh networking support.

Properties

NameSummary
entriesval entries: EnumEntries<Capability>
Returns a representation of an immutable list of all enum entries, in the order they're declared.
nameval name: String
ordinalval 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

NameDescription
NONENONE
ERRORERROR
WARNWARN
INFOINFO
DEBUGDEBUG
TRACETRACE

Properties

NameSummary
entriesval entries: EnumEntries<LogLevel>
Returns a representation of an immutable list of all enum entries, in the order they're declared.
nameval name: String
ordinalval 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:

NameDescription
contextAndroid context (Application context recommended).

Constructors

constructor(context: Context)

Properties

NameSummary
accountval account: AccountClient
Account Association API.
addonsval addons: AddonClient
Addon management API.
authval auth: AuthClient
Authentication API.
inferenceval inference: InferenceClient
AI Inference API.
infoval info: MimOEInfo?
Information about the running runtime, or null if not running.
insightval insight: InsightClient
Insight (mesh discovery) API.
isRunningval isRunning: Boolean
Whether the mimOE runtime is currently running.
mcmval mcm: McmClient
MCM (mim compute management) API.
modelsval models: ModelRegistryClient
Model Registry API.
stateFlowval 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

NameSummary
capabilitiesval capabilities: Set<Capability>
Enabled capabilities. Default: empty (mesh + AI determined by build variant).
enableFileLogval enableFileLog: Boolean
Enable file-based logging. Default: false.
installBundledAddonsval installBundledAddons: Boolean
Automatically install bundled addons before start. Default: false.
jsonRpcApiKeyEnabledval jsonRpcApiKeyEnabled: Boolean
Enable JSON-RPC API key authentication. Default: true.
licenseval license: String
License JWT string. Required.
logLevelval logLevel: LogLevel
Runtime log level. Default: INFO.
mdbConfigB64val mdbConfigB64: String?
Base64-encoded MDB configuration. Internal use.
networkInterfaceval networkInterface: String?
Bind to a specific network interface (e.g., "wlan0"). Default: null (auto).
portval port: Int
API gateway port. Default: 8083.

MimOEConfigBuilder

class MimOEConfigBuilder

DSL builder for MimOEConfig.

Properties

NameSummary
enableFileLogvar enableFileLog: Boolean
Enable file-based logging. Default: false.
installBundledAddonsvar installBundledAddons: Boolean
Automatically install bundled addons before start. Default: false.
jsonRpcApiKeyEnabledvar jsonRpcApiKeyEnabled: Boolean
Enable JSON-RPC API key authentication. Default: true.
licensevar license: String
License JWT string. Required.
logLevelvar logLevel: LogLevel
Runtime log level. Default: INFO.
mdbConfigB64var mdbConfigB64: String?
Base64-encoded MDB configuration. Internal use.
networkInterfacevar networkInterface: String?
Bind to a specific network interface.
portvar port: Int
API 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

NameSummary
AlreadyRunningdata object AlreadyRunning : MimOEError
Runtime is already running. Call stop() first.
AuthenticationFaileddata class AuthenticationFailed(val code: Int, val message: String) : MimOEError
Authentication request failed.
ConnectionFaileddata class ConnectionFailed(val url: String, val cause: Throwable) : MimOEError
HTTP connection to local runtime failed.
DeploymentFaileddata class DeploymentFailed(val reason: String) : MimOEError
Mim deployment failed.
HttpErrordata class HttpError(val statusCode: Int, val body: String?) : MimOEError
HTTP error from the local runtime.
ImageNotFounddata class ImageNotFound(val name: String) : MimOEError
Image with the given name was not found.
LicenseInvaliddata class LicenseInvalid(val reason: String) : MimOEError
License JWT is missing or invalid.
MimNotFounddata class MimNotFound(val name: String) : MimOEError
Mim with the given name was not found.
NativeLibraryFaileddata class NativeLibraryFailed(val cause: Throwable) : MimOEError
Native library (libedge.so) failed to load.
NoTokensdata object NoTokens : MimOEError
No tokens available. Login required.
NotRunningdata object NotRunning : MimOEError
Runtime is not running. Call start() first.
PortInUsedata class PortInUse(val port: Int) : MimOEError
Requested port is already in use.
ServiceBindFaileddata object ServiceBindFailed : MimOEError
Android service binding failed.
StartupTimeoutdata class StartupTimeout(val timeoutMs: Long) : MimOEError
Runtime startup timed out.
Timeoutdata class Timeout(val operation: String) : MimOEError
Operation timed out.
TokenExpireddata class TokenExpired(val tokenType: String) : MimOEError
Token has expired.
Unexpecteddata class Unexpected(val message: String, val cause: Throwable? = null) : MimOEError
Unexpected 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

NameSummary
portval port: Int
Port the runtime API is listening on.
serviceUrlval serviceUrl: String
HTTP base URL (e.g., http://127.0.0.1:8083).
websocketUrlval websocketUrl: String
WebSocket base URL (e.g., ws://127.0.0.1:8083).
workingDirval workingDir: String
Working directory path.

MimOEState

enum MimOEState : Enum<MimOEState>

Represents the current state of the mimOE runtime.

Observe state changes via MimOEClient.stateFlow.

Entries

NameDescription
STOPPEDSTOPPED
Runtime is not started.
STARTINGSTARTING
Runtime is in the process of starting.
RUNNINGRUNNING
Runtime is running and ready to accept requests.
ERRORERROR
Runtime encountered an error. Check logs for details.

Properties

NameSummary
entriesval entries: EnumEntries<MimOEState>
Returns a representation of an immutable list of all enum entries, in the order they're declared.
nameval name: String
ordinalval 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.