AtroposLib Configuration

July 21, 2025 ยท View on GitHub

This document outlines the configuration options available for the atroposlib library, primarily defined using Pydantic models. These configurations are often managed via a command-line interface built using pydantic-cli, especially when using the serve command provided by environment classes inheriting from BaseEnv.

Base Environment Configuration (atroposlib.envs.base.BaseEnvConfig)

Basic environment configuration settings.

ParameterTypeDefaultDescription
group_sizeint4How many responses are grouped together for scoring.
max_num_workersint-1Maximum number of workers to use. -1 calculates from max_num_workers_per_node.
max_eval_workersint16Maximum number of workers to use for evaluation.
max_num_workers_per_nodeint8Maximum number of workers to use per node.
steps_per_evalint100Number of steps to take before evaluating.
max_token_lengthint2048Maximum token length used in generations.
eval_handlingEvalHandlingEnumEvalHandlingEnum.STOP_TRAINHow to handle evaluations (STOP_TRAIN, LIMIT_TRAIN, NONE).
eval_limit_ratiofloat0.5Ratio of training workers to limit during evals (used if eval_handling is LIMIT_TRAIN).
inference_weightfloat1.0Inference weight. Set to -1 to ignore if doing something special.
batch_sizeint-1Batch size for training. Usually set by the trainer via the API.
max_batches_offpolicyint3Maximum number of off-policy batches to have in the queue.
tokenizer_namestr"NousResearch/DeepHermes-3-Llama-3-3B-Preview"Hugging Face tokenizer to use.
use_wandbboolTrueWhether to use Weights & Biases for logging.
rollout_server_urlstr"http://localhost:8000"URL of the rollout server (FastAPI interface).
total_stepsint1000Total number of steps to run.
wandb_namestr or NoneNoneName to be grouped by in WandB.
num_rollouts_to_keepint32Number of rollouts to display on WandB.
num_rollouts_per_group_for_loggingint1Number of rollouts per group to keep for logging. -1 keeps all.
ensure_scores_are_not_sameboolTrueEnsure that scores within a group are not identical (usually True).
data_path_to_save_groupsstr or NoneNonePath to save generated groups as a JSONL file. If set, groups will be written here.
min_items_sent_before_loggingint2Minimum number of items sent to the API before logging metrics. 0 or less logs every time.
include_messagesboolFalseWhether to include messages in the output transmitted to the trainer.
min_batch_allocationfloat or NoneNoneMinimum proportion of a batch this environment should be allocated (0.0-1.0). Ensures this env contributes at least this fraction to each training batch.

Server Manager Configuration (atroposlib.envs.server_handling.server_manager.ServerManagerConfig)

Settings for the ServerManager.

ParameterTypeDefaultDescription
slurmboolTrueWhether the environment is running on SLURM.
testingboolFalseIf True, uses mock OpenAI data for testing.
max_n_completionsint8The maximum number of completions to request at once per server call. Will split any n larger than this into multiple calls. This is to help load balance servers.

Server Baseline Configuration (atroposlib.envs.server_handling.server_manager.ServerBaseline)

Baseline configuration used by ServerManager if a list of APIServerConfig is not provided, particularly for setting up local or SLURM-based server discovery.

ParameterTypeDefaultDescription
timeoutint1200Timeout for the request in seconds.
num_max_requests_at_onceint512Maximum number of concurrent requests (training). Divide this by the generation n parameter.
num_requests_for_evalint64Maximum number of concurrent requests for evaluation.
model_namestrdefaultModel name to use when calling inference servers.
rolling_buffer_lengthint1000Length of the rolling buffer to store server metrics (like request timings, attempts).

OpenAI Server Configuration (atroposlib.envs.server_handling.openai_server.APIServerConfig)

Configuration for individual OpenAI-compatible API servers (including local SGLang/vLLM instances).

ParameterTypeDefaultDescription
api_keystr | NoneNoneAPI key for OpenAI API. Use "x" or any non-empty string for local servers that don't require auth.
base_urlstr | NoneNoneURL of the API endpoint. None for official OpenAI API, otherwise the local server URL (e.g., http://localhost:9004/v1).
timeoutint1200Timeout for the request in seconds.
num_max_requests_at_onceint512Maximum number of concurrent requests (training). Divide this by the generation n parameter.
num_requests_for_evalint64Maximum number of concurrent requests for evaluation.
model_namestrdefaultThe model name to use. Required for both OpenAI and local models (e.g., "gpt-4", "NousResearch/...").
rolling_buffer_lengthint1000Length of the rolling buffer to store server metrics (like request timings, attempts).
n_kwarg_is_ignoredboolFalseIf the n kwarg is ignored by the API you are using, set this to True.