Skip to content

Commit 5003207

Browse files
committed
revise docs
1 parent a9c3c89 commit 5003207

38 files changed

Lines changed: 641 additions & 4501 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We aim to build a easy-to-learn Agent tuner that unlock more possibilities for a
2929
- **Easy and Friendly**. AgentJet helps you tune models behind your agent workflows easily, optimizing your agents for top performance with minimal effort.
3030
- **Rich Tutorial Library**. AgentJet provides a rich library of [examples](https://github.com/modelscope/AgentJet/tree/main/tutorial) as tutorials.
3131
- **Efficient and Scalable**. AgentJet uses [verl] as the default backbone (`--backbone=verl`). However, we also support [trinity](https://github.com/modelscope/Trinity-RFT/) as alternative backbone, accelerating your tuning process via fully asynchronous RFT.
32-
- **Flexible and Fast**. AgentJet supports [multi-agent workflows](docs/en/workflow.md) and adopts a context merging technique, accelerating training by 1.5x to 20x when the workflow involves multi-turn (or multi-agent) conversations.
32+
- **Flexible and Fast**. AgentJet supports [multi-agent workflows](docs/en/workflow.md) and adopts a context merging technique, accelerating training by 1.5x to 10x when the workflow involves multi-turn (or multi-agent) conversations.
3333
- **Reliability and Reproducibility**. Our team keeps track of framework performance across multiple [tasks + major-git-version + training-backbones](https://benchmark.agent-matrix.com/) (under construction, still gathering data, comming soon).
3434

3535
For advanced researchers, AgentJet also provides high-resolution logging and debugging solutions:
@@ -110,7 +110,7 @@ The internal system orchestrates several specialized modules to handle the compl
110110
* **Task Rollout**: Bridges LLM engines and manages the Gym environment lifecycle.
111111
* **Task Runner**: Executes the Agent workflow and calculates rewards.
112112
* **Model Tuner**: Forwards inference requests from the workflow to the LLM engine.
113-
* **Context Tracker**: Monitors LLM calls and automatically merges shared-history timelines to improve training efficiency by **3x to 10x**.
113+
* **Context Tracker**: Monitors LLM calls and automatically merges shared-history timelines to improve training efficiency by **1.5x to 10x**.
114114

115115

116116
---

ajet/workflow.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def execute(self, workflow_task: WorkflowTask, tuner: AjetTuner) -> Workfl
2424
2525
1. Single agent scenario 🤖:
2626
27-
Simply set `model` argument to `model_tuner` when initializing your agent.
27+
Simply set `model` argument to `tuner.as_agentscope_model()` when initializing your agent.
2828
This is a helpful example when you:
2929
- 🌟 Know exactly which agents should be trained, or the number of agents are small;
3030
- ✨ Already finished basic debugging of your workflow using a fixed model such as qwen-max;
@@ -92,17 +92,35 @@ async def execute(self, workflow_task: WorkflowTask, tuner: AjetTuner) -> Workfl
9292
[ ] roles = ["werewolf"] * 3 + ["villager"] * 3 + ["seer", "witch", "hunter"]
9393
[ ] players = []
9494
[ ] for i, role in enumerate(roles):
95-
[ ] default_model_for_good_guys = OpenAIChatModel(model_name="qwen-max", stream=False)
96-
[ ] default_model_for_bad_guys = OpenAIChatModel(model_name="qwen-plus", stream=False)
97-
[ ] chosen_model = default_model_for_good_guys if role != "werewolf" else default_model_for_bad_guys # 🌟
95+
[ ] debug_model_for_good_guys = OpenAIChatModel(model_name="qwen-max", stream=False)
96+
[ ] debug_model_for_bad_guys = OpenAIChatModel(model_name="qwen-plus", stream=False)
97+
[ ] chosen_model = debug_model_for_good_guys if role != "werewolf" else debug_model_for_bad_guys # 🌟
9898
[ ] players += [ReActAgent(
9999
[ ] name=f"Player{i + 1}",
100100
[ ] sys_prompt=get_official_agent_prompt(f"Player{i + 1}"),
101101
[-] model=chosen_model,
102-
[+] model=model_tuner.register_model(role, default_model=chosen_model),
102+
[+] model=tuner.as_agentscope_model(f"Player{i + 1}", role, debug_model=chosen_model),
103103
[ ] formatter=OpenAIMultiAgentFormatter(),
104104
[ ] )]
105105
106106
107+
[ ] roles = ["werewolf"] * 3 + ["villager"] * 3 + ["seer", "witch", "hunter"]
108+
[ ] players = []
109+
[ ] for i, agent_role in enumerate(roles):
110+
[ ] if agent_role != "werewolf":
111+
[ ] chosen_model_for_current_agent = OpenAIChatModel(model_name="qwen-max", stream=False)
112+
[ ] else:
113+
[ ] chosen_model_for_current_agent = OpenAIChatModel(model_name="qwen-plus", stream=False)
114+
[ ] players += [ReActAgent(
115+
[ ] name=f"Player{i + 1}",
116+
[ ] sys_prompt=get_official_agent_prompt(f"Player{i + 1}"),
117+
[ ] model=agentscope_model,
118+
[ ] model=tuner.as_agentscope_model(
119+
[ ] agent_name=f"Player{i + 1}",
120+
[ ] target_tag=agent_role, # 🌟 tag agents with their role
121+
[ ] debug_model=chosen_model_for_current_agent # 🌟 assign a debug model, ONLY used when we are NOT training this agent
122+
[ ] )
123+
[ ] formatter=OpenAIMultiAgentFormatter(),
124+
[ ] )]
107125
108126
"""

docs/en/agent_framework_support.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Supported Agent Frameworks
2+
3+
4+
5+
6+
##
7+
8+
9+
10+
## AgentScope
11+
12+
13+
14+
15+
16+
17+

docs/en/installation.md

Lines changed: 46 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
This document provides a step-by-step guide to installing AgentJet.
44

5-
!!! tip "Latest Version Recommended"
5+
!!! tip "Latest Version Recommended:"
6+
67
AgentJet is under active development and iteration. We recommend installing from source to get the latest features and bug fixes.
78

8-
---
99

1010
## Prerequisites
1111

1212
| Requirement | Version |
1313
|-------------|---------|
1414
| **Python** | 3.10 |
15-
| **CUDA** | 12.8 or higher |
1615

17-
---
1816

1917
## Install from Source
2018

@@ -34,98 +32,83 @@ AgentJet supports multiple backbones. Currently we have `verl` and `trinity` (re
3432
!!! info "Package Manager"
3533
We recommend using `uv` to manage your Python environment as it is incredibly fast. See also [`uv` installation document](https://docs.astral.sh/uv/getting-started/installation/).
3634

37-
If you prefer `conda`, you can also install via conda and pip (simply change `uv pip` to `pip`).
38-
39-
=== "Verl (Recommended)"
35+
And of course, if you prefer `conda`, you can also install via conda and pip (simply change `uv pip` to `pip`).
4036

41-
Install with `verl` training backbone:
37+
=== "VERL (uv)"
4238

4339
```bash
40+
# Install with `verl` training backbone:
41+
4442
uv venv --python=3.10
4543
source .venv/bin/activate
46-
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ -e .[verl]
47-
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ --verbose flash-attn --no-deps --no-build-isolation --no-cache
44+
uv pip install -e .[verl]
45+
46+
#`flash-attn` must be installed after other dependencies
47+
uv pip install --verbose flash-attn --no-deps --no-build-isolation --no-cache
4848
```
4949

5050
!!! warning "flash-attn Installation"
5151
`flash-attn` must be installed after other dependencies. To build faster, export `MAX_JOBS=${N_CPU}`, or ensure a healthy connection to GitHub to install pre-compiled wheels.
5252

53-
54-
=== "Trinity"
55-
56-
Install with `trinity` training backbone for fully asynchronous RFT:
53+
=== "VERL (conda)"
5754

5855
```bash
59-
uv venv --python=3.10
60-
source .venv/bin/activate
61-
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ -e .[trinity]
62-
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ --verbose flash-attn --no-deps --no-build-isolation --no-cache
63-
```
56+
# Install with `verl` training backbone:
6457

65-
---
58+
conda create -n ajet-verl python=3.10
59+
conda activate ajet-verl
60+
pip install -e .[verl]
6661

67-
## Install via Docker
68-
69-
If you prefer one-click dependency installation, we provide a Docker image to jump start!
62+
#`flash-attn` must be installed after other dependencies
63+
pip install --verbose flash-attn --no-deps --no-build-isolation --no-cache
64+
```
7065

71-
!!! warning "Prerequisites"
72-
Before proceeding, ensure you have **nvidia docker** installed on your system. CUDA is needed inside our docker container, which requires toolkits from Nvidia for GPU support.
66+
!!! warning "flash-attn Installation"
67+
`flash-attn` must be installed after other dependencies. To build faster, export `MAX_JOBS=${N_CPU}`, or ensure a healthy connection to GitHub to install pre-compiled wheels.
7368

74-
### Setup Nvidia Docker Runtime
7569

76-
Please install nvidia docker runtime on the host Ubuntu system. For details, refer to:
70+
=== "VERL (aliyun)"
7771

78-
- [Nvidia Official Document](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian)
79-
- [Setup Ubuntu Guide](./setup_ubuntu.md) (our step-by-step manual)
8072

81-
### Run Docker Container
73+
```bash
74+
# Install with `verl` training backbone:
8275

83-
This command mounts your current working directory (the root directory of agentjet) to `/workspace` and your data directory to `/data` inside the container.
76+
uv venv --python=3.10
77+
source .venv/bin/activate
78+
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ -e .[verl]
8479

85-
```bash
86-
docker run -it \
87-
--gpus all \
88-
--shm-size="64g" \
89-
--rm \
90-
-v $PWD:/workspace \
91-
-v /path/to/your/checkpoint/and/data:/data \
92-
agentjet:latest
93-
```
80+
#`flash-attn` must be installed after other dependencies
81+
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ --verbose flash-attn --no-deps --no-build-isolation --no-cache
82+
```
9483

95-
---
84+
!!! warning "flash-attn Installation"
85+
`flash-attn` must be installed after other dependencies. To build faster, export `MAX_JOBS=${N_CPU}`, or ensure a healthy connection to GitHub to install pre-compiled wheels.
9686

97-
## Verify Installation
9887

99-
After installation, verify that everything is working correctly:
88+
=== "Trinity"
10089

101-
```python
102-
import ajet
103-
print(ajet.__version__)
104-
```
90+
```bash
91+
# Install with `trinity` training backbone for fully asynchronous RFT:
10592

106-
---
93+
uv venv --python=3.10
94+
source .venv/bin/activate
95+
uv pip install -e .[trinity]
96+
uv pip install --verbose flash-attn --no-deps --no-build-isolation --no-cache
97+
```
10798

108-
## Troubleshooting
10999

110-
??? note "Common Issues"
111-
**Issue**: `flash-attn` installation fails
100+
=== "Trinity (aliyun)"
112101

113-
**Solution**: Make sure you have CUDA toolkit installed and `MAX_JOBS` environment variable set:
114102
```bash
115-
export MAX_JOBS=4
116-
uv pip install flash-attn --no-build-isolation
117-
```
103+
# Install with `trinity` training backbone for fully asynchronous RFT:
118104

119-
??? note "GPU Not Detected"
120-
**Issue**: Docker container doesn't see GPU
121-
122-
**Solution**: Ensure nvidia-docker is properly installed:
123-
```bash
124-
nvidia-smi # Should show GPU info
125-
docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi
105+
uv venv --python=3.10
106+
source .venv/bin/activate
107+
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ -e .[trinity]
108+
uv pip install -i https://mirrors.aliyun.com/pypi/simple/ --verbose flash-attn --no-deps --no-build-isolation --no-cache
126109
```
127110

128-
---
111+
129112

130113
## Next Steps
131114

docs/en/intro.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
11
# Introduction
22

3-
**AgentJet (AgentJet)** is a cutting-edge, user-friendly training framework designed to optimize AgentScope agents and workflows, fine-tuning language model weights behind the scenes.
3+
**AgentJet (AgentJet)** is a cutting-edge, user-friendly agent tunning framework designed to optimize LLM models and agent workflows.
44

5-
Simply provide your AgentScope workflow, training data, and reward function, and we will be ready to enhance your agents to their optimal performance!
5+
Simply provide your workflow (built from AgentScope, OpenAI SDK, Langchain, raw HTTP requests, or hybrid of all of them), training data, and reward function, and we will be ready to enhance your agents to their optimal performance!
66

7-
---
87

98
## Features
109

11-
We aim to build an easy-to-learn AgentJet that unlocks more possibilities for agent developers:
12-
13-
<div class="card-grid">
14-
<a href="./configuration/" class="feature-card"><div class="card-header"><img src="https://api.iconify.design/lucide:rocket.svg" class="card-icon card-icon-agent" alt=""><h3>Easy and Friendly</h3></div><p class="card-desc">AgentJet helps you tune models behind your agent workflows easily, optimizing your agents for top performance with minimal effort.</p></a>
15-
<a href="#example-library" class="feature-card"><div class="card-header"><img src="https://api.iconify.design/lucide:book-open.svg" class="card-icon card-icon-general" alt=""><h3>Rich Tutorial Library</h3></div><p class="card-desc">Rich library of examples as tutorials: Math Agent, Werewolves Game, AppWorld and more.</p></a>
16-
<a href="./installation/" class="feature-card"><div class="card-header"><img src="https://api.iconify.design/lucide:zap.svg" class="card-icon card-icon-tool" alt=""><h3>Efficient and Scalable</h3></div><p class="card-desc">Uses <a href="https://github.com/modelscope/Trinity-RFT/">Trinity</a> as the default backbone with fully asynchronous RFT. Support for verl backbone as fallback.</p></a>
17-
</div>
10+
AgentJet aims to build a state-of-the-art agent tuning platform for both developers and researchers
1811

19-
!!! tip "Multi-Agent Support"
20-
AgentJet supports [multi-agent workflows](./workflow.md) and adopts a context merging technique, accelerating training by **1.5x to 20x** when the workflow involves multi-turn (or multi-agent) conversations.
12+
- **Easy and Friendly**. AgentJet helps you tune models behind your agent workflows easily, optimizing your agents for top performance with minimal effort.
13+
- **Rich Tutorial Library**. AgentJet provides a rich library of [examples](https://github.com/modelscope/AgentJet/tree/main/tutorial) as tutorials.
14+
- **Efficient and Scalable**. AgentJet uses [verl] as the default backbone (`--backbone=verl`). However, we also support [trinity](https://github.com/modelscope/Trinity-RFT/) as alternative backbone, accelerating your tuning process via fully asynchronous RFT.
15+
- **Flexible and Fast**. AgentJet supports [multi-agent workflows](docs/en/workflow.md) and adopts a context merging technique, accelerating training by 1.5x to 10x when the workflow involves multi-turn (or multi-agent) conversations.
16+
- **Reliability and Reproducibility**. Our team keeps track of framework performance across multiple [tasks + major-git-version + training-backbones](https://benchmark.agent-matrix.com/) (under construction, still gathering data, comming soon).
2117

22-
!!! info "Reliability & Reproducibility"
23-
Our team keeps track of framework performance across multiple [tasks + major-git-version + training-backbones](https://benchmark.agent-matrix.com/).
18+
For advanced researchers, AgentJet also provides high-resolution logging and debugging solutions:
19+
<!-- For advanced researchers, AgentJet provides high-resolution logging and debugging solutions that are, to our knowledge, unprecedented in other prior projects. -->
2420

25-
### For Advanced Researchers
21+
- **High-Resolution Logging**: AgentJet allows users to save and inspect token-level rollout details, recording token IDs, token loss masks, and even token logprobs to facilitate workflow development and agent diagnostics.
22+
- **Fast Debugging**: AgentJet also provides the `--backbone=debug` option for the best debugging experience, shortening your wait period from minutes to seconds after code changes and enabling breakpoint debugging in IDEs.
2623

27-
AgentJet also provides high-resolution logging and debugging solutions:
2824

29-
| Feature | Description |
30-
|---------|-------------|
31-
| **High-Resolution Logging** | Save and inspect token-level rollout details, recording token IDs, token loss masks, and even token logprobs |
32-
| **Fast Debugging** | Use `--backbone=debug` option, shortening wait time from minutes to seconds after code changes |
3325

34-
---
3526

3627
## Quick Start
3728

@@ -52,10 +43,10 @@ We recommend using `uv` for dependency management.
5243
uv venv --python=3.10.16 && source .venv/bin/activate
5344
uv pip install -e .[trinity]
5445
# Note: flash-attn must be installed after other dependencies
55-
uv pip install flash_attn==2.8.1 --no-build-isolation --no-cache-dir
46+
uv pip install flash_attn==2.8.3 --no-build-isolation --no-cache-dir
5647
```
5748

58-
### Run Training
49+
- Train the first agent
5950

6051
You can start training your first agent with a single command using a pre-configured YAML file:
6152

@@ -66,7 +57,6 @@ ajet --conf tutorial/example_math_agent/math_agent.yaml --backbone='trinity' --w
6657
!!! example "Learn More"
6758
See the [Math Agent](./example_math_agent.md) example for detailed explanation.
6859

69-
---
7060

7161
## Example Library {#example-library}
7262

@@ -112,7 +102,7 @@ The internal system orchestrates several specialized modules to handle the compl
112102
| **Task Rollout** | Bridges LLM engines and manages the Gym environment lifecycle |
113103
| **Task Runner** | Executes the AgentScope workflow and calculates rewards |
114104
| **Model Tuner** | Forwards inference requests from the workflow to the LLM engine |
115-
| **Context Tracker** | Monitors LLM calls and automatically merges shared-history timelines (**3x-10x** efficiency boost) |
105+
| **Context Tracker** | Monitors LLM calls and automatically merges shared-history timelines (**1.5x-10x** efficiency boost) |
116106

117107
---
118108

docs/en/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We aim to build a easy-to-learn AgentJet that unlock more possibilities for agen
1313
- **Easy and Friendly**. AgentJet helps you tune models behind your agent workflows easily, optimizing your agents for top performance with minimal effort.
1414
- **Rich Tutorial Library**. AgentJet provides a rich library of [examples](#example-library) as tutorials.
1515
- **Efficient and Scalable**. AgentJet uses [trinity](https://github.com/modelscope/Trinity-RFT/) as the default backbone (`--backbone=trinity`), accelerating your tuning process via fully asynchronous RFT. Nevertheless, if actor colocating is your preference, you can still fall back to the [verl](./installation.md) backbone.
16-
- **Flexible and Fast**. AgentJet supports [multi-agent workflows](./workflow.md) and adopts a context merging technique, accelerating training by 1.5x to 20x when the workflow involves multi-turn (or multi-agent) conversations.
16+
- **Flexible and Fast**. AgentJet supports [multi-agent workflows](./workflow.md) and adopts a context merging technique, accelerating training by 1.5x to 10x when the workflow involves multi-turn (or multi-agent) conversations.
1717
- **Reliability and Reproducibility**. Our team keeps track of framework performance across multiple [tasks + major-git-version + training-backbones](https://benchmark.agent-matrix.com/) (under construction, still gathering data, comming soon).
1818

1919
For advanced researchers, AgentJet also provides high-resolution logging and debugging solutions:
@@ -94,7 +94,7 @@ The internal system orchestrates several specialized modules to handle the compl
9494
* **Task Rollout**: Bridges LLM engines and manages the Gym environment lifecycle.
9595
* **Task Runner**: Executes the AgentScope workflow and calculates rewards.
9696
* **Model Tuner**: Forwards inference requests from the workflow to the LLM engine.
97-
* **Context Tracker**: Monitors LLM calls and automatically merges shared-history timelines to improve training efficiency by **3x to 10x**.
97+
* **Context Tracker**: Monitors LLM calls and automatically merges shared-history timelines to improve training efficiency by **1.5x to 10x**.
9898

9999

100100
---

0 commit comments

Comments
 (0)