Melange
API ReferenceiOS

Enums and Constants

Reference for all enums and constants in the Melange iOS SDK.

The LLM sections on this page reflect ZeticMLange iOS 1.5.11.

This page documents the enums and configuration types most commonly used from the iOS SDK.

ModelMode

Controls the inference strategy for general, non-LLM models.

import ZeticMLange
ValueDescription
RUN_AUTODefault. Balanced speed and accuracy.
RUN_SPEEDPrioritizes lower latency.
RUN_ACCURACYPrioritizes higher precision.

LLMModelMode

Controls automatic target selection for ZeticMLangeLLMModel.

ValueDescription
.RUN_AUTODefault. Uses metadata-based selection to balance practical speed and quality.
.RUN_SPEEDPrioritizes lower latency.
.RUN_ACCURACYPrioritizes higher score or lower loss.
let model = try ZeticMLangeLLMModel(
    personalKey: PERSONAL_KEY,
    name: MODEL_NAME,
    modelMode: .RUN_SPEED
)

LLMDataSetType

Optional dataset hint for .RUN_ACCURACY.

ValueDescription
.MMLUMassive Multitask Language Understanding
.TRUTHFULQATruthfulness and informativeness benchmark
.CNN_DAILYMAILSummarization benchmark
.GSM8KGrade-school math reasoning benchmark
let model = try ZeticMLangeLLMModel(
    personalKey: PERSONAL_KEY,
    name: MODEL_NAME,
    modelMode: .RUN_ACCURACY,
    dataSetType: .MMLU
)

LLMKVCacheCleanupPolicy

Controls how the conversation KV cache is handled when it reaches capacity.

ValueDescription
.CLEAN_UP_ON_FULLClears the conversation context when the KV cache is full. Default.
.DO_NOT_CLEAN_UPKeeps the context as-is. You must call cleanUp() before the next conversation.

LLMInitOption

Configures LLM runtime initialization.

public struct LLMInitOption {
    public let kvCacheCleanupPolicy: LLMKVCacheCleanupPolicy
    public let nCtx: Int
}
FieldTypeDescription
kvCacheCleanupPolicyLLMKVCacheCleanupPolicyKV-cache cleanup behavior during generation.
nCtxIntRequested 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
ValueDescription
.LLAMA_CPPUse this value for explicit GGUF selection.

LLMQuantType

GGUF quantization types used with .LLAMA_CPP.

Value
.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.

Device / runtimeSupported values
Apple + .LLAMA_CPP.CPU, .GPU

Apple LLaMA.cpp does not support .NPU.

ZeticMLangeCacheHandlingPolicy

Managed artifact cache policy for downloaded model files.

ValueDescription
.REMOVE_OVERLAPPINGDefault. Removes overlapping cached aliases for the same model entry.
.KEEP_EXISTINGKeeps older cached aliases and artifacts.

Detailed semantics for ZeticMLangeCacheHandlingPolicy are currently TBD. See Cache Management.

See Also

On this page