Training Node Guide

How to stake and submit a Training Task

This guide provides step-by-step instructions for the entire Training Node workflow. By the end you will have successfully staked as a Training Node, completed a training task, and claimed your staking rewards.

Be sure you have completed all pre-requisite tasks.

You can only choose one role per task!

1. Stake FML as Training Node from

  1. Navigate to the Training Node tab on the Stake page

  2. Select a training task

  3. Stake FML

Once you’ve confirmed and approved the transaction in your web3 wallet, you will see a box on the Training Node tab with your stake details.

2. Get API key

Your API key is required for all remaining Validator steps. You can get it from the web app.

  1. Select dropdown in upper right corner of web app

  2. Select API

  3. On the API page, copy your API key

Once you have your API key, you can proceed to the next step.

NOTE: If you have issues generating an API key try removing any ad blocker extensions and/or clearing your cookies.

Video Tutorial

3. Set up your environment


For Windows users, we suggest installing WSL. Follow the guidance: WSL installation


You can install Anaconda via HERE

4. Clone the QuickStart repo

The quickstart repo contains everything you need to run our script. To clone it run:

git clone

To set up all packages within the project directory

conda create -n training-node python==3.10
conda activate training-node
pip install -r requirements.txt

File Structure

  • - Contains the logic to process the raw data from demo_data.jsonl.

  • demo_data.jsonl - Follows the shareGPT format. The training data you receive from the fed-ledger is in exactly the same format.

  • - Contains the utility function for merging LoRA weights. If you are training with LoRA, please ensure you merge the adapter before uploading to your Hugging Face repository.

  • - A training script that implements LoRA fine-tuning for a Gemma-2B model.

5. Get information required to run automation script

The script described in the following step automates the following:

  • Gets a task

  • Downloads the training data

  • Finetunes Gemma-2B on training data

  • Merges weights

  • Uploads to your Hugging Face model repo

  • Submits the task to fed-ledger

To run it, you will need:

  • TASK_ID - the id of the task you are staking on as Training Node

  • FLOCK_API_KEY - available at

  • HF_TOKEN - your Hugging Face Access Token (Hugging Face > Profile > Settings > Access Tokens)

  • HG_USERNAME - your Hugging Face user name

NOTE: If you haven't already done so, please acknowledge license to access Gemma on Hugging Face:

6. Run full automation script

Once you have all the information listed in the previous step, paste the script below into your terminal, update the repsective values, and run the command.

TASK_ID=<task-id> FLOCK_API_KEY="<your-flock-api-key-stakes-as-node-for-the-task>" HF_TOKEN="<your-hf-token>" CUDA_VISIBLE_DEVICES=0 HF_USERNAME="your-hf-user-name" python

NOTE: Tasks can be completed with any supported base LLM model. The only restriction is max_param.You can use any technique to train or fine-tune a model, all you need to make sure is that the model can be successfully run by our validation script.

6. Claim rewards

Reward distribution is triggered every 24 hours at midnight UTC. The final round of reward distribution is triggered at the once the task training period is complete.

You can claim your rewards via

Last updated