mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +00:00
3.2 KiB
3.2 KiB
Active Context
Current Focus
Modal backend integration has been MERGED AND UPDATED from the modal-integration branch.
Recently Completed (Feb 8, 2026)
Modal Backend Integration - MERGED & WORKING
Merged the modal-integration branch into atropos-integrations and fixed integration issues.
What was merged (from another dev's branch):
atropos/backends/modal_backend.py- Complete Modal backend with:ModalSandboxConfig- Unified config with YAML profiles, env vars, and AgentEnv config loading_ModalSandboxWithSlots- Modal Sandbox wrapper with slot-based multiplexing_ModalSandboxPool- Auto-scaling pool of Modal sandboxes_ModalMultiProfileManager- Multi-profile support (CPU, GPU, high-memory)ModalToolBackend- Full ToolBackend implementation
atropos/backends/__init__.py- Updatedcreate_tool_backend()to supportmodalmodetools/terminal_tool.py- Native Modal Sandbox integration with:ModalProfileconfig + YAML loading_ModalSandboxPool(sync, thread-based for CLI use)_ModalPoolManager(singleton, multi-profile)_ModalSandboxEnvironmentreplacing old_ModalEnvironment
docs/MODAL_BACKEND.md- Comprehensive documentationmodal_profiles.yaml.example- Example profiles configtests/test_modal_integration.py- Integration teststests/test_modal_stress.py- Stress teststests/test_modal_terminal.py- Terminal tool tests
What I fixed after merge:
atropos/envs/agent_env.py- Replaced old stub Modal fields with proper config fields matchingModalSandboxConfig.from_agent_env_config():modal_image,modal_gpu,modal_cpu,modal_memorymodal_slots_per_sandbox,modal_min_sandboxes,modal_max_sandboxesmodal_idle_timeout,modal_max_lifetimemodal_acquire_timeout,modal_execution_timeoutmodal_secrets,modal_env_vars,modal_workspace_base
atropos/backends/modal_backend.py- Guardedyamlimport with try/except
Key Architecture Decisions:
- Uses Modal Sandboxes (not Functions) - long-lived containers that stay hot
- Uses
sandbox.exec()directly instead of HTTP/sandbox_server.py - simpler approach - Slot-based multiplexing matching Nomad's pattern
- Multi-profile support for heterogeneous workloads (CPU vs GPU)
- Named sandbox recovery for resilience
- Modal SDK v1.3.2 compatible
Previous Work (Feb 6, 2026)
Singularity/Apptainer Sandbox Integration - FULLY WORKING
See progress.md for details.
Usage
Modal Backend (Atropos):
python -m atropos.envs.swe_smith_oracle_env process \
--env.tool_pool_mode modal \
--env.modal_image python:3.11 \
--env.modal_slots_per_sandbox 10 \
--env.modal_max_sandboxes 5
Modal Terminal Tool (CLI):
export TERMINAL_ENV=modal
export TERMINAL_MODAL_IMAGE=python:3.11
./hermes
With GPU Profile:
# In modal_profiles.yaml
profiles:
pytorch-gpu:
image: pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
gpu: T4
memory: 16384
Next Steps
- Live test Modal backend with actual Modal credentials
- Test multi-profile GPU workflows
- Test sandbox recovery after restart
- Integrate with SWE-smith-oracle env for full GRPO training loop