> ## 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.

# Create a custom model

> Register a new custom ML model for the authenticated user's company. The litellm_model field is immutable after creation. For OpenAI-compatible endpoints (LM Studio, Ollama), prefix with 'openai/' (e.g. 'openai/llama3'). An optional temperature is applied to every request sent to this model, in place of whatever the calling feature would otherwise use. Some models accept exactly one temperature and are set to it regardless of what is submitted; the model catalogue reports that value as required_temperature. Requires company admin role.



## OpenAPI

````yaml /api-reference/openapi-v3-company.yaml post /api/v3/company/models
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:
    post:
      tags:
        - Models
      summary: Create a custom model
      description: >-
        Register a new custom ML model for the authenticated user's company. The
        litellm_model field is immutable after creation. For OpenAI-compatible
        endpoints (LM Studio, Ollama), prefix with 'openai/' (e.g.
        'openai/llama3'). An optional temperature is applied to every request
        sent to this model, in place of whatever the calling feature would
        otherwise use. Some models accept exactly one temperature and are set to
        it regardless of what is submitted; the model catalogue reports that
        value as required_temperature. Requires company admin role.
      operationId: api_v3_company_models_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomMLModelCreateRequest'
            examples:
              LMStudioModel:
                value:
                  name: Gemma 4 (local LM Studio)
                  litellm_model: openai/google/gemma-4-e4b
                  model_type: Large Language Model
                  endpoint: http://host.docker.internal:1234/v1
                  api_key: null
                  temperature: 0.2
                summary: LM Studio model
              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/CustomMLModelCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomMLModelCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                LMStudioModel:
                  value:
                    name: Gemma 4 (local LM Studio)
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    api_key: null
                    temperature: 0.2
                  summary: LM Studio model
                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
                CustomModelsUnavailableOnThisDeployment:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: >-
                      This deployment cannot serve company custom models: they
                      are only available when the LiteLLM gateway is the
                      configured model provider.
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Custom models unavailable on this deployment
          description: >-
            Either the requested temperature is above the maximum the model's
            provider accepts (see the update endpoint for the per-provider
            ceilings), or the deployment cannot serve company custom models at
            all.


            The second is only possible here, on registration: it depends on the
            configured model provider, and the same request would succeed on a
            deployment using the LiteLLM gateway. Listing and deleting stay
            available either way, so models registered before a provider change
            can still be cleaned up.
        '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.
        '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:
    CustomMLModelCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name, unique within the company.
        litellm_model:
          type: string
          description: >-
            LiteLLM model string, e.g. 'openai/gpt-4-turbo' or
            'azure/my-deployment'.
        model_type:
          type: string
          default: Large Language Model
          description: Model type (e.g. 'Large Language Model', 'Embedding Model').
        endpoint:
          type:
            - string
            - 'null'
          description: Custom API base URL (api_base in LiteLLM).
        api_key:
          type:
            - string
            - 'null'
          description: API key for the custom model endpoint.
        temperature:
          type:
            - number
            - 'null'
          format: double
          maximum: 2
          minimum: 0
          description: >-
            Sampling temperature to use for every request to this model. Omit to
            let each calling feature use its own value. Models that accept only
            one temperature are set to it regardless of what is submitted here.
      required:
        - litellm_model
        - name
    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.

````