Skip to main content

Run a fixed Hello World training Job

This is the smallest complete managed CLI training example. It runs ten real LoRA training steps on Qwen/Qwen3.5-4B and checks a generated Hello, world! response. It allocates paid resources. For a Python-controlled loop, use the SFT quickstart.

Prepare the request​

Complete installation and authentication. Use a project Key with training write/read, checkpoint download and resource-cleanup permissions, and enough account balance for the training reservation. Use your own project Key; contact support if this training service is unavailable.

Save the following as hello-world.json. Keep the four messages and fixed recipe parameters unchanged. This hello-world request does not accept arbitrary datasets. The fixed recipe uses rank 16, seed 42 and learning rate 0.0002; the platform owns resource selection.

{
"request_id": "hello-world-4b-001",
"base_model": "Qwen/Qwen3.5-4B",
"recipe": "hello-world",
"max_steps": 10,
"max_length": 512,
"per_device_train_batch_size": 4,
"gradient_accumulation_steps": 1,
"records": [
{"messages": [{"role": "user", "content": "Say hello to the world."}, {"role": "assistant", "content": "Hello, world!"}]},
{"messages": [{"role": "user", "content": "Write the classic programming greeting."}, {"role": "assistant", "content": "Hello, world!"}]},
{"messages": [{"role": "user", "content": "What should a hello world program print?"}, {"role": "assistant", "content": "Hello, world!"}]},
{"messages": [{"role": "user", "content": "Greet everyone with the traditional first-program message."}, {"role": "assistant", "content": "Hello, world!"}]}
]
}

Submit once and keep the receipt​

The following generates a unique request ID, then submits the request. Run the ID-generation step once per new experiment. For a network retry, reuse the same file and ID; do not regenerate it.

el auth status --check
python - <<'PYCODE'
import json
import uuid
from pathlib import Path
path = Path("hello-world.json")
request = json.loads(path.read_text())
request["request_id"] = "hello-world-" + uuid.uuid4().hex
path.write_text(json.dumps(request, indent=2) + "\n")
PYCODE
el job submit --type train --file hello-world.json > submit.json

Read job_id from submit.json and replace YOUR_JOB_ID below. Submission can finish before allocation or training completes. Preserve the request and receipt, and inspect the existing Job after an uncertain response instead of submitting another experiment.

Observe training and model output​

el job get YOUR_JOB_ID > status.json
el trail list --type train --job-id YOUR_JOB_ID --json
el job log YOUR_JOB_ID --source all --follow --json > logs.ndjson
el job result YOUR_JOB_ID > result.json
el checkpoint list --job-id YOUR_JOB_ID --json > checkpoints.json

Repeat job get until terminal. job log --follow ends when log capture reaches EOF; Ctrl-C only stops the log reader. A passing Job has status=completed, training.validation_mode=cloud, and training.hello_world containing ten steps, rank 16, seed 42, learning rate 0.0002, ten finite losses, and sample_response="Hello, world!". This is a fixed functional check, not a model quality benchmark. A receipt or nonempty logs alone does not prove success.

The Console's Jobs → your Train Job → Trials / Logs / Metrics / Checkpoints pages provide the same read-only observations. Public training supports managed Jobs only; interactive SDK training sessions are removed.

Download the saved files​

Choose the returned full checkpoint path from checkpoints.json; do not construct it from the Job ID. Replace YOUR_CHECKPOINT_PATH below and use a new destination directory:

el checkpoint download YOUR_CHECKPOINT_PATH ./verified-checkpoint --job-id YOUR_JOB_ID > download.json

The downloader verifies file sizes and SHA-256 against registered metadata. Keep the actual files and download.json. If interrupted, repeat the same download into the same directory; complete files are rehashed and reused, and expired object links get one authorized refresh per failed file. An uploading checkpoint may not have files yet; wait for registration/publication and retry the download, without retraining. The list can be paginated; follow next_cursor with the same Job filter.

This 4B example proves training and its recipe's sampling output. Independent serving requires a compatible published profile. Do not invent a 4B serving profile; the separate train-and-deploy example uses Qwen/Qwen3.8-27B with qwen38-27b@1.

Stop and verify resource cleanup​

To interrupt a running Job, call job stop. For a finished Job, read its terminal state and still verify resource cleanup. Save the JSON array below as cleanup.json, replacing the Job ID; use a fresh unique cleanup request ID for this cleanup operation.

el job stop YOUR_JOB_ID > stop.json
el job get YOUR_JOB_ID > final-status.json
[{"kind": "training_job", "id": "YOUR_JOB_ID"}]
el setting cleanup --file cleanup.json --request-id YOUR_UNIQUE_CLEANUP_ID --wait > cleanup-receipt.json
el setting operation get YOUR_OPERATION_ID

Use the operation_id returned in cleanup-receipt.json for the final read. Cleanup is complete only when the Operation is SUCCEEDED without errors. If --wait times out, keep that Operation ID and inspect it rather than creating another Job. This cleanup selects only your training Job; the downloaded files and registered checkpoint are retained. To remove the remote checkpoint later, use its listing's resource_id with el checkpoint delete RESOURCE_ID --wait, after preserving needed files.

Continue with multiple training Trials, checkpoint recovery, or the SDK quickstart.