Skip to main content
POST
/
v1
/
repo
/
{repo_name}
/
bakes
Create Bake
curl --request POST \
  --url http://localhost:8080/v1/repo/{repo_name}/bakes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "<string>",
  "bake_name": "<string>",
  "overrides": {
    "model_name": "<string>",
    "total_trajectories": 123,
    "seed": 123,
    "datasets": [
      {
        "target": "<string>",
        "weight": 1
      }
    ],
    "type": "<string>",
    "micro_batch_size": 123,
    "gradient_accumulation_steps": 123,
    "epochs": 123,
    "model": {
      "type": "<string>",
      "parent_model_name": "<string>",
      "baked_adapter_config": {
        "r": 123,
        "lora_alpha": 123,
        "target_modules": "<string>",
        "lora_dropout": 123,
        "bias": "<string>"
      },
      "dtype": "<string>",
      "save_name": "<string>",
      "attn_implementation": "<string>",
      "disable_activation_checkpoint": false,
      "peft_config": {},
      "student_model_path": "<string>"
    },
    "data": {
      "type": "<string>",
      "sources": [
        {
          "type": "<string>",
          "name_or_path": "<string>",
          "split": "<string>",
          "max_samples": 123,
          "sample_ratio": 123,
          "sample_count": 123,
          "sample_seed": 42,
          "process": true
        }
      ],
      "eval_sources": [
        {
          "type": "<string>",
          "name_or_path": "<string>",
          "split": "<string>",
          "max_samples": 123,
          "sample_ratio": 123,
          "sample_count": 123,
          "sample_seed": 42,
          "process": true
        }
      ],
      "beta": 123,
      "temperature": 123,
      "max_length": 123,
      "train_eval_split": [
        123
      ],
      "cache_dir": "<string>",
      "dl_num_workers": 123,
      "num_proc": 123,
      "seed": 123,
      "use_data_cache": true,
      "cache_fs_type": "<string>"
    },
    "optimizer": {
      "type": "<string>",
      "learning_rate": 123,
      "weight_decay": 1,
      "betas": {
        "[0]": 123,
        "[1]": 123
      }
    },
    "scheduler": {
      "type": "<string>",
      "lr": 123
    },
    "wandb": {
      "enable": true,
      "project": "<string>",
      "name": "<string>",
      "entity": "<string>"
    },
    "deepspeed": {
      "zero_optimization": {
        "stage": 123
      }
    },
    "checkpoint": [
      {
        "type": "<string>",
        "output_dir": "<string>",
        "enabled": true,
        "auto_resume": false,
        "save_every_n_steps": 1,
        "save_every_n_epochs": 1,
        "save_end_of_training": false
      }
    ],
    "train_log_iter_interval": 123,
    "eval_interval": 123,
    "activation_checkpoint_cpu_offload": true
  }
}
'
{
  "config": {
    "epochs": 3,
    "micro_batch_size": 8,
    "model": {
      "baked_adapter_config": {
        "bias": "none",
        "lora_alpha": 32,
        "lora_dropout": 0.05,
        "r": 32,
        "target_modules": "all-linear"
      },
      "type": "bake"
    },
    "type": "single_baker"
  },
  "job_id": 1,
  "loss": {
    "final_loss": 1.395237632095814e-7,
    "latest_loss": 1.395237632095814e-7,
    "max_loss": 0.0000015422701835632324,
    "min_loss": 1.314911060035229e-7
  },
  "model_name": [
    "user/repo/bake_name/183",
    "user/repo/bake_name/100"
  ],
  "progress_percent": 100,
  "status": "complete"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-User-Id
string | null

User ID override via header (requires master API key)

Path Parameters

repo_name
string
required

Query Parameters

user_id
string | null

User ID override (requires master API key)

Body

application/json

Bake create model (includes bake_name in body)

template
string
required

Template: 'default' or existing bake name

bake_name
string
required

Name of the bake

overrides
BakeConfigBase · object

Fields to override from template

Response

Bake created successfully

Bake response: Inherits all fields from JobStatus

status
string
required

Job status: not_started, running, complete, failed

lines
integer | null

Number of output lines (not applicable for bakes)

config
Config · object

Job config parameters

error
string | null

Error message if job failed

job_id
integer | null

Coordinator job ID (if job is queued/running)

progress_percent
number | null

Job progress percentage (0-100) if job is running

model_name
string[] | null

List of model names in format 'user/repo/bake_name/checkpoint'. Index 0 is the latest checkpoint. Only present when status is 'complete'

loss
Loss · object

Loss values from training. Contains 'latest_loss', 'final_loss', 'min_loss', 'max_loss'. Present when status is 'running' or 'complete' and metrics are available