src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"defaultTimeoutSeconds",
"numeric",
{
displayName: "Default Sage timeout",
subtitle: "Seconds before a Sage run is killed. Tool calls may request less or more, but never above 600 seconds.",
int: true,
min: 1,
max: 600,
slider: { min: 1, max: 600, step: 1 },
},
10,
)
.field(
"memoryLimit",
"select",
{
displayName: "Memory limit",
subtitle: "Hard memory cap passed to Podman. Keep this low unless a calculation truly needs more.",
options: [
{ value: "256m", displayName: "256 MiB" },
{ value: "512m", displayName: "512 MiB" },
{ value: "1g", displayName: "1 GiB" },
{ value: "2g", displayName: "2 GiB" },
{ value: "4g", displayName: "4 GiB" },
{ value: "8g", displayName: "8 GiB" },
],
},
"1g",
)
.field(
"cpuLimit",
"numeric",
{
displayName: "CPU limit",
subtitle: "Maximum CPU share for the container. Fractions are allowed, e.g. 0.5.",
min: 0.1,
max: 4,
slider: { min: 0.1, max: 4, step: 0.1 },
},
1,
)
.field(
"pidsLimit",
"numeric",
{
displayName: "Process limit",
subtitle: "Maximum number of processes inside the Sage container.",
int: true,
min: 16,
max: 512,
slider: { min: 16, max: 512, step: 16 },
},
96,
)
.field(
"outputLimitKiB",
"numeric",
{
displayName: "Output limit per stream",
subtitle: "Maximum stdout and stderr captured separately, in KiB.",
int: true,
min: 16,
max: 2048,
slider: { min: 16, max: 2048, step: 16 },
},
256,
)
.build();
export const globalConfigSchematics = createConfigSchematics()
.field(
"podmanExecutable",
"string",
{
displayName: "Podman executable",
subtitle: "Usually 'podman' or '/usr/bin/podman'.",
placeholder: "/usr/bin/podman",
},
"/usr/bin/podman",
)
.field(
"sageImage",
"string",
{
displayName: "SageMath container image",
subtitle: "Image must already be pulled locally. The plugin uses --pull=never.",
placeholder: "docker.io/sagemath/sagemath:latest",
},
"docker.io/sagemath/sagemath:latest",
)
.build();