Melange
API ReferenceiOS

Enums and Constants

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

This page documents the enums and constants available in the ZETIC Melange iOS SDK.

ModelMode

Controls the inference strategy for general (non-LLM) models.

import ZeticMLange
ValueDescription
RUN_AUTODefault. Balanced speed and accuracy (SNR > 20dB).
RUN_SPEEDMaximizes inference speed with minimum latency.
RUN_ACCURACYMaximizes precision based on SNR scores.

Usage

let model = try ZeticMLangeModel(
    personalKey: PERSONAL_KEY,
    name: MODEL_NAME,
    modelMode: RUN_SPEED
)

LLMModelMode

Controls the inference strategy for LLM models.

ValueDescriptionStatus
RUN_SPEEDMost aggressive quantization for minimum latency.Available
RUN_AUTOBalanced speed and accuracy across benchmark datasets.Paused
RUN_ACCURACYHighest precision quantization.Paused

Usage

let model = try ZeticMLangeLLMModel(
    personalKey: PERSONAL_KEY,
    name: MODEL_NAME,
    version: VERSION,
    modelMode: RUN_SPEED
)

LLMDataSetType

Specifies the benchmark dataset for accuracy evaluation in LLM Accurate mode.

ValueDescription
MMLUMassive Multitask Language Understanding
TRUTHFULQATruthfulQA benchmark
CNN_DAILYMAILCNN/DailyMail summarization
GSM8KGrade School Math 8K

Usage

let model = try ZeticMLangeLLMModel(
    personalKey: PERSONAL_KEY,
    name: MODEL_NAME,
    version: VERSION,
    modelMode: RUN_ACCURACY,
    dataSetType: MMLU
)

LLMKVCacheCleanupPolicy

Controls how the LLM engine handles a full KV cache.

ValueDescription
CLEAN_UP_ON_FULLClears the entire context when the KV cache is full. (Default)
DO_NOT_CLEAN_UPKeeps the context without cleanup when the KV cache is full.

When using DO_NOT_CLEAN_UP, calling run() again without calling cleanUp() may cause unexpected behavior.


See Also