Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
import { loadPresets } from "./presets";
const NONE_PRESET_LABEL = "(none)";
function buildPresetOptions(): Array<{ value: string; displayName: string }> {
const presets = loadPresets();
const filtered = presets.filter(p => p.name !== "none");
return [
{ value: "none", displayName: NONE_PRESET_LABEL },
...filtered.map(p => ({ value: p.name, displayName: p.name })),
];
}
export const globalConfigSchematics = createConfigSchematics()
.field(
"apiKey",
"string",
{
displayName: "API Key",
isProtected: true,
placeholder: "sk-or-v1-..."
},
""
)
.field(
"baseUrl",
"string",
{
displayName: "Base URL",
subtitle: "Base URL for API calls. Leave empty for local endpoint.",
placeholder: "http://localhost:port"
},
""
)
.build();
export const configSchematics = createConfigSchematics()
.field(
"systemPromptPreset",
"select",
{
displayName: "System Prompt Preset",
subtitle: "Choose an LM Studio config preset to inject its system prompt.",
options: buildPresetOptions(),
},
"none"
)
.field(
"customSystemPrompt",
"string",
{
displayName: "Custom System Prompt",
subtitle: "Override preset with custom text (leave empty to use preset above).",
},
""
)
.field(
"model",
"string",
{
displayName: "Model",
subtitle: "Provider model ID (e.g., Qwen/Qwen3.6-35B-A3B-FP8)",
placeholder: "Qwen/Qwen3.6-35B-A3B-FP8"
},
""
)
.field(
"debug",
"boolean",
{
displayName: "Debug Logging",
subtitle: "Log request payloads and internal debug details.",
},
false
)
.build();