This guide rents GPUs and runs your own training container.
For the managed fine-tuning API that trains platform models from uploaded JSONL files, see Fine-tune a model.
Before you start
You need:
Jobs move through
requested → allocating → provisioning → running → finalizing, then land in a terminal state:
- A workload that exits
0ends assucceeded; a failure in any phase ends asfailed. - Explicit termination, a binding limit, or an exhausted organization budget moves the job through
terminatingtoterminated.
Step 1 - Pick an accelerator
List the curated accelerator catalog and choose one by its stablename.
Step 2 - Check price and availability
Optionally request a quote before creating anything. A quote is a live observation of the market: it returns whether the configuration is currently obtainable and the hourly price range, and it reserves nothing.200 response, with available: false and null price bounds.
Step 3 - Create the job
Create the job with a requiredIdempotency-Key header.
Retrying with the same key and the same body returns the same job with a 200 instead of creating a duplicate; the same key with a different body returns 409 idempotency_conflict.
This example runs a small LoRA fine-tune of Qwen2.5-0.5B-Instruct and merges the adapter, matching the platform smoke test:
Why
capacity_optimized is the default: billing starts at allocation, so the
cheapest offer is not the cheapest outcome when the machine is slow to start
or never reaches the workload. Choose lowest_cost when the quoted rate
matters more than time-to-start.
The response is 201 with the durable job in state requested:
state, reason, logs, and events — never as an HTTP error on a create that already returned 201.
Step 4 - Poll until it finishes
0, the job moves through finalizing to succeeded, exit_code is recorded, the provider resource is deallocated automatically, and spend stops accruing.
A non-zero exit ends in failed with a reason explaining why.
Terminal jobs stay readable for audit and usage.
Step 5 - Read logs and events
Logs are durable and cursor-paginated, and they distinguish your workload’s output from system output.source=system for allocation and bootstrap output, and order=asc (the default) to page oldest-first.
Lifecycle transitions such as provider_allocated, workload_started, and workload_exited are also available as structured events:
Step 6 - Stop a job early
Termination is explicit, idempotent, and returns the current resource.DELETE: the record is retained for audit, usage, and reconciliation.
A job that hits limits.max_runtime_hours, limits.max_cost_usd, or an organization budget is terminated the same way, with no grace period and no partial-result guarantee, so publish artifacts from inside the workload before it exits.
Use mka1-repos for datasets and weights
Compute stores no workload artifacts. The golden path is mka1-repos, the platform’s Hugging Face-compatible repository service for models and datasets: your job pulls the dataset from it and publishes the merged weights back to it, all from inside the workload. This is the same Hugging Face access you use from your own machine — see Manage repositories. ms-swift withUSE_HF=1 speaks that protocol, so --model and --dataset take <org>/<name> references directly and no code changes are needed.
Three environment values make this work. Compute treats them as ordinary environment variables — it is the Hugging Face tooling inside your container that reads them, and by these exact names:
HF_ENDPOINTpoints at the artifact endpoint for your cluster. Hugging Face-compatible tooling —huggingface_hub, ms-swift withUSE_HF=1, vLLM — resolves<org>/<name>identifiers against it, so workloads reach mka1-repos without any code changes. The console pre-fills it when you create a workload; set it yourself when you call the API directly, or point it elsewhere to pull from a different hub.- mka1-repos authenticates with your MKA1 API key.
Store the key as a Compute secret and inject it as
HF_TOKENthroughsecret_env, so it never appears inline in the job spec. - Set
HF_HUB_DISABLE_XET=1when uploading weights. Currenthuggingface_hubreleases can select the Xet transfer path automatically, while mka1-repos supports the standard Hub/LFS upload path. Disabling Xet keepsHfApi.upload_folderandhf uploadon the supported path.
meetkai/functionary and publishes back to it, so each run builds on the last.
HF_ENDPOINT redirects every Hugging Face lookup in the workload, so identifiers from the public hub no longer resolve while it is set.
To fine-tune from a public base model, mirror it into a repository of your own first, or leave HF_ENDPOINT unset and pull from the public hub instead.train-and-publish.sh
base64 < train-and-publish.sh and reference the secret in the create body:
meetkai/functionary by anyone in your organization, and a Compute service can serve them directly — see Deploy a model server.
A mid-run termination destroys any work not already published.
Publishing from inside the workload, as above, is the supported checkpointing mechanism in this version.
Track spend
Every job response carriesaccrued_usd, and the usage endpoint aggregates spend across resources for a time window:
API reference
For the full request and response schemas, open the Compute groups in the API Reference.See also
- Deploy a model server - serve the weights this job produced behind an authenticated endpoint.
- Manage repositories - create and manage the repositories this job reads from and publishes to.
- Manage repositories - create a repository and get datasets and weights into it in the first place.
- Fine-tune a model - the managed fine-tuning API for platform models.