src / configSchematics.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"defaultRenderScale",
"numeric",
{
displayName: "Default render scale",
hint: "Rasterisation scale factor for pdf.js. 1.0 ≈ 72 DPI, 2.0 ≈ 144 DPI. Higher = cleaner OCR but slower and bigger images.",
slider: { min: 0.5, max: 4, step: 0.25 },
int: false,
},
2.0,
)
.field(
"maxPages",
"numeric",
{
displayName: "Max pages per call",
hint: "Hard cap on the number of pages processed per call (safety guard). 0 means unlimited.",
slider: { min: 0, max: 500, step: 1 },
int: true,
},
50,
)
.field(
"maxFileSizeMb",
"numeric",
{
displayName: "Max file size (MB)",
hint: "PDFs larger than this are refused before any rendering happens.",
slider: { min: 1, max: 1000, step: 1 },
int: true,
},
100,
)
.field(
"vlModelOverride",
"string",
{
displayName: "Vision model identifier (override)",
hint: "Identifier of the vision-language model to use. Leave empty to auto-pick the first vision-capable model currently loaded in LM Studio.",
},
"",
)
.field(
"defaultLanguage",
"string",
{
displayName: "Document language",
hint: "Main expected language: 'fr', 'en', 'auto', or any short code. Influences the per-page prompt sent to the VL.",
},
"auto",
)
.field(
"transcriptionStyle",
"select",
{
displayName: "Transcription style",
hint: "faithful = reproduce exactly what's visible. clean = strip repeated headers/footers across pages. structured = bias the VL toward inferring titles and tables.",
options: [
{ value: "faithful", displayName: "faithful" },
{ value: "clean", displayName: "clean" },
{ value: "structured", displayName: "structured" },
],
},
"faithful",
)
.field(
"pageConcurrency",
"numeric",
{
displayName: "Page concurrency",
hint: "Iteration 1: keep at 1 (LM Studio typically serves one request at a time). Higher values are reserved for future iterations.",
slider: { min: 1, max: 4, step: 1 },
int: true,
},
1,
)
.field(
"verboseLogging",
"boolean",
{
displayName: "Verbose logging",
hint: "Log a line per page processed in the plugin console.",
},
false,
)
.build();