GoodMemGoodMem
ReferenceAPIREST APILLMs

Update an LLM

PUT /v1/llms/{id}: Updates an existing LLM configuration including display information, endpoint configuration, model parameters, credentials, and labels.

PUT
/v1/llms/{id}

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 on the requested LLM.

Authorization

ApiKeyAuth
headerx-api-key<token>

Path Parameters

id*string

The unique identifier of the LLM to update

Header Parameters

GoodMem-Timeout-Ms?integer

Optional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.

Formatint64
Range1 <= value <= 86400000

Request Body

LLM update details

application/json
  1. body

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.

displayName?|

Update display name

Lengthlength <= 255
Example"Updated GPT-4 Turbo"
description?|

Update description

Example"Updated OpenAI's GPT-4 Turbo model for enhanced chat completions"
endpointUrl?|

Update endpoint base URL (OpenAI-compatible base, typically ends with /v1)

Example"https://api.openai.com/v1"
apiPath?|

Update API path

Example"/chat/completions"
modelIdentifier?|

Update model identifier (cannot be empty)

Example"gpt-4-turbo-preview"
supportedModalities?array<>|

Update 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)

Example
[  "TEXT"]
credentials?||

Replace stored credentials. Omit this field to preserve the current credentials; a present empty payload is invalid and never clears them.

Example
{  "kind": "CREDENTIAL_KIND_API_KEY",  "apiKey": {    "inlineSecret": "sk-rotated-llm-key"  }}
version?|

Update version information

Example"2.0.1"
monitoringEndpoint?|

Update monitoring endpoint URL

Example"https://monitoring.company.com/llms/status"
capabilities?|

Update LLM capabilities (replaces entire capability set; clients MUST send all flags)

Example
{  "supportsChat": true,  "supportsCompletion": true,  "supportsFunctionCalling": true,  "supportsSystemMessages": true,  "supportsStreaming": true,  "supportsSamplingParameters": true}
defaultSamplingParams?|

Update default sampling parameters

Example
{  "maxTokens": 2048,  "temperature": 0.7,  "topP": 0.9,  "topK": 50,  "frequencyPenalty": 0,  "presencePenalty": 0,  "stopSequences": [    "\n\n",    "END"  ]}
maxContextLength?|

Update maximum context window size in tokens

Formatint32
Range1 <= value
Example32768
clientConfig?|

Update provider-specific client configuration (replaces entire config; no merging)

replaceLabels?|

Replace all existing labels with this set. Empty map clears all labels. Cannot be used with mergeLabels.

Propertiesproperties <= 20
Example
{  "environment": "production",  "team": "ml-platform"}
mergeLabels?|

Merge with existing labels: upserts with overwrite. Labels not mentioned are preserved. Cannot be used with replaceLabels.

Propertiesproperties <= 20
Example
{  "cost-center": "ai-infrastructure"}
dashscopeApiDialect?|

Update the DashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to preserve the stored dialect. Changing apiPath to a recognized canonical DashScope dialect infers its matching dialect; a custom path preserves an existing dialect, while a legacy null dialect is inferred.

Example"LLM_NATIVE_TEXT"
Value in"LLM_NATIVE_TEXT""LLM_NATIVE_MULTIMODAL""OPENAI_COMPATIBLE"

Response Body

Successfully updated LLM

application/json
  1. response

LLM configuration information

llmId*string

Unique identifier of the LLM

Formatuuid
Example"550e8400-e29b-41d4-a716-446655440000"
displayName*string

User-facing name of the LLM

Example"GPT-4 Turbo"
description?|

Description of the LLM

Example"OpenAI's GPT-4 Turbo model for chat completions"
providerType*LLMProviderType

Type of LLM provider

Example"OPENAI"
Value in"OPENAI""LITELLM_PROXY""OPEN_ROUTER""DASHSCOPE""VLLM""OLLAMA""LLAMA_CPP""CUSTOM_OPENAI_COMPATIBLE"
endpointUrl*string

API endpoint base URL

Example"https://api.openai.com/v1"
apiPath?|

API path for chat/completions request

Example"/chat/completions"
modelIdentifier*string

Model identifier

Example"gpt-4-turbo-preview"
supportedModalities*array<>

Supported content modalities

credentials?||

Stored credentials; present only when GetLLM explicitly requests them and the caller has READ_LLM_CREDENTIALS. Always omitted from create, update, and list responses.

Example
{  "apiKey": {    "inlineSecret": "sk-1234567890abcdef",    "secretRef": {      "uri": "vault://path/to/secret"    },    "headerName": "Authorization",    "prefix": "Bearer "  },  "gcpAdc": {    "scopes": [      "https://www.googleapis.com/auth/cloud-platform"    ],    "quotaProjectId": "my-quota-project"  }}
labels*

User-defined labels for categorization

Example
{  "environment": "production",  "team": "ai"}
version?|

Version information

Example"1.0.0"
monitoringEndpoint?|

Monitoring endpoint URL

Example"https://monitoring.example.com/llms/status"
capabilities*

