Enums and Constants
Reference for all enums and constants in the Melange Android SDK.
The LLM sections on this page reflect ZeticMLange Android 1.5.9.
This page documents the enums and configuration types most commonly used from the Android SDK.
Package
com.zeticai.mlangeModelMode
Controls inference mode selection for general, non-LLM models.
enum class ModelMode {
RUN_AUTO,
RUN_SPEED,
RUN_ACCURACY
}LLMModelMode
Controls automatic target selection for ZeticMLangeLLMModel.
enum class LLMModelMode {
RUN_AUTO,
RUN_SPEED,
RUN_ACCURACY,
}| Value | Description |
|---|---|
RUN_AUTO | Default. Uses metadata-based selection to balance practical speed and quality. |
RUN_SPEED | Prioritizes lower latency. |
RUN_ACCURACY | Prioritizes higher score or lower loss. |
val model = ZeticMLangeLLMModel(
context = context,
personalKey = PERSONAL_KEY,
name = MODEL_NAME,
modelMode = LLMModelMode.RUN_SPEED,
)LLMDataSetType
Optional dataset hint for RUN_ACCURACY.
enum class LLMDataSetType {
MMLU,
TRUTHFULQA,
CNN_DAILYMAIL,
GSM8K,
}| Value | Description |
|---|---|
MMLU | Massive Multitask Language Understanding. |
TRUTHFULQA | Truthfulness and informativeness benchmark. |
CNN_DAILYMAIL | Summarization benchmark. |
GSM8K | Grade-school math reasoning benchmark. |
val model = ZeticMLangeLLMModel(
context = context,
personalKey = PERSONAL_KEY,
name = MODEL_NAME,
modelMode = LLMModelMode.RUN_ACCURACY,
dataSetType = LLMDataSetType.MMLU,
)Pass null when you do not want to specify a dataset.
LLMKVCacheCleanupPolicy
Controls how the conversation KV cache is handled when it reaches capacity.
enum class LLMKVCacheCleanupPolicy {
CLEAN_UP_ON_FULL,
DO_NOT_CLEAN_UP
}| Value | Description |
|---|---|
CLEAN_UP_ON_FULL | Clears the conversation context when the KV cache is full. Default. |
DO_NOT_CLEAN_UP | Keeps the context as-is. You must call cleanUp() before the next conversation. |
LLMInitOption
Configures LLM runtime initialization.
data class LLMInitOption(
val kvCacheCleanupPolicy: LLMKVCacheCleanupPolicy = LLMKVCacheCleanupPolicy.CLEAN_UP_ON_FULL,
val nCtx: Int = 2048,
)| Field | Type | Description |
|---|---|---|
kvCacheCleanupPolicy | LLMKVCacheCleanupPolicy | KV-cache cleanup behavior during generation. |
nCtx | Int | Requested context length. |
nCtx is not guaranteed to be applied exactly as provided. The runtime can adjust it internally depending on the model or backend.
LLMTarget
Manual runtime selection target for ZeticMLangeLLMModel.
LLMTarget.LLAMA_CPP| Value | Description |
|---|---|
LLAMA_CPP | Use this value for explicit GGUF selection. |
LLMQuantType
GGUF quantization types used with LLMTarget.LLAMA_CPP.
enum class LLMQuantType {
GGUF_QUANT_ORG,
GGUF_QUANT_F16,
GGUF_QUANT_BF16,
GGUF_QUANT_Q8_0,
GGUF_QUANT_Q6_K,
GGUF_QUANT_Q4_K_M,
GGUF_QUANT_Q3_K_M,
GGUF_QUANT_Q2_K,
GGUF_QUANT_NUM_TYPES,
}APType
Processor type used with explicit runtime selection.
enum class APType {
CPU,
GPU,
NPU,
NA,
}| Device / runtime | Supported values |
|---|---|
Qualcomm Android + LLAMA_CPP | CPU, GPU, NPU |
Other Android devices + LLAMA_CPP | CPU |
ModelCacheHandlingPolicy
Managed artifact cache policy for downloaded model files.
enum class ModelCacheHandlingPolicy {
REMOVE_OVERLAPPING,
KEEP_EXISTING,
}| Value | Description |
|---|---|
REMOVE_OVERLAPPING | Default. Removes overlapping cached aliases for the same model entry. |
KEEP_EXISTING | Keeps older cached aliases and artifacts. |
Detailed semantics for ModelCacheHandlingPolicy are currently TBD. See Cache Management.
ModelLoadingStatus
Status values delivered by the Android-only onStatusChanged callback.
enum class ModelLoadingStatus {
UNKNOWN,
PENDING,
DOWNLOADING,
TRANSFERRING,
COMPLETED,
FAILED,
CANCELED,
WAITING_FOR_WIFI,
NOT_INSTALLED,
REQUIRES_USER_CONFIRMATION,
}See Also
- ZeticMLangeLLMModel (Android): LLM model API reference
- LLM Inference Overview: Automatic vs explicit initialization
- LLM Inference Modes: Detailed mode selection guide