Skip to main content
POST
/
api
/
v1
/
serving
/
finetune-jobs
Python (SDK)
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.serving.finetune_jobs.create(name="llama-3-support-lora", base_model="meta-llama/Llama-3.1-8B-Instruct", dataset="<value>", accelerator={
        "type": "H100",
        "fallback": [
            "H100",
            "MI300X",
        ],
    }, output_volume="<value>", method="lora", hyperparameters={
        "epochs": 3,
        "learning_rate": 0.0002,
    })

    # Handle response
    print(res)
{
  "id": "<string>",
  "name": "<string>",
  "base_model": "<string>",
  "method": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "progress": 123,
  "checkpoints": [
    "<string>"
  ],
  "finished_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Body

application/json

Submit a fine-tune.

name
string
required
Example:

"llama-3-support-lora"

base_model
string
required
Example:

"meta-llama/Llama-3.1-8B-Instruct"

dataset
string
required

Volume path or Hugging Face dataset id

accelerator
AcceleratorSpec · object
required

A hardware accelerator request — GPU, NPU, TPU, or similar.

Request an accelerator by type and count, with optional fallback types.

output_volume
string
required

Volume where checkpoints are written

method
enum<string>
default:lora
Available options:
lora,
qlora,
full
image
string | null

Name/ID of a built image; defaults to a stock trainer

secrets
string[]
hyperparameters
Hyperparameters · object
Example:
{ "epochs": 3, "learning_rate": 0.0002 }

Response

Successful Response

A fine-tune job.

id
string
required
name
string
required
status
enum<string>
required
Available options:
queued,
running,
succeeded,
failed,
cancelled
base_model
string
required
method
string
required
created_at
string<date-time>
required
progress
number | null

0.0–1.0 if known

checkpoints
string[]
finished_at
string<date-time> | null