Forked from vadimfedenko/analyze-images
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
/**
* Global (application-wide) configuration. Shared across every chat that
* uses this plugin. Set these once in LM Studio → Plugins → (this plugin)
* → Global Settings.
*
* Note: we intentionally do NOT export a per-chat `configSchematics` — both
* knobs we expose are system-level. An empty `createConfigSchematics().build()`
* fails the SDK's runtime instance check at registration time, so don't add
* one back unless it has at least one .field().
*/
export const globalConfigSchematics = createConfigSchematics()
.field(
"workspaceDirectory",
"string",
{
displayName: "Workspace Directory",
subtitle:
"Absolute path to the folder containing images this plugin can list and analyze. " +
"All image discovery is rooted here; the plugin's own working directory is ignored.",
placeholder: "/home/greg/lmstudio-workspace",
},
"", // No safe default — user must set this explicitly
)
.field(
"visionModelKey",
"string",
{
displayName: "Vision Model Key",
subtitle:
"Model key of the VLM to use for analysis. Find it in LM Studio → My Models. " +
"Examples: qwen2-vl-2b-instruct, gemma-3-12b-it, llava-...",
placeholder: "qwen2-vl-2b-instruct",
},
"qwen2-vl-2b-instruct",
)
.field(
"maxAnalysisTokens",
"numeric",
{
displayName: "Max Analysis Tokens",
subtitle: "Hard cap on tokens generated per analysis call.",
slider: { min: 128, max: 4096, step: 64 },
int: true,
},
2048,
)
.build();