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 Validator from train.flock.io
  • 3. Accept delegator
  • 4. Get API key
  • Video Tutorial
  • 5. Set up your environment
  • 6. Clone the Validator Repo
  • 7. Run Validation Script
  • 8. Claim rewards

Was this helpful?

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

Validator Guide

How to stake and validate tasks as a Validator

PreviousTraining Node GuideNextTask Lifecycle Deep-dive

Last updated 2 months ago

Was this helpful?

This guide provides step-by-step instructions for the entire Validator workflow. By the end you will have successfully staked as a Validator, requested task assignment(s), run a validator script, uploaded loss score(s), 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 to connect your wallet.

1. Stake FLOCK as Validator from train.flock.io

In order begin receiving validation assignments, you must stake FLOCK to a task at train.flock.io.

  1. Navigate to the Validator tab on the Stake page

  2. Select task to validate

  3. Stake FLOCK

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

3. 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 motify your rewards-sharing ratio once per month.

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

5. Set up your environment

To set up your environment, run the following commands:

Windows

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

Mac/Linux

You can install Anaconda via HERE

6. Clone the Validator Repo

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

git clone https://github.com/FLock-io/llm-loss-validator.git

To set up all packages within the project directory

conda create -n llm-loss-validator python==3.10
conda activate llm-loss-validator
pip install -r requirements.txt

7. Run Validation Script

Now that you have staked as a Validator and have your API key you can run the validation script by running the following loop in your command line:

cd /src
CUDA_VISIBLE_DEVICES=0 \
bash start.sh \
--hf_token your_hf_token \
--flock_api_key your_flock_api_key \
--task_id your_task_id \
--validation_args_file validation_config.json.example \
--auto_clean_cache False
cd /src
bash start.sh \
--hf_token your_hf_token \
--flock_api_key your_flock_api_key \
--task_id your_task_id \
--validation_args_file validation_config_cpu.json.example \
--auto_clean_cache False
cd /src
set CUDA_VISIBLE_DEVICES=0
wsl bash start.sh \
--hf_token your_hf_token \
--flock_api_key your_flock_api_key \
--task_id your_task_id \
--validation_args_file validation_config.json.example \
--auto_clean_cache False
cd /src
$env:CUDA_VISIBLE_DEVICES=0
powershell -File .\start.ps1 `
-hf_token <your_hf_token> `
-flock_api_key <your_flock_api_key> `
-task_id <your_task_id> `
-validation_args_file validation_config.json.example `
-other_args @("--auto_clean_cache", "False")
  • CUDA_VISIBLE_DEVICES=0: Specifies which GPU to use. 0 indicates the first GPU. Adjust this based on your available GPUs. Remove this line if you are using just the CPU

  • --hf_token: Your Hugging Face token, required for accessing certain models. This should token should have write access.

  • --flock_api_key: Your FLock API key.

  • --task_id: The ID of the task you want to validate. If you are validating multiple tasks, you can pass a list eg. if you are validating tasks 8 and 9, you can pass --task_id 8,9

  • --validation_args_file: The path to the validation arguments file.

  • --auto_clean_cache: A flag to determine whether to automatically clean the model cache.

  • --lora_only: A flag to indicate whether to validate only repositories with LoRA (Low-Rank Adaptation) weights. True means only LoRA weights will be validated. This is useful for validators with limited network bandwidth, as LoRA weights are significantly smaller (10-500 MiB) compared to full model files (>10 GiB)

NOTE: If you would like to customise your validation script, visit this repo https://github.com/FLock-io/llm-loss-validator and check out How to run validation script section

Make sure the HF_TOKEN you passed in have access to the gated base models like gemma, llama2, and llama3 to succesfully validate models fine-tuned based on those.

Links:

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

https://huggingface.co/meta-llama/Meta-Llama-3-8B

https://huggingface.co/meta-llama/Llama-2-7b-hf

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

8. Claim rewards

Reward distribution is triggered every 24 hours at midnight UTC. You can claim your rewards via the web app.

Once you’ve connected your web3 wallet to train.flock.io, you can claim rewards with the following steps:

  1. Navigate to the Validator tab on the Stake page

  2. Verify you have FLOCK available to claim for the task you are staking

  3. Click Claim FLOCK

Once you’ve approved the transaction in your web3 wallet you will see a dialogue box confirming your claim.

Congratulations! You’ve successfully completed the entire validator workflow.

here