Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
/**
* Global config — rendered under the plugin's gear icon, shared across all chats.
* Recommended for connection settings and API keys.
*/
export const globalConfigSchematics = createConfigSchematics()
.field(
"baseUrl",
"string",
{
displayName: "PixlStash base URL",
hint: "e.g. http://localhost:9537 or https://… for TLS",
placeholder: "http://localhost:9537",
},
"http://localhost:9537",
)
.field(
"apiToken",
"string",
{
displayName: "READ share token",
isProtected: true,
hint: "PixlStash → User Settings → Tokens (scope: READ)",
},
"",
)
.field(
"ignoreCertErrors",
"boolean",
{
displayName: "Ignore HTTPS certificate errors",
hint: "Allow self-signed certs. Only enable for trusted/local servers.",
},
false,
)
.build();
/**
* Per-chat config — rendered in the per-conversation settings panel.
* Tuning knobs that may differ between chats.
*/
export const configSchematics = createConfigSchematics()
.field(
"topN",
"numeric",
{
displayName: "Pick from top N results",
slider: { min: 1, max: 50, step: 1 },
},
10,
)
.field(
"threshold",
"numeric",
{
displayName: "Minimum semantic score (0–1)",
slider: { min: 0, max: 1, step: 0.05 },
},
0.5,
)
.field(
"imageSource",
"select",
{
displayName: "Image to inject",
options: [
{ value: "full", displayName: "Full image (best quality)" },
{ value: "thumbnail", displayName: "Thumbnail (fast, always WebP 256×256)" },
],
},
"full",
)
.field(
"maxImageHeight",
"numeric",
{
displayName: "Max image height (px)",
subtitle:
"Downscale taller full-mode images to this height (aspect preserved). 0 = no resize. Thumbnails are unaffected.",
slider: { min: 0, max: 1024, step: 32 },
},
512,
)
.field(
"maxImagesPerResponse",
"numeric",
{
displayName: "Max images per response",
subtitle:
"Hard cap on how many pictures the model can show in a single reply. 0 = unlimited.",
slider: { min: 0, max: 10, step: 1 },
},
1,
)
.field(
"formats",
"stringArray",
{
displayName: "Allowed formats (full-image mode)",
hint: "LM Studio supports jpg, jpeg, png, webp",
},
["jpg", "jpeg", "png", "webp"],
)
.field(
"requiredTags",
"stringArray",
{
displayName: "Required tags (optional)",
hint: "Only include pictures that have all of these tags",
},
[],
)
.field(
"rejectedTags",
"stringArray",
{
displayName: "Excluded tags (optional)",
hint: "Skip pictures that have any of these tags",
},
[],
)
.field(
"minScore",
"numeric",
{
displayName: "Minimum user score (0 = ignore)",
slider: { min: 0, max: 10, step: 1 },
},
0,
)
.field(
"scopeCharacters",
"stringArray",
{
displayName: "Limit to characters (names)",
hint: "Only inject pictures of these characters (any one matches). Empty = no character filter.",
},
[],
)
.field(
"scopeSets",
"stringArray",
{
displayName: "Limit to picture sets (names)",
hint: "Only inject pictures from these sets (any one matches). Empty = no set filter.",
},
[],
)
.field(
"scopeProject",
"string",
{
displayName: "Limit to project (name)",
hint: "Only inject pictures from this project. Blank = no project filter.",
},
"",
)
.build();