|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > LMS. - LM-Studio Commands > NEW: LMS v2.1 Commands - Model Query, Status, and Text Extraction > LMS.GetModelByIndex - Get Model by Index |
Retrieves the model ID of a loaded model by its index position. LM Studio can have up to 2 models loaded simultaneously.
Syntax:
LMS.GetModelByIndex|$$INDEX|$$RET_VAR
Parameters:
$$INDEX (Number, required) - Index of the model (1 for first model, 2 for second model).
$$RET_VAR (Variable, required) - Variable to receive the model ID.
Return Value:
Returns the model ID string in $$RET_VAR, or empty string if no model exists at that index.
Examples:
; Get the first loaded model
LMS.GetModelByIndex|1|model1
MSGBOX "First model: " & model1
; Get the second loaded model
LMS.GetModelByIndex|2|model2
IF model2 <> "" THEN
MSGBOX "Second model: " & model2
END IF
See Also: