文档

模型信息

获取模型信息

获取模型信息

您可以从已加载的模型实例中获取有关模型本身的通用信息和元数据。

在以下示例中,LLM 引用可以用嵌入模型引用替换,而无需进行任何其他更改。

import lmstudio as lms

model = lms.llm()

print(model.get_info())

示例输出

LlmInstanceInfo.from_dict({
  "architecture": "qwen2",
  "contextLength": 4096,
  "displayName": "Qwen2.5 7B Instruct 1M",
  "format": "gguf",
  "identifier": "qwen2.5-7b-instruct",
  "instanceReference": "lpFZPBQjhSZPrFevGyY6Leq8",
  "maxContextLength": 1010000,
  "modelKey": "qwen2.5-7b-instruct-1m",
  "paramsString": "7B",
  "path": "lmstudio-community/Qwen2.5-7B-Instruct-1M-GGUF/Qwen2.5-7B-Instruct-1M-Q4_K_M.gguf",
  "sizeBytes": 4683073888,
  "trainedForToolUse": true,
  "type": "llm",
  "vision": false
})

本页的源代码可在 GitHub 上获取