> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lighton.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a custom model

> Update a custom ML model's name or temperature, or promote it to the company default. Everything else is fixed at creation: the litellm_model, the model type, the endpoint, and the API key cannot be changed, because the credential is write-only in the gateway and cannot be rewritten without first being read back. Register a new model to change any of them. A model whose provider accepts exactly one temperature keeps that one whatever is submitted. Requires company admin role.



## OpenAPI

````yaml /api-reference/openapi-v3-company.yaml patch /api/v3/company/models/{uuid}
openapi: 3.1.0
info:
  title: LightOn API
  version: 3.15.0 (v3-company)
  description: >-
    LightOn gives you an API to search, parse, and ingest documents at scale.
    Build knowledge-retrieval pipelines without managing vector databases or OCR
    models.
servers:
  - url: https://paradigm.lighton.ai
security: []
tags:
  - name: Models
    description: Operations about AI models
  - name: Workspaces
    description: Operations about workspaces
  - name: Users
    description: Operations about users
  - name: User Groups
    description: Operations about user groups
  - name: Companies
    description: Operations about companies
paths:
  /api/v3/company/models/{uuid}:
    patch:
      tags:
        - Models
      summary: Update a custom model
      description: >-
        Update a custom ML model's name or temperature, or promote it to the
        company default. Everything else is fixed at creation: the
        litellm_model, the model type, the endpoint, and the API key cannot be
        changed, because the credential is write-only in the gateway and cannot
        be rewritten without first being read back. Register a new model to
        change any of them. A model whose provider accepts exactly one
        temperature keeps that one whatever is submitted. Requires company admin
        role.
      operationId: api_v3_company_models_partial_update
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
            examples:
              CustomModel:
                value:
                  id: a08cff52-1a96-49f4-9f28-84a060b9264c
                  name: Gemma 4 (local LM Studio)
                  technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                  litellm_model: openai/google/gemma-4-e4b
                  model_type: Large Language Model
                  endpoint: http://host.docker.internal:1234/v1
                  enabled: true
                  is_default: false
                  temperature: 0.2
                  required_temperature: null
                  max_temperature: null
                summary: Custom model
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                CustomModel:
                  value:
                    id: a08cff52-1a96-49f4-9f28-84a060b9264c
                    name: Gemma 4 (local LM Studio)
                    technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    enabled: true
                    is_default: false
                    temperature: 0.2
                    required_temperature: null
                    max_temperature: null
                  summary: Custom model
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                AboveTheProviderMaximum:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: >-
                      Temperature 1.5 is above the maximum of 1.0 accepted by
                      this model's provider.
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Above the provider maximum
          description: >-
            The requested temperature is above the maximum the model's provider
            accepts. Anthropic accepts up to 1.0; OpenAI and Gemini up to 2.0. A
            model served from its own endpoint is not bound by the provider
            named in its routing string.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: Admin access required.
                    doc_url: >-
                      https://developers.lighton.ai/errors#insufficient_permissions
          description: >-
            Admin access required. Only company admins and superadmins can write
            custom models.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: >-
                      Custom model a08cff52-1a96-49f4-9f28-84a060b9264c not
                      found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not found
          description: >-
            Custom model not found or does not belong to the authenticated
            user's company.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                MissingRequiredField:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      litellm_model:
                        - error: required
                          detail: Field required
                  summary: Missing required field
                DuplicateName:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      name:
                        - error: already_exists
                          detail: >-
                            A custom model named 'My GPT-4' already exists for
                            this company.
                  summary: Duplicate name
          description: >-
            A required field is missing, a field holds a value of the wrong
            type, or the name collides with an existing custom model in the same
            company.
        '503':
          description: >-
            API is under maintenance. Check `GET /api/v3/system/status` for
            active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
      security:
        - bearerAuth: []
components:
  schemas:
    PatchedCustomMLModelUpdateRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Display name, unique within the company.
        is_default:
          type:
            - boolean
            - 'null'
          description: Set to true to mark this as the company's default custom model.
        temperature:
          type:
            - number
            - 'null'
          format: double
          maximum: 2
          minimum: 0
          description: >-
            Sampling temperature to use for every request to this model. A model
            that accepts only one temperature keeps that one whatever is
            submitted here.
    CustomMLModelResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique ID for this custom model.
        name:
          type: string
          description: Display name, unique within the company.
        technical_name:
          type: string
          description: LiteLLM identifier (custom-{uuid}).
        litellm_model:
          type: string
          description: LiteLLM model string, e.g. 'openai/gpt-4-turbo'.
        model_type:
          type: string
          description: Model type.
        endpoint:
          type:
            - string
            - 'null'
          description: Custom API base URL.
        enabled:
          type: boolean
          description: Whether the model is active.
        is_default:
          type: boolean
          description: Whether this is the company's default custom model.
        temperature:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Sampling temperature sent for every request to this model. Null
            means no temperature is configured and the calling feature's own
            value is used.
        required_temperature:
          type:
            - number
            - 'null'
          format: double
          description: >-
            The only temperature this model accepts, when it accepts exactly
            one. Set for models that have removed sampling parameters; null for
            every other model.
        max_temperature:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Highest temperature this model's provider accepts. Null for a model
            served from its own endpoint, where no provider bound applies.
      required:
        - enabled
        - id
        - is_default
        - litellm_model
        - model_type
        - name
        - technical_name
    APIV3ErrorResponse:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            Job/resource id when one already exists (useful for async error
            diagnosis); null otherwise.
        code:
          type: integer
          description: HTTP status code
        error:
          type: string
          description: Error code used by the UI as a translation key
        detail:
          type: string
          description: Human-readable error message for developers
        doc_url:
          type: string
          description: Link to the error-code documentation page
      required:
        - code
        - detail
        - doc_url
        - error
        - id
    ServiceMaintenance503:
      type: object
      description: >-
        Returned by the maintenance middleware when the requested endpoint is
        blocked.
      required:
        - detail
        - error
        - mode
      properties:
        detail:
          type: string
          example: System is under maintenance.
        error:
          type: string
          example: service_maintenance
        mode:
          type: string
          enum:
            - full_shutdown
            - warning_banner
          description: >-
            `full_shutdown` blocks all traffic; `warning_banner` also blocks and
            shows a dismissible toast.
        reason:
          type: string
          description: Operator-supplied maintenance reason, if any.
        started_at:
          type: string
          format: date-time
        endpoint_category_names:
          type: array
          items:
            type: string
          description: >-
            Non-empty only for category-scoped periods. Empty means all
            endpoints are affected.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````