MILLICLOUDS

Docs

How to use MilliClouds

Keep one prompt and response dataset. Train several versions. Compare them on the same questions. The GPU is an NVIDIA machine you register.

Helpdesk [email protected]

What a run is

Training is supervised fine-tuning. Each row has a prompt and the response you want. The trainer runs a small 4-bit QLoRA: the base model stays frozen and the finished file is an adapter in Safetensors format. A 1.7B model needs about 6 GB of VRAM. A 7B model needs about 12 GB.

This is not preference training and not reinforcement learning. The file is one answer per prompt, not a chosen answer and a rejected one.

Steps

  1. Sign in. The link in the email opens this console.
  2. Open Hosts and register the machine as a trusted host. The worker token is shown once. Set the agent up on the GPU server with the steps below. The agent calls out over HTTPS. This product does not charge for that machine's time.
  3. Open New version and import a training template if the workspace does not have one yet. The template picks the base model and the VRAM floor.
  4. Add a dataset. A .jsonl file has one JSON object per line, with prompt and response. A file up to 50 MB can be attached while you queue a version. Larger files go through Datasets. A free account holds 1 GB in total.
  5. Queue a version of that dataset. Choose epochs, maximum sequence length, LoRA rank, and learning rate. Loss can cover the full line or the response only. A sweep runs the template's rank and learning-rate list and keeps the lowest validation loss.
  6. Watch it on Queue, then open the version for logs and the loss charts. Training loss, validation loss, learning rate, and gradient norm come from the trainer log.
  7. When the version is finished, open Evaluate. Save up to 20 questions that are not rows from the training file. Each finished version answers them, and so does the untouched base model.
  8. Download the adapter and its config from the version page.

Set up the agent on the GPU server

Training runs on the server, not in the browser. The Docker command on the Hosts page starts the Blender worker. It does not train a LoRA. Use the Python agent below, on the machine that has the GPU.

What the server needs

  • Linux on x86_64. Ubuntu, Debian, and Fedora are the systems these steps cover. A Mac cannot claim a training job.
  • An NVIDIA GPU. nvidia-smi must work on the host before Docker is involved. A 1.7B model wants about 6 GB free. A 7B model wants about 12 GB. A 14B model wants about 20 GB.
  • Docker Engine, with permission to run docker as the user that starts the agent.
  • The NVIDIA Container Toolkit, so containers can see the GPU. Check with docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smi.
  • Python 3.11 or newer, and the requests package (pip install 'requests>=2.31,<3').
  • About 30 GB of free disk for a small model, its weights, and checkpoints. A 7B model wants more. Weights are cached in ~/.cache/millicloud-lora.
  • Outbound HTTPS to the MilliClouds API. No inbound port, SSH, or VPN is required. If the GPU server is not the machine running the API, RY_API must be an address that server can reach, not localhost.

Install the GPU runtime

Ubuntu or Debian:

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-ct.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
  | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-ct.gpg] https://#' \
  | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker && sudo systemctl restart docker

Fedora:

sudo dnf install -y nvidia-container-toolkit python3-requests
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Build the trainer image

Clone milliclouds-agent onto the GPU server, then build the image there. The tag stays millicloud-lora:latest. Wait until the build prints trainer torch ok. The agent reads lora/train.py from this clone, so keep the directory after the build.

git clone https://github.com/technoblobs/milliclouds-agent.git
cd milliclouds-agent
docker build --platform linux/amd64 -f lora/Dockerfile -t millicloud-lora:latest .

Create the host token

  1. Sign in, then open Hosts.
  2. Type a name for the machine, such as office-4090.
  3. Click Register host. The machine is registered as a trusted host.
  4. Copy the token from the RY_WORKER_TOKEN box. It is shown once. Store it in a root-only file on that GPU server. The website keeps only a hash and will not show the token again. If you close the panel without saving it, revoke the host and register a new one. Do not run the milliclouds/worker image for training.

Put that value in RY_WORKER_TOKEN below. One token is one machine. Revoking the host on the website makes the token stop working.

Start the agent

On a machine you administer, the process runs from the cloned milliclouds-agent directory so it can see lora/train.py. The account that starts it must be allowed to run Docker. That host then starts millicloud-lora:latest for each version.

On a rented GPU the container is the host. Start the same image with the GPU and the token. It polls and trains inside that container, and it does not call Docker again. Give that container its own host token.

