GoodMemGoodMem

LLMs

LLM management.

Methods on this page are called through client.llms.

client.llms.create

client.llms.create(request: LlmsCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise<CreateLLMResponseShape>

Creates a new LLM configuration for text generation services. LLMs represent connections to different language model API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them for text generation. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another LLM exists with identical {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, credentialsFingerprint} after URL canonicalization. Uniqueness is enforced per-owner. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. The apiPath field defaults to '/chat/completions' if omitted. Requires CREATE_LLM_OWN permission (or CREATE_LLM_ANY for admin users).

HTTP: POST /v1/llms

Parameters

ParameterTypeDescription
requestLlmsCreateRequestCreation request. Known modelIdentifier values fill provider, endpoint, dimensionality, and modality defaults.
requestOptionsProviderApiKeyOptions optionalProvider API key plus per-call signal, timeout, or headers.

Returns: Promise&lt;CreateLLMResponseShape&gt;

Example

const llmResponse = await client.llms.create(
  {
    displayName: "Doc LLM",
    modelIdentifier: "gpt-4o-mini",
    labels: { env: "docs" },
  },
  { apiKey: "sk-..." },
);
const llm = llmResponse.llm;

client.llms.delete

client.llms.delete(id: string, requestOptions?: RequestOptions): Promise<void>

Permanently deletes an LLM configuration. This operation cannot be undone and removes the LLM record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete any previously generated content using this LLM - existing generations remain accessible. Requires DELETE_LLM_OWN permission for LLMs you own (or DELETE_LLM_ANY for admin users).

HTTP: DELETE /v1/llms/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the LLM to delete
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;void&gt;

Example

await client.llms.delete("your-llm-id");

client.llms.get

client.llms.get(id: string, requestOptions?: RequestOptions): Promise<LLMResponseShape>

Retrieves the details of a specific LLM configuration by its unique identifier. Requires READ_LLM_OWN permission for LLMs you own (or READ_LLM_ANY for admin users to view any user's LLMs). This is a read-only operation with no side effects.

HTTP: GET /v1/llms/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the LLM to retrieve
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;LLMResponseShape&gt;

Example

const fetchedLlm = await client.llms.get("your-llm-id");
console.log(fetchedLlm.displayName);

client.llms.list

client.llms.list(options?: LlmsListOptions, requestOptions?: RequestOptions): Promise<Array<LLMResponseShape>>

Retrieves a list of LLM configurations accessible to the caller, with optional filtering. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production). PERMISSION-BASED FILTERING: With LIST_LLM_OWN permission, you can only see your own LLMs (ownerId filter is ignored if set to another user). With LIST_LLM_ANY permission, you can see all LLMs or filter by any ownerId. This is a read-only operation with no side effects.

HTTP: GET /v1/llms

Parameters

ParameterTypeDescription
optionsLlmsListOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Array&lt;LLMResponseShape&gt;&gt;

Example

for (const item of await client.llms.list()) {
  console.log(item.llmId, item.displayName);
}

client.llms.update

client.llms.update(id: string, request: LLMUpdateRequest, requestOptions?: RequestOptions): Promise<LLMResponseShape>

Updates an existing LLM configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. SUPPORTED_MODALITIES UPDATE: If the array contains >=1 elements, it replaces the stored set; if empty or omitted, no change occurs and it does not count as an update by itself. IMPORTANT: providerType is IMMUTABLE after creation and cannot be changed. Requires UPDATE_LLM_OWN permission for LLMs you own (or UPDATE_LLM_ANY for admin users).

HTTP: PUT /v1/llms/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the LLM to update
requestLLMUpdateRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;LLMResponseShape&gt;

Example

const updatedLlm = await client.llms.update("your-llm-id", {
  displayName: "Doc LLM (updated)",
  mergeLabels: { version: "2" },
});
console.log(updatedLlm.llmId);

Data Models

Enum Values

LLMProviderType

OPENAI, LITELLM_PROXY, OPEN_ROUTER, VLLM, OLLAMA, LLAMA_CPP, CUSTOM_OPENAI_COMPATIBLE

Interfaces

CreateLLMResponse

Response containing the created LLM and any informational status messages

FieldTypeRequiredDescription
llmLLMResponseyesThe created LLM configuration
statusesArray&lt;GoodMemStatus&gt;noOptional status messages providing information about server-side operations performed during creation, such as capability inference results

LLMCapabilities

Capabilities and features supported by an LLM service

FieldTypeRequiredDescription
supportsChatboolean | nullnoSupports conversational/chat completion format with message roles
supportsCompletionboolean | nullnoSupports raw text completion with prompt continuation
supportsFunctionCallingboolean | nullnoSupports function/tool calling with structured responses
supportsSystemMessagesboolean | nullnoSupports system prompts to define model behavior and context
supportsStreamingboolean | nullnoSupports real-time token streaming during generation
supportsSamplingParametersboolean | nullnoSupports sampling parameters like temperature, top_p, and top_k for generation control

LLMCreationRequest

Request body for creating a new LLM. An LLM represents a configuration for text generation services.

FieldTypeRequiredDescription
displayNamestringyesUser-facing name of the LLM
descriptionstring | nullnoDescription of the LLM
providerTypeLLMProviderTypeyesType of LLM provider
endpointUrlstringyesAPI endpoint base URL (OpenAI-compatible base, typically ends with /v1)
apiPathstring | nullnoAPI path for chat/completions request (defaults to /chat/completions if not provided)
modelIdentifierstringyesModel identifier
supportedModalitiesArray&lt;Modality&gt; | nullnoSupported content modalities (defaults to TEXT if not provided)
credentialsEndpointAuthentication | nullnoStructured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers.
labelsRecord&lt;string, string&gt; | nullnoUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
capabilitiesLLMCapabilities | nullnoLLM capabilities defining supported features and modes. Optional - server infers capabilities from model identifier if not provided.
defaultSamplingParamsLLMSamplingParams | nullnoDefault sampling parameters for generation requests
maxContextLengthnumber | nullnoMaximum context window size in tokens
clientConfigRecord&lt;string, unknown&gt; | nullnoProvider-specific client configuration as flexible JSON structure
ownerIdstring | nullnoOptional owner ID. If not provided, derived from the authentication context. Requires CREATE_LLM_ANY permission if specified.
llmIdstring | nullnoOptional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use.

LLMResponse

LLM configuration information

FieldTypeRequiredDescription
llmIdstringyesUnique identifier of the LLM
displayNamestringyesUser-facing name of the LLM
descriptionstring | nullnoDescription of the LLM
providerTypeLLMProviderTypeyesType of LLM provider
endpointUrlstringyesAPI endpoint base URL
apiPathstring | nullnoAPI path for chat/completions request
modelIdentifierstringyesModel identifier
supportedModalitiesArray&lt;Modality&gt;yesSupported content modalities
credentialsEndpointAuthentication | nullnoStructured credential payload used for upstream authentication
labelsRecord&lt;string, string&gt;yesUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
capabilitiesLLMCapabilitiesyesLLM capabilities defining supported features and modes
defaultSamplingParamsLLMSamplingParams | nullnoDefault sampling parameters for generation requests
maxContextLengthnumber | nullnoMaximum context window size in tokens
clientConfigRecord&lt;string, unknown&gt; | nullnoProvider-specific client configuration
ownerIdstringyesOwner ID of the LLM
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the LLM
updatedByIdstringyesID of the user who last updated the LLM

LLMSamplingParams

Sampling and generation parameters for controlling LLM text output

FieldTypeRequiredDescription
maxTokensnumber | nullnoMaximum tokens to generate (>0 if set; provider-dependent limits apply)
temperaturenumber | nullnoSampling temperature; valid range depends on the configured provider
topPnumber | nullnoNucleus sampling threshold 0.0-1.0 (smaller values focus on higher probability tokens)
topKnumber | nullnoTop-k sampling limit (>0 if set; primarily for local/open-source models)
frequencyPenaltynumber | nullnoFrequency penalty; valid range depends on the configured provider
presencePenaltynumber | nullnoPresence penalty; valid range depends on the configured provider
stopSequencesArray&lt;string&gt; | nullnoGeneration stop sequences; generation halts on exact match

LLMUpdateRequest

Request body for updating an existing LLM. All fields are optional - only specified fields will be updated. supportedModalities replaces the stored set only when the array contains at least one value; empty or omitted leaves it unchanged and does not count as an update by itself.

FieldTypeRequiredDescription
displayNamestring | nullnoUpdate display name
descriptionstring | nullnoUpdate description
endpointUrlstring | nullnoUpdate endpoint base URL (OpenAI-compatible base, typically ends with /v1)
apiPathstring | nullnoUpdate API path
modelIdentifierstring | nullnoUpdate model identifier (cannot be empty)
supportedModalitiesArray&lt;Modality&gt; | nullnoUpdate supported modalities (if array contains >=1 elements, replaces stored set; if empty or omitted, no change and does not count as an update by itself)
credentialsEndpointAuthentication | nullnoUpdate credentials
versionstring | nullnoUpdate version information
monitoringEndpointstring | nullnoUpdate monitoring endpoint URL
capabilitiesLLMCapabilities | nullnoUpdate LLM capabilities (replaces entire capability set; clients MUST send all flags)
defaultSamplingParamsLLMSamplingParams | nullnoUpdate default sampling parameters
maxContextLengthnumber | nullnoUpdate maximum context window size in tokens
clientConfigRecord&lt;string, unknown&gt; | nullnoUpdate provider-specific client configuration (replaces entire config; no merging)
replaceLabelsRecord&lt;string, string&gt; | nullnoReplace all existing labels with this set. Empty map clears all labels. Cannot be used with mergeLabels.
mergeLabelsRecord&lt;string, string&gt; | nullnoMerge with existing labels: upserts with overwrite. Labels not mentioned are preserved. Cannot be used with replaceLabels.

ListLLMsResponse

Response containing a list of LLM configurations

FieldTypeRequiredDescription
llmsArray&lt;LLMResponse&gt;yesList of LLM configurations matching the request filters

Response Shapes

Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.

CreateLLMResponseShape

FieldTypeRequiredDescription
llmLLMResponseShapeyesThe created LLM configuration
statusesArray&lt;GoodMemStatusResponseShape&gt;noOptional status messages providing information about server-side operations performed during creation, such as capability inference results

LLMCapabilitiesResponseShape

FieldTypeRequiredDescription
supportsChatboolean | nullnoSupports conversational/chat completion format with message roles
supportsCompletionboolean | nullnoSupports raw text completion with prompt continuation
supportsFunctionCallingboolean | nullnoSupports function/tool calling with structured responses
supportsSystemMessagesboolean | nullnoSupports system prompts to define model behavior and context
supportsStreamingboolean | nullnoSupports real-time token streaming during generation
supportsSamplingParametersboolean | nullnoSupports sampling parameters like temperature, top_p, and top_k for generation control

LLMResponseShape

FieldTypeRequiredDescription
llmIdstringyesUnique identifier of the LLM
displayNamestringyesUser-facing name of the LLM
descriptionstring | nullnoDescription of the LLM
providerTypeLLMProviderType | nullyesType of LLM provider
endpointUrlstringyesAPI endpoint base URL
apiPathstring | nullnoAPI path for chat/completions request
modelIdentifierstringyesModel identifier
supportedModalitiesArray&lt;Modality | null&gt;yesSupported content modalities
credentialsEndpointAuthenticationResponseShape | nullnoStructured credential payload used for upstream authentication
labelsRecord&lt;string, string&gt;yesUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
capabilitiesLLMCapabilitiesResponseShapeyesLLM capabilities defining supported features and modes
defaultSamplingParamsLLMSamplingParamsResponseShape | nullnoDefault sampling parameters for generation requests
maxContextLengthnumber | nullnoMaximum context window size in tokens
clientConfigRecord&lt;string, unknown&gt; | nullnoProvider-specific client configuration
ownerIdstringyesOwner ID of the LLM
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the LLM
updatedByIdstringyesID of the user who last updated the LLM

LLMSamplingParamsResponseShape

FieldTypeRequiredDescription
maxTokensnumber | nullnoMaximum tokens to generate (>0 if set; provider-dependent limits apply)
temperaturenumber | nullnoSampling temperature; valid range depends on the configured provider
topPnumber | nullnoNucleus sampling threshold 0.0-1.0 (smaller values focus on higher probability tokens)
topKnumber | nullnoTop-k sampling limit (>0 if set; primarily for local/open-source models)
frequencyPenaltynumber | nullnoFrequency penalty; valid range depends on the configured provider
presencePenaltynumber | nullnoPresence penalty; valid range depends on the configured provider
stopSequencesArray&lt;string&gt; | nullnoGeneration stop sequences; generation halts on exact match

ListLLMsResponseShape

FieldTypeRequiredDescription
llmsArray&lt;LLMResponseShape&gt;yesList of LLM configurations matching the request filters