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

# Create fine-tuning job

> Create a new fine-tuning job using the specified base model and training files.

Create a fine-tuning job by specifying a `TrainingConfig` and `InfrastructureConfig`. The `TrainingConfig` accepts an optional `lora_config` parameter for parameter-efficient training using low-rank adaptation.

For guidance on configuring LoRA, see [Low-rank adaptation](/flow/sdk/fine-tuning/lora). For the full fine-tuning workflow, see [Create a fine-tuning job](/flow/sdk/fine-tuning/create-fine-tuning-job).


## OpenAPI

````yaml post /v1/flow/fine-tune
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.87.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/flow/fine-tune:
    post:
      tags:
        - Fine-tuning
      summary: Create fine-tuning job
      description: >-
        Create a new fine-tuning job using the specified base model and training
        files.
      operationId: fine_tune_v1_flow_fine_tune_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestConfig'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    RequestConfig:
      properties:
        project_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Project Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        training_config:
          $ref: '#/components/schemas/TrainingConfig'
        infrastructure_config:
          $ref: '#/components/schemas/InfrastructureConfig'
      type: object
      required:
        - training_config
        - infrastructure_config
      title: RequestConfig
    FinetuneResponse:
      additionalProperties: true
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TrainingConfig:
      properties:
        training_files:
          items:
            type: string
          type: array
          title: Training Files
        model:
          type: string
          title: Model
        n_epochs:
          type: integer
          title: N Epochs
        learning_rate:
          type: number
          title: Learning Rate
        n_checkpoints:
          anyOf:
            - type: integer
            - type: 'null'
          title: N Checkpoints
        batch_size:
          type: integer
          maximum: 1024
          minimum: 1
          title: Batch Size
        experiment_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Experiment Name
        max_length:
          type: integer
          title: Max Length
          default: 2500
        pre_train:
          type: boolean
          title: Pre Train
          default: false
        fine_tune_type:
          $ref: '#/components/schemas/FineTuneType'
          default: STANDARD
        lora_config:
          anyOf:
            - $ref: '#/components/schemas/LoRAConfig'
            - type: 'null'
        reward_components:
          anyOf:
            - $ref: '#/components/schemas/RewardComponents'
            - type: 'null'
        beta:
          anyOf:
            - type: number
            - type: 'null'
          title: Beta
        loss_type:
          anyOf:
            - type: string
              enum:
                - SIGMOID
                - HINGE
                - IPO
                - KTO_PAIR
            - type: 'null'
          title: Loss Type
        gradient_checkpointing:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Gradient Checkpointing
      additionalProperties: true
      type: object
      required:
        - training_files
        - model
        - n_epochs
        - learning_rate
        - batch_size
      title: TrainingConfig
    InfrastructureConfig:
      properties:
        accel_type:
          $ref: '#/components/schemas/AcceleratorType'
        n_accel:
          type: integer
          title: N Accel
        n_node:
          type: integer
          title: N Node
          default: 1
      additionalProperties: true
      type: object
      required:
        - accel_type
        - n_accel
      title: InfrastructureConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FineTuneType:
      type: string
      enum:
        - STANDARD
        - PREFERENCE
        - GRPO
        - REINFORCEMENT
      title: FineTuneType
    LoRAConfig:
      properties:
        r:
          type: integer
          exclusiveMinimum: 0
          title: R
          description: Rank of the update matrices.
          default: 8
        alpha:
          type: integer
          exclusiveMinimum: 0
          title: Alpha
          description: Scaling factor applied to LoRA updates.
          default: 32
        dropout:
          type: number
          maximum: 1
          minimum: 0
          title: Dropout
          description: Fraction of LoRA neurons dropped during training.
          default: 0.1
        bias:
          type: string
          enum:
            - none
            - all
            - lora_only
          title: Bias
          description: Bias terms to train; choose from 'none', 'all', or 'lora_only'.
          default: none
        extras:
          additionalProperties: true
          type: object
          title: Extras
      additionalProperties: true
      type: object
      title: LoRAConfig
    RewardComponents:
      properties:
        format_reward_weight:
          type: number
          maximum: 1
          exclusiveMinimum: 0
          title: Format Reward Weight
          default: 0.1
        graders:
          items:
            oneOf:
              - $ref: '#/components/schemas/FormatCheckGrader'
              - $ref: '#/components/schemas/MathAccuracyGrader'
              - $ref: '#/components/schemas/StringCheckGrader'
              - $ref: '#/components/schemas/TextSimilarityGrader'
              - $ref: '#/components/schemas/LLMGrader'
            discriminator:
              propertyName: type
              mapping:
                format_check:
                  $ref: '#/components/schemas/FormatCheckGrader'
                llm:
                  $ref: '#/components/schemas/LLMGrader'
                math_accuracy:
                  $ref: '#/components/schemas/MathAccuracyGrader'
                string_check:
                  $ref: '#/components/schemas/StringCheckGrader'
                text_similarity:
                  $ref: '#/components/schemas/TextSimilarityGrader'
          type: array
          minItems: 1
          title: Graders
      additionalProperties: true
      type: object
      required:
        - graders
      title: RewardComponents
    AcceleratorType:
      type: string
      enum:
        - GAUDI2
        - GAUDI3
        - A100
        - A10
        - H100
        - MI300X
      title: AcceleratorType
    FormatCheckGrader:
      properties:
        type:
          type: string
          const: format_check
          title: Type
          default: format_check
        weight:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight
      type: object
      title: FormatCheckGrader
      description: Format-compliance grader. Carries no operation or config.
    MathAccuracyGrader:
      properties:
        type:
          type: string
          const: math_accuracy
          title: Type
          default: math_accuracy
        weight:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight
      type: object
      title: MathAccuracyGrader
      description: Math-correctness grader. Carries no operation or config.
    StringCheckGrader:
      properties:
        type:
          type: string
          const: string_check
          title: Type
          default: string_check
        weight:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight
        operation:
          $ref: '#/components/schemas/StringOperation'
      type: object
      required:
        - operation
      title: StringCheckGrader
      description: String-comparison grader. Requires a StringOperation.
    TextSimilarityGrader:
      properties:
        type:
          type: string
          const: text_similarity
          title: Type
          default: text_similarity
        weight:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight
        operation:
          $ref: '#/components/schemas/TextSimilarityOperation'
      type: object
      required:
        - operation
      title: TextSimilarityGrader
      description: Text-similarity grader. Requires a TextSimilarityOperation.
    LLMGrader:
      properties:
        type:
          type: string
          const: llm
          title: Type
          default: llm
        weight:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight
        seed:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Seed
        top_p:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Top P
        temperature:
          type: number
          maximum: 1.5
          minimum: 0
          title: Temperature
          default: 0
        max_completion_tokens:
          type: integer
          minimum: 1
          title: Max Completion Tokens
          default: 512
      type: object
      title: LLMGrader
      description: >-
        LLM-as-a-judge grader.


        The user-facing generation parameters live directly on the grader (no
        nested

        config). The training service injects operational settings (inference
        endpoint,

        concurrency, timeouts) at runtime; those are not exposed to API users
        here.
    StringOperation:
      type: string
      enum:
        - equals
        - not_equals
        - contains
        - case_insensitive_contains
      title: StringOperation
    TextSimilarityOperation:
      type: string
      enum:
        - bleu
        - rouge
      title: TextSimilarityOperation
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Seekr API Key without 'Bearer' Prefix
      in: header
      name: Authorization

````