docker run --gpus all --name millicloud-agent \
  -e RY_API=https://api.milliclouds.com \
  -e RY_WORKER_TOKEN=paste-the-token-once \
  -e RY_RENDER_MODE=trusted \
  -e WORKER_MODE=1 \
  millicloud-lora:latest

Foreground, useful while you are setting the machine up. The terminal has to stay open.

cd milliclouds-agent
export RY_API=https://your-api.example
export RY_WORKER_TOKEN=paste-the-token-once
export RY_RENDER_MODE=trusted
export LORA_DOCKER_IMAGE=millicloud-lora:latest
export WORKER_MODE=1
python3 agent/agent.py

Daemon, so it comes back after a reboot. Put the same values in a root-only env file, then install a systemd service. Change the user and the /opt/milliclouds-agent path to the account and directory you cloned into.

sudo install -d -m 755 /etc/millicloud
sudo tee /etc/millicloud/agent.env >/dev/null <<'EOF'
RY_API=https://your-api.example
RY_WORKER_TOKEN=paste-the-token-once
RY_RENDER_MODE=trusted
LORA_DOCKER_IMAGE=millicloud-lora:latest
WORKER_MODE=1
EOF
sudo chmod 600 /etc/millicloud/agent.env

sudo tee /etc/systemd/system/millicloud-agent.service >/dev/null <<'EOF'
[Unit]
Description=MilliClouds training agent
After=docker.service network-online.target
Wants=network-online.target
Requires=docker.service

[Service]
Type=simple
User=gpu
Group=docker
WorkingDirectory=/opt/milliclouds-agent
EnvironmentFile=/etc/millicloud/agent.env
ExecStart=/usr/bin/python3 agent/agent.py
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now millicloud-agent

Check that it is working

  • systemctl status millicloud-agent shows active (running). A foreground run instead stays in the terminal and does not return to the shell.
  • journalctl -u millicloud-agent -n 40 --no-pager includes worker mode and long poll. worker token invalid or revoked means the token in the env file is wrong. poll failed means this server cannot reach RY_API.
  • On Hosts, the machine is online and a GPU name is filled in. Online with a blank GPU means nvidia-smi failed for that user. The agent keeps running, and it will not claim a training version.
  • docker image inspect millicloud-lora:latest succeeds. Without that image the host stays online and the first training version fails when Docker cannot start it.
  • Queue a version. Within a few seconds the service log says claimed chunk, then lora docker millicloud-lora:latest. The version page leaves the queue and shows progress.

The agent polls for a version, then starts docker run --gpus all with that image. The first job downloads the base model into the cache. Later jobs on the same model reuse it. After one version finishes, the next queued version is claimed immediately.

Features

  • One dataset, many versions. A version is that file plus a model and a set of arguments.
  • Trusted host. Any NVIDIA machine you register: home, office, a datacenter, or a GPU you rent yourself.
  • Validation loss for the run, and the same questions across finished versions.
  • Early stopping stays on. If validation loss stops improving, the run keeps the best checkpoint. Patience is 2.
  • Stop a queued version immediately. Stop a rendering version asks the host to kill the trainer. That can take until the next log line, and the version may return to the queue.
  • Delete a version removes that version's adapter, checkpoints, logs, and database rows. The shared dataset file stays. Deleting a dataset is refused while one of its versions is queued or rendering.
  • Unused dataset files and adapters are removed 5 days after the last training or compare, when nothing is queued or running.

What you can change

On a version: the template, epochs, sequence length, rank, learning rate, and whether loss is on the full line or the response. A sweep uses the template's fixed list of rank and learning-rate pairs.

The trainer does not change those during the run. The learning rate follows a cosine curve from the value you set. Batch size, gradient checkpointing, the optimizer, and bf16 stay on the recipe that fits a small GPU. They are not fields on the form.

If the host goes away

A version stays in progress until the host's lease runs out, about five minutes after the last heartbeat, plus up to a minute for the sweep. It then returns to the queue. If a checkpoint was uploaded, the next claim can resume from it. The page does not mark the version failed only because the agent stopped heartbeating.

Command line

The millicloud command signs in with the same email link, then lists templates, hosts, and versions as tables. jobs submit uploads a .jsonl and queues a version. jobs delete asks you to type delete before it removes that version. Dataset library, saved questions, and the loss charts stay on this website. millicloud mcp exposes the same calls to an assistant that is already signed in.