Skip to content
Hayonix

API reference · Schema

CreateFineTuneRequest

  • modelstringrequired

    A fine-tunable base model (GET /v1/fine-tunes/base-models): slug or ID

    1–200 characters

  • training_file_idstringrequired

    ID of the training file

    ID with prefix file_

  • validation_file_idstring | null

    ID of the validation file

    ID with prefix file_

  • Default supervised

  • Default LoRA

  • Show 11 fields of hyperparameters
    • epochsinteger

      Default 1

      1–20

    • batch_sizeinteger

      Default 8

      1–256

    • gradient_accumulation_stepsinteger

      Batches accumulated per optimizer step (default 1)

      1–64

    • learning_ratenumber

      Default 0.0001

      1e-7–0.01

    • lr_schedulerstring

      How the learning rate changes over the run (default linear)

      One oflinearcosineconstant

    • warmup_rationumber

      Share of the steps over which the learning rate ramps up from 0 (default 0)

      0–0.5

    • weight_decaynumber

      Weight decay (default 0)

      0–1

    • max_grad_normnumber

      Gradients are clipped to this norm (default 1)

      0–100

    • max_seq_lengthinteger

      Longer examples are truncated (default: the model limit, up to 2048)

      32–131072

    • max_stepsinteger | null

      Stop after this many optimizer steps, whatever `epochs` says; null or omitted: no step limit

      1–1000000

    • seedinteger

      Random seed, for repeatable runs (default 42)

      0–2147483647

  • evaluationobject

    Evaluations per epoch on the validation file (default 1)

    Show 1 field of evaluation
    • evals_per_epochinteger

      Times per epoch the validation file is evaluated, 0–20 (default 1); evaluation tokens are billed

      0–20

  • early_stoppingobject | null

    Stop when evaluation loss has not improved for `patience` evaluations

    Show 2 fields of early_stopping
    • patienceinteger

      Evaluations in a row without improvement before training stops (default 2)

      1–50

    • min_deltanumber

      Smallest drop in evaluation loss that counts as an improvement (default 0)

      0–10

  • checkpointsinteger

    Checkpoints saved over the run, the final one included (default 1)

    1–10

  • merge_weightsboolean

    LoRA: also produce merged full weights (default true)

  • continue_from_checkpoint_idstring | null

    Continue training from a checkpoint of an earlier job

    ID with prefix ftc_

  • suffixstring | null

    Lowercase letters, digits and dashes; part of the result model name

    1–40 characters

  • hardwareobject

    Where the job trains: `sku` (default: the base model's first listed SKU) and, for a GPU SKU, `gpu_count` (1–8, default 1; 0 for a CPU SKU). Training is billed per token whatever the hardware.

    Show 2 fields of hardware
    • skustring

      Hardware type code

      1–64 characters

    • gpu_countinteger

      Number of GPUs

      0–8

  • Show 2 fields of integrations
    • wandbobject

      Log training to Weights & Biases (the key is a project secret)

      Show 5 fields of wandb
      • api_key_secret_idstringrequired

        ID of the api key secret

        ID with prefix sec_

      • projectstringrequired

        The Weights & Biases project to log to

        1–128 characters

      • entitystring

        Team or user that owns the project; default: the key owner

        1–128 characters

      • run_namestring

        Name of the run; default: the job ID

        1–128 characters

      • base_urlstring (uri)

        A self-hosted Weights & Biases server; default: the public service

        up to 512 characters

    • hugging_faceobject

      Upload the result to the Hugging Face Hub (the token is a project secret)

      Show 4 fields of hugging_face
      • token_secret_idstringrequired

        ID of the token secret

        ID with prefix sec_

      • repositorystringrequired

        The model repository to upload to, as `<namespace>/<name>`

        3–193 characters

      • privateboolean

        Create the repository as private when it does not exist yet (default true); an existing repository keeps its visibility

      • artifactstring

        What to upload: the LoRA `adapter` (default) or the `merged` full weights

        One ofadaptermerged

Example
{
  "model": "HuggingFaceTB/SmolLM2-135M-Instruct",
  "training_file_id": "file_01jc5zq4m8k3v6x9t2w7r0b1e4",
  "method": {
    "type": "supervised"
  },
  "adapter": {
    "type": "lora",
    "rank": 8
  },
  "hyperparameters": {
    "epochs": 2,
    "learning_rate": 0.0002
  }
}

Used by