### Install Example Trainer Source: https://github.com/nousresearch/atropos/blob/main/environments/community/mcp_tool_calling/GRPO_README.md Install the example_trainer package from the repository root. Use the '[all]' extra for all optional dependencies. ```bash pip install -e ".[example_trainer]" ``` ```bash pip install -e ".[all]" ``` -------------------------------- ### Install Example Trainer Dependencies Source: https://github.com/nousresearch/atropos/blob/main/example_trainer/README.md Install the example trainer and its dependencies using pip. You can install just the example trainer or all available extras. ```bash pip install -e ".[example_trainer]" # or everything: pip install -e ".[all]" ``` -------------------------------- ### Install Atropos for Running Examples Source: https://github.com/nousresearch/atropos/blob/main/README.md Install Atropos in editable mode with example dependencies. Use this if you want to run the provided examples. ```bash pip install -e .[examples] ``` -------------------------------- ### Start API and Environment Servers Source: https://github.com/nousresearch/atropos/blob/main/llms.txt Use these commands to start the central API server and an example environment server. Ensure the model name is adjusted for your setup and set '--slurm' appropriately. CLI arguments can override configuration files. ```bash run-api & python environments/gsm8k_server.py serve --openai.model_name="Qwen/Qwen2.5-1.5B-Instruct" --slurm False # Alternatively, using a config file: # python environments/gsm8k_server.py serve --config environments/configs/example.yaml # CLI arguments can override config settings: # python environments/gsm8k_server.py serve --config environments/configs/example.yaml --env.group_size 8 ``` -------------------------------- ### Environment Setup with Example Configuration Source: https://github.com/nousresearch/atropos/blob/main/environments/pydantic_schema_following_environment/README.md Initialize the PydanticSchemaFollowingEnv using a pre-defined example configuration function. This simplifies setup when using standard dataset structures. ```python from atropos.environments.pydantic_schema_following_environment.example_config import create_config_with_dataset # Create configuration for your dataset env_config, server_configs = create_config_with_dataset("your_username/your_pydantic_dataset") # Initialize environment env = PydanticSchemaFollowingEnv(env_config, server_configs) ``` -------------------------------- ### Set up Pokemon Showdown Battle Simulator Source: https://github.com/nousresearch/atropos/blob/main/environments/community/pokemon-showdown/README.md Clone the Pokemon Showdown repository, install dependencies, and start the simulator. Ensure the simulator is running before launching the RL trainer. ```bash git clone https://github.com/smogon/pokemon-showdown.git cd pokemon-showdown npm install node pokemon-showdown start --no-security ``` -------------------------------- ### Launch Example GRPO Trainer Source: https://github.com/nousresearch/atropos/blob/main/environments/dataset_environment/LOCAL_TESTING.md Starts the example GRPO trainer in a separate terminal. Configure model, training steps, and batch size. ```bash python -m example_trainer.grpo.train \ --model_name Qwen/Qwen2.5-1.5B-Instruct \ --training_steps 20 \ --batch_size 2 \ --gradient_accumulation_steps 2 \ --seq_len 512 ``` -------------------------------- ### Run Renderer Example Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Execute the renderer example script. ```bash python test_renderer_example.py ``` -------------------------------- ### Setup Development Environment Source: https://github.com/nousresearch/atropos/blob/main/llms.txt Set up a Python virtual environment and install the core Atropos package along with development dependencies. Ensure you are using Python 3.10+. ```bash python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -e ".[dev]" ``` -------------------------------- ### Start Atropos Environment Microservice (GSM8K Example) Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/FAQ.md Launch a specific environment microservice, such as the GSM8K server. This command can be configured via command-line arguments or a YAML file. ```bash python environments/gsm8k_server.py serve --openai.model_name YourModelName --slurm false ``` ```bash # python environments/gsm8k_server.py serve --config environments/configs/example.yaml ``` -------------------------------- ### Initialize StarMapCompressionEnv Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Demonstrates the basic setup for the StarMapCompressionEnv, which is the starting point for compression tasks. ```python from environments.community.starmap_compression.starmap_compression import StarMapCompressionEnv ``` -------------------------------- ### Install All Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/conversational_style_dpo/requirements.txt Install all available dependencies for the project, including optional extras, by using the editable install option with the 'all' extra. ```bash pip install -e .[all] ``` -------------------------------- ### Base Environment Setup Source: https://github.com/nousresearch/atropos/blob/main/llms.txt Implement the `setup` method for initial environment configuration, such as loading data or models. ```python async def setup(self): # Called once at the start. Use for initial setup (loading data, models, etc.). pass ``` -------------------------------- ### Install Prime CLI Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md Install the Prime CLI tool using `uv`. ```bash uv tool install prime ``` -------------------------------- ### Setup and Run LiveCodeBench with Modal Sandbox Source: https://github.com/nousresearch/atropos/blob/main/environments/eval_environments/README.md Instructions for setting up and running the LiveCodeBench evaluation using the Modal sandbox for secure code execution. This includes installing Modal, obtaining a token, deploying the sandbox, and running the evaluation script. ```bash # First, deploy Modal sandbox (one-time setup) pip install modal modal token new modal deploy modal_sandbox.py # Run with Modal sandbox (secure) python lcb_eval.py evaluate \ --openai.base_url https://api.openai.com/v1 \ --openai.api_key $OPENAI_API_KEY \ --openai.model_name gpt-4o \ --env.use_modal True \ --env.thinking_mode True \ --env.data_dir_to_save_evals ../evals/lcb/gpt-4o ``` -------------------------------- ### Install Foundry/Anvil Source: https://github.com/nousresearch/atropos/blob/main/environments/community/ethereum_virtual_machine/README.md Installs Foundry, which includes Anvil (EVM node) and Cast (CLI tool). Recommended for quick setup. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup ``` -------------------------------- ### Connect to Atropos Trainer Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Command to start the Atropos trainer service. Ensure PyPantograph is installed for full Lean integration. ```bash python environments/community/lean_proof_env/lean_env.py serve ``` -------------------------------- ### Install Requirements and Run GoofyMath Source: https://github.com/nousresearch/atropos/blob/main/environments/community/goofy_math/README.md Installs necessary packages and runs the GoofyMath environment in process mode to generate examples. Ensure you set your OpenAI API key before running. ```bash pip install -r requirements.txt export OPENAI_API_KEY=your_key_here cd atropos python environments/hack0/goofy_math_server.py process \ --env.data_path_to_save_groups goofy_math_demo.jsonl \ --env.total_steps 3 ``` -------------------------------- ### Environment Setup for OpenVLA Robotics Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md This snippet outlines the basic setup for the OpenVLA robotics environment. It is typically used as a starting point for configuring and running simulations. ```python import gymnasium as gym env = gym.make("openvla_robotics/NutAssemblySquare-v0", render_mode="rgb_array") observation, info = env.reset() for _ in range(1000): action = env.action_space.sample() # Replace with your action observation, reward, terminated, truncated, info = env.step(action) if terminated or truncated: observation, info = env.reset() env.close() ``` -------------------------------- ### Serve Text Reversal Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md Starts the text reversal environment for basic training with default settings. This includes a 16k train context, 32k eval context, and a sampled eval set of 100 examples. ```bash python text_reversal_environment.py serve ``` -------------------------------- ### Install KernelBench from Source Source: https://github.com/nousresearch/atropos/blob/main/environments/kernelbench_env/README.md Installs KernelBench using pip from a Git repository and sets up the project locally. ```bash pip install git@github.com:ScalingIntelligence/KernelBench.git cd KernelBench pip install -r requirements.txt pip install -e . cd - ``` -------------------------------- ### Start Visualization Server Source: https://github.com/nousresearch/atropos/blob/main/environments/community/padres_spatial/README.md Navigates to the visualization directory and starts an HTTP server to view the environment. Access it via http://localhost:8080. ```bash cd visualization python3 -m http.server 8080 ``` -------------------------------- ### Install Atropos for Local Development Source: https://github.com/nousresearch/atropos/blob/main/llms.txt Install the Atropos library from a local clone for development purposes. This includes installing it in editable mode. ```bash git clone https://github.com/NousResearch/atropos.git cd atropos pip install -e . ``` -------------------------------- ### Install InternBootcamp Library Source: https://github.com/nousresearch/atropos/blob/main/environments/intern_bootcamp/README.md Navigate to the environment directory and install the InternBootcamp library, which is included as a submodule. This is a prerequisite for running the training environment. ```bash cd environments/intern_bootcamp cd internbootcamp_lib && uv pip install -e . ``` -------------------------------- ### Install Atropos Library Source: https://github.com/nousresearch/atropos/blob/main/README.md Install the core Atropos library using pip. This is the basic installation for using Atropos. ```bash pip install atroposlib ``` -------------------------------- ### Install Prime Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md Install a specific environment, such as Wordle or GSM8K, using the Prime CLI. ```bash prime env install will/wordle ``` ```bash prime env install primeintellect/gsm8k ``` -------------------------------- ### Troubleshooting: Start Atropos API Server Source: https://github.com/nousresearch/atropos/blob/main/example_trainer/README.md Command to start the Atropos API server. Ensure this is running before attempting to connect to it. ```bash # Start the API server first run-api --port 8002 ``` -------------------------------- ### Install Dependencies and Run Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/community/metric_card_generator/README.md Installs necessary dependencies and runs the metric card generator to produce rollouts. The generated HTML visualization can then be opened in a browser. ```bash pip install -r requirements.txt python metric_card_generator.py process --env.data_path_to_save_groups artifacts/metric_rollouts.jsonl # Open artifacts/metric_rollouts.html in a browser ``` -------------------------------- ### SWE-RL Example Edit Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md An example demonstrating the SEARCH/REPLACE edit format for the SWE-RL environment. ```python Here is an example: ```python ``` -------------------------------- ### Run GRPO Example Trainer Source: https://github.com/nousresearch/atropos/blob/main/llms.txt Execute the GRPO example trainer script from the project root. Ensure Atropos API and an environment are running. ```bash python example_trainer/grpo.py ``` -------------------------------- ### Start Environment Source: https://github.com/nousresearch/atropos/blob/main/README.md Run this command in a separate terminal to start an environment. Replace 'gsm8k_server.py serve' with your chosen environment. ```bash python gsm8k_server.py serve --slurm False ``` -------------------------------- ### Start Atropos API Server Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/FAQ.md Run the Atropos API server to enable environment interactions. This is a prerequisite for starting environment microservices. ```bash run-api ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/nousresearch/atropos/blob/main/environments/community/padres_spatial/README.md Copies the example environment file and instructs to add the OpenAI API key. ```bash cp .env.example .env # Add your OpenAI API key to .env ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/nousresearch/atropos/blob/main/CONTRIBUTING.md Create and activate a Python virtual environment, then install project dependencies including development packages. ```bash # Ensure you have Python 3.10+ installed # Create and activate a virtual environment python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate` # Install dependencies, including development dependencies pip install -e ".[dev]" ``` -------------------------------- ### Startup Order for Components Source: https://github.com/nousresearch/atropos/blob/main/example_trainer/README.md Provides the recommended startup sequence for all components: API server, vLLM server, environment, and trainer. Includes health check for vLLM. ```bash # Follow this startup order # 1. Start API first run-api --port 8002 # 2. Wait 5s, then start vLLM # Check health: curl http://localhost:9001/health python -m example_trainer.vllm_api_server --model ... --enable-lora --enforce-eager # 3. Wait for vLLM health endpoint to return 200 while ! curl -s http://localhost:9001/health > /dev/null; do sleep 1; done # 4. Start environment (use --openai.server_type vllm for logprobs) python environments/gsm8k_server.py serve \ --env.group_size 4 \ --env.batch_size 16 \ --env.total_steps 200 \ --env.steps_per_eval 50 \ --env.max_num_workers_per_node 8 \ --env.rollout_server_url "http://localhost:8002" \ --env.use_wandb true \ --env.wandb_name "gsm8k-train-env" \ --openai.base_url "http://localhost:9001/v1" \ --openai.model_name "NousResearch/Hermes-3-Llama-3.1-8B" \ --openai.server_type vllm # 5. Start trainer (will register with API and begin training) python -m example_trainer.grpo --weight-bridge-mode lora_only ... ``` -------------------------------- ### setup Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/envs/README.md This method is called once at the beginning of the environment's lifecycle. Use it for any initial setup required for your specific environment, such as loading datasets, initializing models, or connecting to external resources. ```APIDOC ## async def setup(self) ### Description Initializes the environment. This method is called once at the beginning of the environment's lifecycle. ### Method Asynchronous Function Call ### Parameters None ### Response None ``` -------------------------------- ### Basic Configuration Setup Source: https://github.com/nousresearch/atropos/blob/main/environments/answer_format_environment/README.md Imports necessary classes for setting up the Answer Format Environment configuration. ```python from atropos.environments.answer_format_environment import AnswerFormatEnv, AnswerFormatEnvConfig ``` -------------------------------- ### Environment Setup Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Provides the initial command to set up the environment's configuration file by copying a template. This is a prerequisite for configuring API keys and other settings. ```bash # Environment setup cp .env.template .env ``` -------------------------------- ### Initializing and Running ReasoningGymEnv Source: https://github.com/nousresearch/atropos/blob/main/environments/reasoning_gym_environment/README.md Initialize the Reasoning Gym environment with configuration and server settings, then set it up for use. Assumes 'await' is available in the execution context. ```python from atropos.environments.reasoning_gym_environment import ReasoningGymEnv # Initialize environment env_config, server_configs = ReasoningGymEnv.config_init() env = ReasoningGymEnv(env_config, server_configs) # Setup and run await env.setup() # Training loop handled by atropos framework ``` -------------------------------- ### Python Flask App Example Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md A basic Flask application setup in Python. Ensure proper indentation when performing search and replace operations. ```python import math from flask import Flask ``` -------------------------------- ### Training Loop Example Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md A basic training loop structure for an environment. It shows how to get training items, collect trajectories, and includes a placeholder for policy updates. ```python for episode in range(num_episodes): # Get next training item (resets environment) item = await env.get_next_item() # Collect robot trajectory scored_data, backlog = await env.collect_trajectories(item) # Process rewards and update policy # (Policy update logic would be implemented here) ``` -------------------------------- ### Start Lean Environment in Serve Mode Source: https://github.com/nousresearch/atropos/blob/main/environments/community/lean_proof_env/README.md Run the environment as a server for the Atropos trainer. Ensure your LLM API server is running and accessible. ```bash python environments/lean_env.py serve ``` -------------------------------- ### Environment Setup for FOB and NePS Source: https://github.com/nousresearch/atropos/blob/main/environments/community/pytorch_optimizer_coding/FOB/examples/neps/README.md These commands set up a Conda environment, activate it, and install necessary dependencies for running FOB with NePS, including downgrading some packages as required. ```bash conda create -n fob-neps python=3.10 -y conda activate fob-neps pip install -r requirements.txt pip install -r examples/neps/requirements.txt # this will downgrade some packages pip install -e . ``` -------------------------------- ### Serve Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/README.md Starts the instruction following algorithm environment in serve mode. ```bash python instruction_following_algorithm_environment.py serve ``` -------------------------------- ### Environment Setup: Set Rendering Backend Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Configures the OpenGL rendering backend. Choose 'egl' for GPU acceleration or 'osmesa' for CPU-only environments. ```bash export PYOPENGL_PLATFORM=egl # For GPU acceleration export PYOPENGL_PLATFORM=osmesa # For CPU-only environments ``` -------------------------------- ### Get Environment Status Response Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/api/README.md Example JSON response from the `/status-env` endpoint, providing the current server step, queue size, and the environment's calculated sampling weight relative to others. ```json {"current_step": , "queue_size": , "env_weight": } ``` -------------------------------- ### Start Environment Server Source: https://github.com/nousresearch/atropos/blob/main/environments/community/mcp_tool_calling/GRPO_README.md Launches the environment server, configuring it to connect to the Atropos API and use vLLM for OpenAI compatibility. ```bash python environments/gsm8k_server.py serve \ --env.rollout_server_url "http://localhost:8002" \ --openai.server_type vllm \ --openai.base_url "http://localhost:9001/v1" \ --openai.api_key "dummy" ``` -------------------------------- ### Install Core Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Installs the necessary Python packages for the environment. Ensure you have pip installed. ```bash pip install modal verdict torch lightning ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/router_env/engine/tools/mcp/spotify/README.md Installs project dependencies and builds the project. Ensure Node.js v16+ is installed. ```bash git clone https://github.com/marcelmarais/spotify-mcp-server.git cd spotify-mcp-server npm install npm run build ``` -------------------------------- ### Serve Atropos Environment for Trainer Source: https://github.com/nousresearch/atropos/blob/main/environments/smolagents_integration/README.md Start the Atropos environment in serve mode, making it available for a trainer to connect. ```bash python -m environments.smolagents_integration.smolagents_env serve \ --env.rollout_server_url "http://localhost:8000" \ --env.use_chat_completion true \ --env.max_concurrent_processes 5 \ --env.group_size 8 \ --openai.model_name "your-model-name" \ --openai.base_url "http://localhost:8000/v1" ``` -------------------------------- ### Set Up API Keys Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Exports required API keys as environment variables. Replace placeholders with your actual keys. ```bash export GROK_API_KEY="your_grok_api_key" export MODAL_TOKEN="your_modal_token" ``` -------------------------------- ### Install Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/accessibility_env/README.md Install the necessary Python packages for the accessibility environment. Ensure Atropos core is also installed. ```bash pip install -r requirements.txt pip install lxml ``` ```bash # From the Atropos root: pip install -e .[dev] ``` -------------------------------- ### Run Custom Configuration Training Source: https://github.com/nousresearch/atropos/blob/main/environments/community/quantum_hybrid/README.md Starts training with custom configuration parameters for qubits, layers, steps, and quantum weight. ```bash python atropos.py process \ --env.n_qubits 16 \ --env.n_layers 5 \ --env.total_steps 100 \ --env.quantum_weight 0.5 ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/physical_space_stl/README.md Installs essential Python libraries for 3D rendering, machine learning, and data handling. Ensure you have Python and pip installed. ```shell pip install pyrender trimesh pyglet matplotlib torch transformers pydantic vllm numpy requests tenacity wandb ``` -------------------------------- ### Install Core Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Installs the essential Python packages required for the compression workflow. ```bash pip install numpy scipy scikit-learn openai python-dotenv matplotlib pillow ``` -------------------------------- ### Install Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/meteorology_forecast/README.md Installs the necessary Python dependencies for the project. Ensure you have Python 3.10+. ```bash pip install -r requirements.txt # or manually install atroposlib, wandb, httpx, etc. ``` -------------------------------- ### Initialize DynastAI Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Demonstrates how to create an instance of the DynastAI environment with custom configuration. Ensure the FastAPI backend is running and provide your OpenRouter API key. ```python from environments.community.dynastai.src.dynastai_env import DynastAIEnv, DynastAIEnvConfig # Create environment config = DynastAIEnvConfig( api_host="localhost", api_port=9001, openrouter_api_key="your_key", web_ui=True, web_port=3000 ) env = DynastAIEnv(config) ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/nousresearch/atropos/blob/main/environments/community/deepsacrifice_chess/README.md Installs all project dependencies using the Bun package manager. ```sh bun install ``` -------------------------------- ### Start Trainer (Shared vLLM Mode) Source: https://github.com/nousresearch/atropos/blob/main/example_trainer/README.md Initiates the trainer process in shared vLLM mode. Specify the model name, weight bridge mode, vLLM port, vLLM configuration path, and Atropos URL. ```bash python -m example_trainer.grpo \ --model-name NousResearch/Hermes-3-Llama-3.1-8B \ --weight-bridge-mode shared_vllm \ --vllm-port 9001 \ --vllm-config-path /tmp/grpo_training/vllm_bridge_config.json \ --atropos-url "http://localhost:8002" \ --warmup-steps 20 \ --clip-eps 0.2 ``` -------------------------------- ### Install SmolaGents and Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/smolagents_integration/README.md Install the SmolaGents library and necessary dependencies for web search tools. ```bash pip install smolagents pip install datasets pandas huggingface_hub pip install tavily-python # Required for web search tools (needed by most GAIA tasks) ``` -------------------------------- ### Install Dependencies and Run Environment Source: https://github.com/nousresearch/atropos/blob/main/environments/community/selcube/README.md Installs project dependencies and then runs the Rubik's Cube environment for processing. Configure API keys, model names, and environment parameters as needed. ```bash pip install -r requirements.txt cd atropos/environments/hack0 (OPENAI_API_KEY="OPENAI_KEY" \ python rubiks_cube_environment.py process \ --slurm false \ --openai.model_name gpt-4.1-nano \ --env.tokenizer_name "NousResearch/DeepHermes-3-Llama-3-3B-Preview" \ --env.use_wandb true \ --env.group_size 4 \ --env.max_steps 15 \ --env.scramble_moves 5 \ --env.data_path_to_save_groups "rubiks_process_results.jsonl" \ --env.wandb_name "rubiks_cube_hackathon" \ --env.debug_mode true \ --env.use_curriculum true \ --env.generate_visualizations true \ --env.visualizations_dir "./rubiks_visualizations" \ --env.provide_solving_strategies true) ``` -------------------------------- ### Install Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/game_environments/diplomacy_environment/README.md Installs required packages and the AI_Diplomacy library. Ensure you are in the correct project directory. ```bash pip install -r requirements.txt cd AI_Diplomacy pip install -e . ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/ethereum_virtual_machine/README.md Installs necessary Python libraries for interacting with OpenAI and configuration files. ```bash pip install openai pydantic PyYAML ``` -------------------------------- ### Verify Foundry Installation Source: https://github.com/nousresearch/atropos/blob/main/environments/community/ethereum_virtual_machine/README.md Checks if Anvil, Cast, and Forge are installed correctly by displaying their versions. ```bash anvil --version cast --version forge --version ``` -------------------------------- ### Start Cat Behavior Environment Server Source: https://github.com/nousresearch/atropos/blob/main/environments/community/cat_behavior_env/README.md Run the main server file to launch the cat behavior communication environment. Ensure you are in the correct project directory. ```bash python environments/community/cat_behavior_env/cat_server.py ``` -------------------------------- ### Test DynastAI Installation Source: https://github.com/nousresearch/atropos/blob/main/environments/community/dynastai/README.md Run various test scripts to verify the DynastAI installation and functionality. ```bash python verify_install.py ``` ```bash python run_dynastai.py ``` ```bash python test_card_generation.py ``` ```bash python test_dynastai_env.py ``` -------------------------------- ### Dataset Setup Command Source: https://github.com/nousresearch/atropos/blob/main/environments/community/pytorch_optimizer_coding/FOB/README.md Command to set up datasets based on the experiment configuration file. ```bash python -m pytorch_fob.dataset_setup experiment.yaml ``` -------------------------------- ### Initialize and Evaluate Optimizer Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Demonstrates how to initialize the OptimizerBenchmarkEnvironment and evaluate a generated optimizer code string. The environment returns a reward based on the optimizer's performance. ```python from environments.community.pytorch_optimizer_coding.optimizer_benchmark_environmenr import OptimizerBenchmarkEnvironment # Initialize environment env = OptimizerBenchmarkEnvironment(config=config) # Generate optimizer code (from agent) optimizer_code = """ class NovelOptimizer(torch.optim.Optimizer): def __init__(self, params, lr=1e-3, momentum=0.9): defaults = dict(lr=lr, momentum=momentum) super().__init__(params, defaults) def step(self, closure=None): # Novel optimization logic here pass """ # Evaluate optimizer reward = env.evaluate(optimizer_code) print(f"Total reward: {reward}") ``` -------------------------------- ### Install Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/examcraft/README.md Installs all necessary Python packages for the ExamCraft environment. Ensure you have a requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### GET /status Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/api/README.md Get the current training step count and the number of trajectories currently in the queue. ```APIDOC ## GET /status ### Description Get the current training step (based on batches served) and queue size. ### Method GET ### Endpoint /status ### Response #### Success Response (200) - **current_step** (integer) - The current training step count. - **queue_size** (integer) - The number of trajectories currently in the queue. ``` -------------------------------- ### Bootcamp Registry Interaction Source: https://github.com/nousresearch/atropos/blob/main/environments/intern_bootcamp/README.md Demonstrates how to create a bootcamp instance and retrieve information about available bootcamps using the registry. Ensure the necessary imports are present. ```python from environments.intern_bootcamp.bootcamp_registry import ( create_bootcamp, get_available_bootcamps, bootcamp_registry ) # Create a bootcamp instance bootcamp = create_bootcamp("Game24bootcamp", num_numbers=4, range_max=50) # Get information about a bootcamp info = bootcamp_registry.get_bootcamp_info("Game24bootcamp") print(info["parameters"]) ``` -------------------------------- ### Explore Available Tasks (Python) Source: https://github.com/nousresearch/atropos/blob/main/environments/intern_bootcamp/README.md Programmatically list the first 20 available bootcamp tasks using the registry. This is useful for exploration and understanding the variety of tasks supported. ```python from environments.intern_bootcamp.bootcamp_registry import get_available_bootcamps tasks = get_available_bootcamps() for task in tasks[:20]: # Show first 20 print(task) ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/nousresearch/atropos/blob/main/CONTRIBUTING.md Install pre-commit hooks to automatically run code quality checks on commit. ```bash pre-commit install ``` -------------------------------- ### Using DummyManagedServer with OpenAI Endpoints Source: https://github.com/nousresearch/atropos/blob/main/atroposlib/envs/server_handling/MANAGED_SERVER.md Example demonstrating how to opt-in to DummyManagedServer for OpenAI endpoints and access its interface, noting that token and logprob data are placeholders. ```python import os # Opt-in to dummy managed server for OpenAI os.environ["ATROPOS_ALLOW_DUMMY_MANAGED_SERVER"] = "1" # Now this works with OpenAI endpoints async with self.server.managed_server() as managed: response = await managed.chat_completion(messages=messages, n=4) state = managed.get_state() nodes = state["nodes"] # nodes contain placeholder token data - DO NOT use for training for node in nodes: print(node.full_text) # Real completion text print(node.tokens[:5]) # placeholder values print(node.logprobs[:5]) # placeholder values # Strict mode: get_logprobs is not available on DummyManagedServer # and will raise NotImplementedError. ``` -------------------------------- ### Install Optional Visualization Dependencies Source: https://github.com/nousresearch/atropos/blob/main/environments/community/README.md Installs additional Python packages for enhanced 3D plotting and animation generation. ```bash pip install matplotlib pillow # For 3D plotting and animation generation ```