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

# Fine tune a model



## OpenAPI

````yaml post /fine_tuned_models
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /fine_tuned_models:
    post:
      tags:
        - fine_tuned_models
      summary: Create Fine Tune Model
      operationId: create_fine_tune_model_fine_tuned_models_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FineTuneRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTunedModelResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
        - APIKeyHeader: []
components:
  schemas:
    FineTuneRequest:
      properties:
        base_model:
          type: string
          title: Base Model
        input_config:
          $ref: '#/components/schemas/FineTuneInputConfig'
        config:
          $ref: '#/components/schemas/LagLlamaFineTuningConfig'
      type: object
      required:
        - base_model
        - input_config
        - config
      title: FineTuneRequest
    FineTunedModelResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          $ref: '#/components/schemas/FineTunedStatus'
        config:
          $ref: '#/components/schemas/LagLlamaFineTuningConfig'
        input_config:
          $ref: '#/components/schemas/FineTuneInputConfig'
        base_model:
          type: string
          title: Base Model
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
          title: Updated At
      type: object
      required:
        - id
        - status
        - config
        - input_config
        - base_model
        - created_at
        - updated_at
      title: FineTunedModelResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FineTuneInputConfig:
      properties:
        dataset_ids:
          anyOf:
            - items:
                type: string
              type: array
          title: Dataset Ids
        dataset_tags:
          anyOf:
            - items:
                type: string
              type: array
          title: Dataset Tags
        series_ids:
          anyOf:
            - items:
                type: string
              type: array
          title: Series Ids
        series:
          anyOf:
            - items:
                $ref: '#/components/schemas/SeriesItem'
              type: array
          title: Series
      type: object
      title: FineTuneInputConfig
    LagLlamaFineTuningConfig:
      properties:
        context_length:
          type: integer
          title: Context Length
        prediction_length:
          type: integer
          title: Prediction Length
        use_rope_scaling:
          type: boolean
          title: Use Rope Scaling
        num_samples:
          type: integer
          title: Num Samples
        max_epochs:
          type: integer
          title: Max Epochs
      type: object
      required:
        - context_length
        - prediction_length
        - use_rope_scaling
        - num_samples
        - max_epochs
      title: LagLlamaFineTuningConfig
    FineTunedStatus:
      type: string
      enum:
        - QUEUED
        - IN_PROGRESS
        - COMPLETED
        - FAILED
      title: FineTunedStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SeriesItem:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        value:
          type: number
          title: Value
        metadata:
          type: object
          title: Metadata
      type: object
      required:
        - timestamp
        - value
      title: SeriesItem
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.