Skip to content
from agentcore_rl_toolkit import AgentCoreRLApp
from strands import Agent
from strands.models.openai import OpenAIModel

app = AgentCoreRLApp()

@app.rollout_entrypoint
def invoke_agent(payload: dict):
    cfg = payload["_rollout"]
    model = OpenAIModel(
        base_url=cfg["base_url"],
        model_id=cfg["model_id"],
    )
    agent = Agent(model=model, tools=[...])
    response = agent(payload["prompt"])
    return {"rewards": reward_fn(response)}
# Install the AgentCore CLI
pip install bedrock-agentcore-starter-toolkit

# Configure and deploy
agentcore configure \
    --entrypoint rl_app.py \
    --name my_rl_agent \
    --deployment-type container \
    --non-interactive

agentcore deploy --agent my_rl_agent

# → arn:aws:bedrock-agentcore:us-west-2:...
from agentcore_rl_toolkit.backends.slime import SlimeRunner

SlimeRunner(
    exp_id="gsm8k-3b",
    agent_runtime_arn="arn:aws:bedrock-agentcore:...",
    s3_bucket="my-bucket",
    model_dir="/path/to/Qwen2.5-3B-Instruct",
    data_path="/path/to/gsm8k.jsonl",
    model_type="qwen2.5-3B",
).train()

AgentCore RL Toolkit - ART

Seamlessly enable RL training on any agent with Bedrock AgentCore Runtime.

Reuse production codeone decorator & model endpoint swap; no custom Agent code just for RL.

Isolated, auto-scaling rollouts — every rollout runs in its own AgentCore Runtime microVM with its own dependencies; thousands in parallel without contending for your machine.

Framework-agnostic training — works with verl, rllm, or slime; model-gateway captures token IDs, logprobs, and expert masks transparently while the agent keeps its original chat interface.

Any agent frameworkStrands, LangGraph, or custom. The agent’s runtime is independent of the training library.

New here? Start with the math agent example or read the overview. Already have an agent? Jump straight to prepare agent for RL and Kick off RL with any training backend: slime · rllm · verl.