MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / parseLMStudioModel

Function parseLMStudioModel

src/api/providers/fetchers/lmstudio.ts:37–50  ·  view source on GitHub ↗
(rawModel: LLMInstanceInfo | LLMInfo)

Source from the content-addressed store, hash-verified

35}
36
37export const parseLMStudioModel = (rawModel: LLMInstanceInfo | LLMInfo): ModelInfo => {
38 // Handle both LLMInstanceInfo (from loaded models) and LLMInfo (from downloaded models)
39 const contextLength = "contextLength" in rawModel ? rawModel.contextLength : rawModel.maxContextLength
40
41 const modelInfo: ModelInfo = Object.assign({}, lMStudioDefaultModelInfo, {
42 description: `${rawModel.displayName} - ${rawModel.path}`,
43 contextWindow: contextLength,
44 supportsPromptCache: true,
45 supportsImages: rawModel.vision,
46 maxTokens: contextLength,
47 })
48
49 return modelInfo
50}
51
52export async function getLMStudioModels(baseUrl = "http://localhost:1234"): Promise<Record<string, ModelInfo>> {
53 // clear the set of models that have full details loaded

Callers 2

lmstudio.test.tsFile · 0.90
getLMStudioModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected