PLUGIN
Report11 Downloads
Use an API model in LM Studio
Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
// This file contains the definition of configuration schematics for your plugin.
export const configSchematics = createConfigSchematics()
.field(
"model",
"string",
{
displayName: "Model",
subtitle: "Enter the model identifier to use for generation.",
placeholder: "e.g., gpt-5, claude-sonnet-4-20250514",
},
"gpt-5",
)
.build();
export const globalConfigSchematics = createConfigSchematics()
.field(
"apiKey",
"string",
{
displayName: "API Key",
isProtected: true,
placeholder: "Enter your API key",
},
"",
)
.field(
"overrideBaseUrl",
"string",
{
displayName: "Base URL",
subtitle: "Base URL for API calls. Defaults to OpenAI.",
placeholder: "https://api.openai.com/v1",
},
"https://api.openai.com/v1",
)
.build();
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
// This file contains the definition of configuration schematics for your plugin.
export const configSchematics = createConfigSchematics()
.field(
"model",
"string",
{
displayName: "Model",
subtitle: "Enter the model identifier to use for generation.",
placeholder: "e.g., gpt-5, claude-sonnet-4-20250514",
},
"gpt-5",
)
.build();
export const globalConfigSchematics = createConfigSchematics()
.field(
"apiKey",
"string",
{
displayName: "API Key",
isProtected: true,
placeholder: "Enter your API key",
},
"",
)
.field(
"overrideBaseUrl",
"string",
{
displayName: "Base URL",
subtitle: "Base URL for API calls. Defaults to OpenAI.",
placeholder: "https://api.openai.com/v1",
},
"https://api.openai.com/v1",
)
.build();