文档
您可以使用 listLoaded 方法遍历加载到内存中的模型。此方法位于 LMStudioClient 对象的 llm 和 embedding 命名空间下。
这将为您提供与在 CLI 中使用 lms ps 相同的结果。
import { LMStudioClient } from "@lmstudio/sdk";
const client = new LMStudioClient();
const llmOnly = await client.llm.listLoaded();
const embeddingOnly = await client.embedding.listLoaded();
此页面的源代码可在 GitHub 上获取