InternLM/InternBootcamp
Official implement on InternBootCamp
InternAgentHarness (InternBootcamp) – What It Is
InternAgentHarness (also called InternBootcamp) is a research‑oriented framework for building, training, and evaluating large‑language‑model (LLM) agents. It provides a synthetic, programmable environment where an LLM can interact with external tools, receive state feedback, and be rewarded for its actions. The goal is not just to get a high benchmark score, but to create a closed‑loop pipeline that:
- Generates executable tasks (e.g., battery design, robot trajectory planning, financial prediction, poker decision‑making).
- Exposes verified tools that the model can call repeatedly (multi‑round tool calls).
- Manages the multi‑turn dialogue between the model and the environment.
- Computes rewards from intermediate steps and final outcomes, enabling reinforcement‑learning or supervised fine‑tuning.
- Records full interaction traces for reproducibility, data‑generation, and further training.
Core Concepts
| Component | Role |
|---|---|
| InstructionGenerator | Creates the task prompt and the underlying “identity” data that defines the problem (e.g., the arithmetic expression to solve). |
| ToolManager | Registers and runs external tools (functions, simulators, APIs) that the LLM can invoke. |
| InteractionManager | Handles the back‑and‑forth between the model and the environment, allowing multiple rounds of tool calls and optional human‑style feedback. |
| RewardCalculator | Scores each step and the final answer against ground‑truth or rule‑based criteria, producing a scalar reward for training. |
| Evaluator | Runs a batch of episodes, collects trajectories, and outputs metrics for research experiments. |
How It Works (High‑Level Flow)
- Prompt Design – The InstructionGenerator builds a natural‑language prompt describing the task.
- Model Rollout – The LLM receives the prompt and decides whether to call a tool.
- Tool Call – The ToolManager executes the requested tool (e.g., a physics simulator, a calculator, a database query) and returns the result.
- Environment Feedback – The InteractionManager may add follow‑up questions or hints based on the tool output.
- Reward Calculation – After each step and at the end, the RewardCalculator compares the model’s answer to the ground truth and emits a reward signal.
- Loop – Steps 2‑5 repeat until a termination condition is met (max turns, perfect score, etc.).
- Logging – Every turn (model message, tool request, tool response, reward) is saved to a JSONL file for later analysis or fine‑tuning.
What You Can Do With It
- Create new synthetic tasks by implementing a tiny subclass of
BaseInstructionGeneratorand optionally aBaseToolandBaseInteraction. - Collect training data: run the framework in “rollout” mode to generate thousands of multi‑turn interaction logs that can be used for supervised fine‑tuning or RLHF.
- Benchmark tool‑use ability: evaluate how well a model plans, calls tools, and corrects itself across diverse domains (engineering, finance, games, robotics).
- Run distributed tool servers: the built‑in Master‑Worker tool server lets you scale heavy tools across multiple machines.
Getting Started (From the README)
- Install the repository and its sub‑modules (
verl,openevolve) withpip install -e .and the providedrequirements‑editable.txt. - Define a task by writing an
InstructionGeneratorsubclass and a YAML config that sets generation ratios, random seeds, and data splits. - Optionally add tools (e.g., a calculator) by subclassing
BaseTooland providing a JSON schema that will be sent to the LLM as a function definition. - Run data generation with the
internbootcamp.utils.data_generationCLI, which outputs JSONL (and optional Parquet) files containing full episode traces. - Evaluate a model with
internbootcamp.utils.run_evaluation, pointing it at your dataset, API key, and the tool/interaction configs.
Who It’s For
Researchers and developers who need a flexible sandbox for LLM‑agent experiments—especially those working on tool‑augmented reasoning, reinforcement learning from human feedback, or multi‑step planning in simulated environments.
All details above are taken directly from the project's README; no additional features have been inferred.
Related
- Project
- Project
- Project
- Project
- Project