OpenSource-Hub

OpenEnv

프레임워크

huggingface/OpenEnv

강화 학습 훈련을 위한 에이전트 실행 환경 프레임워크.

개요

OpenEnv은 Gymnasium과 유사한 API를 통해 에이전트 실행 환경과 상호작용하기 위한 표준을 제공합니다. 환경 생성 도구와 배포를 위한 명령줄 인터페이스를 포함하며, 격리되고 안전하며 사용하기 쉬운 RL 후훈련 환경을 지원합니다.

README 미리보기

#  OpenEnv: Agentic Execution Environments\n\nAn e2e framework for creating, deploying and using isolated execution environments for agentic RL training, built using Gymnasium style simple APIs.\n\n\n    \n    \n    \n    \n    \n    \n\n\n---\n\n**Featured Example:** Train LLMs to play BlackJack using [torchforge](https://meta-pytorch.org/torchforge/) (PyTorch's agentic RL framework): [`examples/grpo_blackjack/`](examples/grpo_blackjack/)\n\n**Zero to Hero Tutorial:** End to end tutorial from our [GPU Mode](tutorial/README.md) lecture and other hackathons.\n\n## Quick Start\n\nInstall the OpenEnv package:\n\n```bash\npip install openenv\n```\n\nInstall an environment client (e.g., Echo):\n\n```bash\npip install git+https://huggingface.co/spaces/openenv/echo_env\n```\n\nThen use the environment:\n\n```python\nimport asyncio\nfrom echo_env import CallToolAction, EchoEnv\n\nasync def main():\n    # Connect to a running Space (async context manager)\n    async with EchoEnv(base_url="https://openenv-echo-env.hf.space") as client:\n        # Reset the environment\n        result = await client.reset()\n        print(result.observation.echoed_message)  # "Echo environment ready!"\n\n        # Send messages\n        result = await client.step(\n            CallToolAction(\n                tool_name="echo_message",\n                arguments={"message": "Hello, World!"},\n            )\n        )\n        print(result.observation.result)  # "Hello, World!"\n        print(result.reward)\n\nasyncio.run(main())\n```\n\n**Synchronous usage** is also supported via the `.sync()` wrapper:\n\n```python\nfrom echo_env import CallToolAction, EchoEnv\n\n# Use .sync() for synchronous context manager\nwith EchoEnv(base_url="https://openenv-echo-env.hf.space").sync() as client:\n    result = client.reset()\n    result = client.step(\n        CallToolAction(\n            tool_name="echo_message",\n            arguments={"message": "Hello, World!"},\n        )\n    )\n    print(result.obse