Compare commits

...

5 Commits

Author SHA1 Message Date
Yuge Zhang e1d7569514 . 2025-12-23 19:02:39 +08:00
Yuge Zhang 9d096cab06 unmatch -> mismatch 2025-12-23 18:51:50 +08:00
Yuge Zhang a399fc1f93 . 2025-12-23 16:37:24 +08:00
Yuge Zhang 0eac28434b fix build artifact 2025-12-23 16:12:20 +08:00
Yuge Zhang 0b470e9169 fix trajectory mode doc 2025-12-23 16:10:55 +08:00
4 changed files with 25 additions and 16 deletions
+9 -5
View File
@@ -41,15 +41,19 @@ class VERL(Algorithm):
```python
config["agentlightning"]["trace_aggregator"] = {
"level": "trajectory",
"trajectory_max_prompt_length": ...,
"trajectory_max_response_length": ...,
"trajectory_max_prompt_length": 4096,
"trajectory_max_response_length": 34384,
}
```
Keep conversations structured (message lists rather than manual string
concatenation) so prefix matching can stitch traces, and toggle `debug=True` plus
`unmatch_log_dir` when you need to inspect retokenization or chat-template
mismatches. See [this blog post](https://agent-lightning.github.io/posts/trajectory_level_aggregation/)
concatenation) so prefix matching can stitch traces. `trajectory_max_prompt_length`
should be set to the maximum length of the prompt for the first turn, and
`trajectory_max_response_length` should be set to the maximum cumulative
length of agent responses in the full trajectory.
Toggle `debug=True` plus `mismatch_log_dir` when you need to inspect
retokenization or chat-template mismatches. See
[this blog post](https://agent-lightning.github.io/posts/trajectory_level_aggregation/)
for more details.
Examples:
+1 -1
View File
@@ -13,7 +13,7 @@ agentlightning:
trajectory_max_prompt_length: 2048 # supported in trajectory level aggregation, suggest to set as maximum length for the prompt in first turn
trajectory_max_response_length: 8192 # supported in trajectory level aggregation, suggest to set as maximum length for the cumulative agent responses in the full trajectory, i.e., n_turns * (max_response_length + max_prompt_length)
debug: False # supported in trajectory level aggregation, enable to diagnose trace merging failures
unmatch_log_dir: ./unmatch_cases # supported in trajectory level aggregation with debug=True, directory to store logs of unmatched cases
mismatch_log_dir: ./mismatch_cases # supported in trajectory level aggregation with debug=True, directory to store logs of mismatch cases
data:
filter_overlong_prompts: false
+1 -1
View File
@@ -945,7 +945,7 @@ class AgentModeDaemon:
global_steps,
rollout_id,
turn_index,
self.trace_aggregator.get("unmatch_log_dir", None),
self.trace_aggregator.get("mismatch_log_dir", None),
)
if is_prefix:
+14 -9
View File
@@ -328,19 +328,24 @@ include = [
"agentlightning/**/*.yaml",
"agentlightning/**/*.yml",
"agentlightning/**/*.poml",
"agentlightning/**/*.html",
"agentlightning/**/*.js",
"agentlightning/**/*.css",
"agentlightning/**/*.svg",
]
artifacts = [
"agentlightning/dashboard/**",
]
[tool.hatch.build.targets.sdist]
exclude = [
"examples/**",
"tests/**",
"docs/**",
"scripts/**",
"dashboard/**",
"/examples/**",
"/tests/**",
"/docs/**",
"/scripts/**",
"/dashboard/**",
"/docker/**",
"/contrib/**",
"/.github/**",
]
artifacts = [
"agentlightning/dashboard/**",
]
[tool.pytest.ini_options]