fhaviary
Gymnasium framework for training language model agents on constructive tasks
Decision gist · record as of 2026-08-14
Yes, if you are building or evaluating language agent systems on structured tasks. The framework is actively maintained, has no known vulnerabilities, uses permissive licensing, and provides a clean abstraction for agent-environment interaction. Best suited for researchers and developers working with language model agents; less relevant if you only need a standard RL gym or don't plan to define custom environments.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- A custom agent implementation or integration with an external agent library is needed to run agents on the environment; this package defines the environment interface only.
- Low install friction with a pure-Python wheel distribution.
License · maintenance · safety
permissive license (permissive) — Apache License 2.0 is permissive and allows commercial use, modification, and distribution with minimal restrictions. You must include a copy of the license and note any changes to the source.
last release 2026-04-16 (120 days) · last repo commit 2026-08-14 · 277 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 106,011 downloads/mo, #12,673 on PyPI
Alternatives
Verify before relying
pip install fhaviary
from aviary.core import Environment, Message, ToolRequestMessage, Tool
class CounterEnv(Environment):
async def reset(self):
self.state = {"count": 0}
self.tools = [Tool.from_function(self.increment)]
return [Message(content="Start counting")], self.tools
async def step(self, action: ToolRequestMessage):
obs = await self.exec_tool_calls(action)
return obs, 0, False, False
def increment(self):
self.state["count"] += 1
return f"count={self.state['count']}"- Whether pre-built environments (GSM8K, HotPotQA, LabBench, LFRQA, Notebook) are included in base install or require optional extras
- Whether the sister library LDP is required to use Aviary or optional for advanced workflows
- Performance characteristics and scalability limits for agent training at scale
What it is and what it does
This package provides a gymnasium-style framework for building custom reinforcement learning environments where language model agents solve tasks by making tool calls and exchanging messages. It defines core abstractions—Environment, Message, Tool, and ToolRequestMessage—that handle agent-environment communication following OpenAI's message standard. The library ships with pre-built environments for math, general knowledge, biological sequences, scientific literature, and protein stability tasks, plus a Jupyter notebook environment.
The core workflow involves subclassing Environment to define custom tasks, implementing reset() to initialize state and tools, and step() to execute agent actions and return observations and rewards. Communication flows through a message formalism where agents emit ToolRequestMessage objects containing tool calls, and the environment responds with ToolResponseMessage objects or general observations. The framework is designed to integrate with a sister library for defining agents as Language Decision Processes, though it remains task-agnostic and works with any agent implementation.
Use it for
- Train language agents on math reasoning tasks by defining environments with calculator tools and evaluating agent trajectories
- Build custom multi-step reasoning environments where agents call domain-specific tools to solve problems
- Evaluate language model performance on knowledge retrieval by wrapping datasets as environments with tool-based interaction
- Research agent behavior on scientific tasks like protein stability prediction or sequence analysis
- Run Jupyter notebooks as interactive environments where agents execute code and observe outputs
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building or evaluating language agent systems on structured tasks.
The framework is actively maintained, has no known vulnerabilities, uses permissive licensing, and provides a clean abstraction for agent-environment interaction. Best suited for researchers and developers working with language model agents; less relevant if you only need a standard RL gym or don't plan to define custom environments.
Install
fhaviary on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits. Supports Python 3.11 through 3.14 with 5 runtime dependencies including httpx and pydantic.
Requires Python 3.11 or later. A custom agent implementation or integration with an external agent library is needed to run agents on the environment; this package defines the environment interface only.
License in practice
Apache License 2.0 is permissive and allows commercial use, modification, and distribution with minimal restrictions. You must include a copy of the license and note any changes to the source.
Quickstart
pip install fhaviary
from aviary.core import Environment, Message, ToolRequestMessage, Tool
class CounterEnv(Environment):
async def reset(self):
self.state = {"count": 0}
self.tools = [Tool.from_function(self.increment)]
return [Message(content="Start counting")], self.tools
async def step(self, action: ToolRequestMessage):
obs = await self.exec_tool_calls(action)
return obs, 0, False, False
def increment(self):
self.state["count"] += 1
return f"count={self.state['count']}"
Verify before relying
- Whether pre-built environments (GSM8K, HotPotQA, LabBench, LFRQA, Notebook) are included in base install or require optional extras
- Whether the sister library LDP is required to use Aviary or optional for advanced workflows
- Performance characteristics and scalability limits for agent training at scale
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesdocstring_parserhttpxhttpx-aiohttppydantic-corepydantic |
| Maintenance | Actively maintained 120 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 106,011 / month, #12,673 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: fhaviary-0.35.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “language agent RL environments”
- fhaviaryA gymnasium framework for defining custom reinforcement learning…
- verifiersVerifiers provides environments and evaluation harnesses for training…
- gem-llmGEM is a reinforcement learning environment suite that provides a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also gymnasium · nemo-gym · gem-llm · gym-aloha · pettingzoo · livekit-plugins-anthropic · stable-baselines3 · kaggle-environments · openenv-core · TextArena