Melange
API ReferenceAndroid

Enums and Constants

Android enum and support types for ZeticMLange.

This page describes the API planned for ZeticMLange Android 1.13.0.

General Model Types

TypeValues
ModelModeRUN_AUTO, RUN_FP32, RUN_QUANTIZED, RUN_SPEED, RUN_ACCURACY
APTypeCPU, GPU, NPU, NA
ModelCacheHandlingPolicyREMOVE_OVERLAPPING, KEEP_EXISTING

Target contains backend identifiers used by selected general-model artifacts. Most apps use ModelMode and let backend selection choose the target.

LLM Types

TypeValues
LLMModelModeRUN_AUTO, RUN_SPEED, RUN_ACCURACY
LLMKVCacheCleanupPolicyCLEAN_UP_ON_FULL, DO_NOT_CLEAN_UP
KVStateStatusStatus carried by ZeticMLangeKVException when a KV state operation fails.
ZeticMLangeKVExceptionTyped exception for non-OK KV state statuses.

LLMInitOption

data class LLMInitOption(
    val kvCacheCleanupPolicy: LLMKVCacheCleanupPolicy = LLMKVCacheCleanupPolicy.CLEAN_UP_ON_FULL,
    val nCtx: Int = 2048,
)
FieldDefaultDescription
kvCacheCleanupPolicyCLEAN_UP_ON_FULLIn-memory KV-cache behavior when context storage is full.
nCtx2048Requested context size. This is the initializer's default; the selected model and backend determine the supported and effective context size.

The runtime configuration is selected for the device and is not a public LLMInitOption field.

Result Types

TypePurpose
LLMNextTokenResultToken result returned by waitForNextToken().

Background Download Types

TypeValues or purpose
BackgroundDownloadHandleDurable job identifier returned by downloadInBackground(...); retain it to query or stop the job.
BackgroundDownloadStateQUEUED, RESOLVING, DOWNLOADING, VERIFYING, INSTALLED, FAILED, STOPPED
BackgroundDownloadStatusLatest job snapshot: handle, state, downloaded bytes, optional total bytes, and optional error message.
BackgroundDownloadStopResultSTOPPED, ALREADY_FINISHED, NOT_FOUND
ModelRemovalResultRemoval outcome: removed, isInUse, deletedFiles, and deletedBytes.

INSTALLED, FAILED, and STOPPED are terminal states. If ModelRemovalResult.isInUse is true, close active model instances before retrying removal.

On this page