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.

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.

PUT
/v1/llms/{id}
x-api-key<token>

In: header

Path Parameters

idstring

The unique identifier of the LLM to update

LLM update details

displayName?string | null

Update display name

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

Update description

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

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

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

Update API path

Example"/chat/completions"
modelIdentifier?string | null

Update model identifier (cannot be empty)

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

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?ApiKey (CREDENTIAL_KIND_API_KEY) | GcpAdc (CREDENTIAL_KIND_GCP_ADC) | None (omit this field)

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"}}

Structured credential payload describing how GoodMem should authenticate with an upstream provider.

kindstring

Credential strategy — fixed to CREDENTIAL_KIND_API_KEY for this variant

apiKeyApiKeyAuth

Configuration when kind is CREDENTIAL_KIND_API_KEY

Example{"inlineSecret":"sk-1234567890abcdef","secretRef":{"uri":"vault://path/to/secret"},"headerName":"Authorization","prefix":"Bearer "}
labels?object | null

Optional annotations to aid operators (e.g., "owner=vertex")

Propertiesproperties <= 20

Empty Object

Structured credential payload describing how GoodMem should authenticate with an upstream provider.

kindstring

Credential strategy — fixed to CREDENTIAL_KIND_GCP_ADC for this variant

gcpAdcGcpAdcAuth

Configuration when kind is CREDENTIAL_KIND_GCP_ADC

Example{"scopes":["https://www.googleapis.com/auth/cloud-platform"],"quotaProjectId":"my-quota-project"}
labels?object | null

Optional annotations to aid operators (e.g., "owner=vertex")

Propertiesproperties <= 20

Empty Object

version?string | null

Update version information

Example"2.0.1"
monitoringEndpoint?string | null

Update monitoring endpoint URL

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

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?LLMSamplingParams | null

Update default sampling parameters

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

Update maximum context window size in tokens

Example32768
Formatint32
Range1 <= value
clientConfig?object | null

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

Empty Object

replaceLabels?object | null

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

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

Empty Object

mergeLabels?object | null

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

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

Empty Object

Response Body

curl -X PUT "https://your-goodmem-server.example.com/v1/llms/550e8400-e29b-41d4-a716-446655440000" \  -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"    }  }'
{
  "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"
}
Empty
Empty
Empty
Empty
Empty