FLock
Developer GuideGithub
  • What is FLock
    • Introduction to FLock.io
    • The Centralisation Problem
    • Architectural Breakdown
      • System Design
      • Blockchain Layer
      • AI Layer
  • ❤️‍🔥FLock Products
    • AI Arena
      • Participants
      • Quickstart
        • Pre-requisites
          • WSL installation
        • Delegator Guide
        • Training Node Guide
        • Validator Guide
      • Task Lifecycle Deep-dive
      • Smart Contracts Deep-dive
    • FL Alliance
      • Participants
      • Components
      • Task Lifecycle Deep-dive
        • 1. Staking and Role Assignment
        • 2. FL Training
        • 3. FL Aggregation and Evaluation
        • 4. Rewards
      • Smart Contracts Deep-dive
      • FL Client
        • Pre-Requsites
        • Steps to Quickstart
      • FLocKit
    • AI Marketplace
      • Quickstart
        • Getting started Manual creation
        • Guideline Manual
        • Model API guide
        • Tutorials
          • Create a discord bot with Model API
          • Farcaster Frames with Model API
      • Participants
      • Deep-dive
        • Function breakdown
        • RAG
        • Contribution Mechanism
        • Roadmap
    • 2025 Roadmap
  • 💰FLOCK TOKENOMICS
    • Overview
      • Incentivising open source model development
      • Security
    • Token Utility
      • Supply
      • Demand
    • Network Participation
      • AI Arena
        • Task Creator
        • Data Provider
        • Training Node
        • Validator
        • Delegator
        • Delegation Pool Rewards Explainer
      • FL Alliance
        • Task Creator
        • FL Nodes
      • AI Marketplace
        • Model Host
    • Token Allocations
    • Airdrop
    • Contract Details
  • 💻FLock Use-Cases
    • AI-assisted Coding - FLock x Aptos LLM (outperforms ChatGPT-4o!)
    • AI Assistants - Farcaster GPT, Scroll GPT and many more to come!
    • AI Companions - Professor Grump w/ Akash
    • Web3 Agents - Text2SQL Agent
    • Privacy-preserving Healthcare
  • 📃Resources
    • Litepaper
    • Whitepaper
    • Publications
    • Glossary
    • FAQ
    • Social Media
    • Careers
    • Terms Of Use
    • Privacy Policy
    • FLock.io-Verified Developers
    • FLOCK Token Airdrop Terms and Conditions
Powered by GitBook
On this page
  • 0. Navigate to train.flock.io and connect you wallet.
  • 1. Stake FLOCK as Training Node from train.flock.io
  • 2. Accept delegator
  • 3. Get API key
  • Video Tutorial
  • 4. Set up your environment
  • 5. Clone the QuickStart repo
  • 6. Get information required to run automation script
  • 7. Run full automation script
  • 8. Claim rewards

Was this helpful?

  1. ❤️‍🔥FLock Products
  2. AI Arena
  3. Quickstart

Training Node Guide

How to stake and submit a Training Task

PreviousDelegator GuideNextValidator Guide

Last updated 2 months ago

Was this helpful?

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 be either training node OR validator for each task.

0. Navigate to train.flock.io and connect you wallet.

Follow the steps here to connect your wallet.

1. Stake FLOCK as Training Node from train.flock.io

  1. Once you have FLOCK tokens, Navigate to the Training Node tab on the Stake page

  2. Select a training task

  3. Stake FLOCK

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. Accept delegator

Note that you have the option to accept delegator. To do so, go to "Accept Delegator" tab. Select your profit-sharing ratio, then click "Create Delegation Contract":

Once the transaction is completed. You have the option to add a profile and a profile picture, as well as to modify your profit-sharing ratio here:

You can only modify your rewards-sharing ratio once per month.

3. 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

4. Set up your environment

Windows

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

Mac/Linux

You can install Anaconda via HERE

5. Clone the QuickStart repo

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

git clone https://github.com/FLock-io/testnet-training-node-quickstart.git

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

  • dataset.py - 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.

  • merge.py - 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.

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

6. 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 https://train.flock.io/flock_api

  • 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:

https://huggingface.co/google/gemma-2b

7. 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 full_automation.py
set TASK_ID=<task-id> && 
set FLOCK_API_KEY="<your-flock-api-key-stakes-as-node-for-the-task>" && 
set HF_TOKEN="<your-hf-token>" && 
set CUDA_VISIBLE_DEVICES=0 && 
set HF_USERNAME="your-hf-user-name" && 
python full_automation.py
$env:TASK_ID = "<task-id>"
$env:FLOCK_API_KEY = "<your-flock-api-key-stakes-as-node-for-the-task>"
$env:HF_TOKEN = "<your-hf-token>"
$env:CUDA_VISIBLE_DEVICES = "0"
$env:HF_USERNAME = "your-hf-user-name"
python full_automation.py

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.

8. 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 train.flock.io.