config

package
v1.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration management utilities for GSwarm, including loading and validation of application settings.

Index

Constants

View Source
const (
	DefaultPublicMaddr = "" // Empty by default, let Python pick OS address
	DefaultPeerMaddr   = "/ip4/38.101.215.13/tcp/30002/p2p/QmQ2gEXoPJg6iMBSUFWGzAabS2VhnzuS782Y637hGjfsRJ"
	DefaultHostMaddr   = "/ip4/0.0.0.0/tcp/38331"
	SmallSwarmContract = "0x69C6e1D608ec64885E7b185d39b04B491a71768C"
	BigSwarmContract   = "0x6947c6E196a48B77eFa9331EC1E3e45f3Ee5Fd58"
)

Constants

Variables

View Source
var (
	TestnetFlag      = flag.Bool("testnet", false, "Connect to the Testnet?")
	BigSwarmFlag     = flag.Bool("big-swarm", false, "Use big swarm (Math Hard)?")
	ModelSizeFlag    = flag.String("model-size", "0.5", "Parameter count (0.5, 1.5, 7, 32, 72)")
	HFTokenFlag      = flag.String("hf-token", "", "HuggingFace access token")
	OrgIDFlag        = flag.String("org-id", "", "Modal ORG_ID (for testnet)")
	IdentityPathFlag = flag.String("identity-path", "swarm.pem", "Path to identity PEM")
	ContractAddrFlag = flag.String("contract-address", "", "Override smart‐contract address")
	GameFlag         = flag.String("game", "", "Game type ('gsm8k' or 'dapo')")
	ConfigPathFlag   = flag.String("config-path", "", "Path to YAML config file")
	CPUOnlyFlag      = flag.Bool("cpu-only", false, "Force CPU-only mode")
	RequirementsFlag = flag.String("requirements", "", "Requirements file (overrides default)")
	ShowVersionFlag  = flag.Bool("version", false, "Show version information")
)

Flag definitions - using consistent hyphen naming

Functions

func GetConfigPath

func GetConfigPath(paramB string, useBigSwarm bool) string

GetConfigPath returns the appropriate config path based on parameters

func GetTestLogger

func GetTestLogger() *log.Logger

GetTestLogger returns a logger for testing purposes

func ValidateConfiguration

func ValidateConfiguration(config Configuration) error

ValidateConfiguration validates the configuration

Types

type Configuration

type Configuration struct {
	ConnectToTestnet bool
	UseBigSwarm      bool
	ParamB           string
	CPUOnly          bool
	HFToken          string
	OrgID            string
	IdentityPath     string
	ContractAddress  string
	Game             string
	ConfigPath       string
	PublicMaddr      string
	PeerMaddr        string
	HostMaddr        string
	RequirementsFile string
}

Configuration holds all the settings for the RL Swarm

func GetConfiguration

func GetConfiguration(visited map[string]bool) Configuration

GetConfiguration builds a Configuration, prompting only for flags not in `visited`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL