OpenPipe/ART

[Feature Request] Add integration to smolagents

Opened this issue ยท 2 comments

Proposal

Hello OpenPipe Team! Thanks for creating such a cool project for agent RL.

I recently saw the LangGraph integration announcement and tested it, and it works great :)
I'd like to propose adding Smolagents integration as well.

I believe Smolagents is fit for ART for several reasons:

  • Simplicity: Smolagents follows a philosophy of simplicity, making it accessible while maintaining capabilities
  • Community: Like LangGraph, it provides diverse community examples and recipes. Particularly, recipes like open_deep_research are ideal use cases where ART's RL techniques can provide significant value
  • Integration-friendly: Smolagents' class architecture (ReACT, Memory, Message, Logging, etc.) is well-structured and easily accessible, making it straightforward to integrate with ART

Example

from art.smolagents import init_chat_model
from smolagents import CodeAgent, WebSearchTool
import art
import weave

@weave.op
async def rollout(model: art.Model, scenario: ResearchScenario) -> art.Trajectory:
    chat_model = init_chat_model(model.name, temperature=1.0)
    
    # Define available tools
    tools = [WebSearchTool()]
    
    # Create the Smolagents ReAct agent
    agent = CodeAgent(tools=tools, model=chat_model, stream_outputs=True)
    
    # Execute workflow (need to verify async support in smolagents)
    return await agent.run(scenario.messages)
    
from art.smolagents import wrap_rollout

...
for batch in training_iterator:
    groups = []
    for scenario in batch.items:
        groups.append(
            art.TrajectoryGroup([
                wrap_rollout(rollout)(model, scenario)
                for _ in range(training_config["rollouts_per_group"])
            ])
        )
...

Roadmap

  • Add art.smolagents integration module with wrapper functions
  • Add documentation and examples.

I'd be happy to work on implementing this feature if the team is interested.
Would love to hear your thoughts and any ideas! Thanks ๐Ÿ˜Š

Hi, @FacerAin!
Yes, weโ€™d be interested in adding an integration with smolagents!
Would you like to contribute?
I can help get it added to our docs.

Thank you for your response!
I'll keep you updated on progress through the working PR.
I hope this contribution will be helpful for ART projects. Thanks!