LLM capabilities defining supported features and modes

defaultSamplingParams?|

Default sampling parameters for generation requests

Example
{  "maxTokens": 2048,  "temperature": 0.7,  "topP": 0.9,  "topK": 50,  "frequencyPenalty": 0,  "presencePenalty": 0,  "stopSequences": [    "\n\n",    "END"  ]}
maxContextLength?|

Maximum context window size in tokens

Formatint32
Range1 <= value
Example32768
clientConfig?|

Provider-specific client configuration

ownerId*string

Owner ID of the LLM

Formatuuid
Example"550e8400-e29b-41d4-a716-446655440000"
createdAt*integer

Creation timestamp (milliseconds since epoch)

Formatint64
Example1617293472000
updatedAt*integer

Last update timestamp (milliseconds since epoch)

Formatint64
Example1617293472000
createdById*string

ID of the user who created the LLM

Formatuuid
Example"550e8400-e29b-41d4-a716-446655440000"
updatedById*string

ID of the user who last updated the LLM

Formatuuid
Example"550e8400-e29b-41d4-a716-446655440000"
dashscopeApiDialect?|

Configured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect.

Example"LLM_NATIVE_TEXT"
Value in"LLM_NATIVE_TEXT""LLM_NATIVE_MULTIMODAL""OPENAI_COMPATIBLE"
Example Request
curl -X PUT 'https://your-goodmem-server.example.com/v1/llms/550e8400-e29b-41d4-a716-446655440000' \  -H 'GoodMem-Timeout-Ms: 30000' \  -H 'Content-Type: application/json' \  -d '{  "displayName": "Updated GPT-4 Turbo",  "description": "Updated OpenAI GPT-4 Turbo with enhanced configuration for production use",  "endpointUrl": "https://api.openai.com/v1",  "apiPath": "/chat/completions",  "modelIdentifier": "gpt-4-turbo-preview",  "supportedModalities": [    "TEXT"  ],  "credentials": {    "apiKey": {      "inlineSecret": "sk-updated-api-key-here",      "secretRef": {        "uri": "vault://path/to/secret"      },      "headerName": "Authorization",      "prefix": "Bearer "    },    "kind": "CREDENTIAL_KIND_API_KEY"  },  "version": "2.0.1",  "monitoringEndpoint": "https://monitoring.company.com/llms/status",  "capabilities": {    "supportsChat": true,    "supportsCompletion": true,    "supportsFunctionCalling": true,    "supportsSystemMessages": true,    "supportsStreaming": true,    "supportsSamplingParameters": true  },  "defaultSamplingParams": {    "maxTokens": 2048,    "temperature": 0.7,    "topP": 0.9,    "topK": 50,    "frequencyPenalty": 0,    "presencePenalty": 0,    "stopSequences": [      "\n\n",      "END"    ]  },  "maxContextLength": 32768,  "replaceLabels": {    "environment": "production",    "team": "ml-platform",    "cost-center": "ai-infrastructure"  },  "mergeLabels": {    "cost-center": "ai-infrastructure"  },  "dashscopeApiDialect": "LLM_NATIVE_TEXT"}'
Example Response
{  "llmId": "550e8400-e29b-41d4-a716-446655440000",  "displayName": "GPT-4 Turbo",  "description": "OpenAI's GPT-4 Turbo model for chat completions",  "providerType": "OPENAI",  "endpointUrl": "https://api.openai.com/v1",  "apiPath": "/chat/completions",  "modelIdentifier": "gpt-4-turbo-preview",  "supportedModalities": [    "TEXT"  ],  "credentials": {    "apiKey": {      "inlineSecret": "sk-1234567890abcdef",      "secretRef": {        "uri": "vault://path/to/secret"      },      "headerName": "Authorization",      "prefix": "Bearer "    },    "gcpAdc": {      "scopes": [        "https://www.googleapis.com/auth/cloud-platform"      ],      "quotaProjectId": "my-quota-project"    }  },  "labels": {    "environment": "production",    "team": "ai"  },  "version": "1.0.0",  "monitoringEndpoint": "https://monitoring.example.com/llms/status",  "capabilities": {    "supportsChat": true,    "supportsCompletion": true,    "supportsFunctionCalling": true,    "supportsSystemMessages": true,    "supportsStreaming": true,    "supportsSamplingParameters": true  },  "defaultSamplingParams": {    "maxTokens": 2048,    "temperature": 0.7,    "topP": 0.9,    "topK": 50,    "frequencyPenalty": 0,    "presencePenalty": 0,    "stopSequences": [      "\n\n",      "END"    ]  },  "maxContextLength": 32768,  "clientConfig": {    "property1": {},    "property2": {}  },  "ownerId": "550e8400-e29b-41d4-a716-446655440000",  "createdAt": 1617293472000,  "updatedAt": 1617293472000,  "createdById": "550e8400-e29b-41d4-a716-446655440000",  "updatedById": "550e8400-e29b-41d4-a716-446655440000",  "dashscopeApiDialect": "LLM_NATIVE_TEXT"}