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

# Replace the currently loaded model

> Updates the currently loaded model. First, tries to load the model from the local (note: local to Rasa server) storage system. Secondly, tries to load the model from the provided model server configuration. Last, tries to load the model from the provided remote storage.



## OpenAPI

````yaml /openapi/pro.yaml put /model
openapi: 3.0.1
info:
  title: Rasa - Server Endpoints
  version: 1.0.0
  description: >-
    The Rasa server provides endpoints to retrieve trackers of conversations as
    well as endpoints to modify them. Additionally, endpoints for training and
    testing models are provided.
servers:
  - url: http://localhost:5005
    description: Local development server
security: []
paths:
  /model:
    put:
      tags:
        - Model
      summary: Replace the currently loaded model
      description: >-
        Updates the currently loaded model. First, tries to load the model from
        the local (note: local to Rasa server) storage system. Secondly, tries
        to load the model from the provided model server configuration. Last,
        tries to load the model from the provided remote storage.
      operationId: replaceModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelRequest'
      responses:
        '204':
          description: Model was successfully replaced.
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403NotAuthorized'
        '500':
          $ref: '#/components/responses/500ServerError'
      security:
        - TokenAuth: []
        - JWT: []
components:
  schemas:
    ModelRequest:
      type: object
      properties:
        model_file:
          type: string
          description: Path to model file
          example: /absolute-path-to-models-directory/models/20190512.tar.gz
        model_server:
          $ref: '#/components/schemas/EndpointConfig'
        remote_storage:
          description: Name of remote storage system
          type: string
          example: aws
          enum:
            - aws
            - gcs
            - azure
    EndpointConfig:
      type: object
      properties:
        url:
          type: string
          description: URL pointing to model
        params:
          type: object
          description: Parameters of request
        headers:
          type: object
          description: HTTP headers
        basic_auth:
          description: Basic authentification data
          type: object
        token:
          description: Token
          type: string
        token_name:
          description: Name of token
          type: string
        wait_time_between_pulls:
          type: integer
          description: Time to wait between pulls from model server
    Error:
      type: object
      properties:
        version:
          type: string
          description: Rasa version
        status:
          type: string
          enum:
            - failure
          description: Status of the requested action
        message:
          type: string
          description: Error message
        reason:
          type: string
          description: Error category
        details:
          type: object
          description: Additional error information
        help:
          type: string
          description: Optional URL to additonal material
        code:
          type: number
          description: HTTP status code
  responses:
    400BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: BadRequest
            code: 400
    401NotAuthenticated:
      description: User is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthenticated
            message: User is not authenticated to access resource.
            code: 401
    403NotAuthorized:
      description: User has insufficient permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthorized
            message: User has insufficient permission to access resource.
            code: 403
    500ServerError:
      description: An unexpected error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: ServerError
            message: An unexpected error occurred.
            code: 500
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: query
      name: token
      description: >
        A plaintext token to secure your server, specified at startup in the
        argument `--auth-token thisismysecret`
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A JWT token that is signed using the JWT secret specified at startup in
        the argument `--jwt-secret thisismysecret`,

        using the `HS256` algorithm.


        The token's payload must contain an object under the `user` key,

        which in turn must contain the `username` and `role` attributes.

        The following is an example payload for a JWT token:


        ```json

        {
            "user": {
                "username": "<sender_id>",
                "role": "user"
            }
        }

        ```


        If the `role` is `admin`, all endpoints are accessible.

        If the `role` is `user`, endpoints with a `sender_id` parameter are only
        accessible

        if the `sender_id` matches the payload's `username` property.


        For the user trackers endpoint (`GET /users/{user_id}/trackers`), you
        should use `user_id` instead of `username` in the payload.

        In this case, the path `user_id` parameter is matched against the
        payload's `username` property. For example:


        ```json

        {
            "user": {
                "username": "<user_id>",
                "role": "user"
            }
        }

        ```

````