List Loaded Models
Query which models are currently loaded
You can iterate through models loaded into memory using the listLoaded method. This method lives under the llm and embedding namespaces of the LMStudioClient object.
List Models Currently Loaded in Memory
This will give you results equivalent to using lms ps in the CLI.
import { LMStudioClient } from "@lmstudio/sdk";
const client = new LMStudioClient();
const llmOnly = await client.llm.listLoaded();
const embeddingOnly = await client.embedding.listLoaded();