Loading…
Loading…
Features · Scale · Autopilot
Autopilot turns an Agent or GoalAgent into a long-running autonomous runner: goal-driven, budget-gated, checkpointed every iteration, and streaming as it goes. It runs until every criterion is met or a budget trips.
from shipit_agent import Goalfrom shipit_agent.autopilot import Autopilot, BudgetPolicyfrom shipit_agent.llms import build_llm_from_envautopilot = Autopilot( llm=build_llm_from_env(), goal=Goal(
Goal
and success criteria
Iterate
checkpoint every step
Budget
time, calls, tokens, dollars
Result
completed, partial or halted
The code is a checked example from the docs; the output is an example of what it prints.
from shipit_agent import Goal
from shipit_agent.autopilot import Autopilot, BudgetPolicy
from shipit_agent.llms import build_llm_from_env
autopilot = Autopilot(
llm=build_llm_from_env(),
goal=Goal(
objective="Summarize three Python dict gotchas with runnable snippets.",
success_criteria=["3 gotchas explained", "each has a snippet", "each has a tip"],
),
budget=BudgetPolicy(max_seconds=600, max_tool_calls=20, max_dollars=2.0),
)
result = autopilot.run(run_id="py-dict-gotchas")
print(result.status, result.iterations)4 more ways to use it
Each example is from the docs and checked against the library.
from shipit_agent import Goal
from shipit_agent.autopilot import Autopilot, BudgetPolicy
from shipit_agent.llms import build_llm_from_env
llm = build_llm_from_env("bedrock") # defaults to Llama 4 Scout
autopilot = Autopilot(
llm=llm,
goal=Goal(
objective="Summarize three Python dict gotchas with runnable snippets.",
success_criteria=[
"At least 3 gotchas explained in prose",
"Each gotcha has a Python snippet that reproduces it",
"A one-line avoidance tip is shown for each",
],
),
budget=BudgetPolicy(
max_seconds=600, # 10 min cap
max_tool_calls=20,
max_iterations=8,
max_tokens=300_000,
max_dollars=2.0,
),
)
result = autopilot.run(run_id="py-dict-gotchas")
print(result.status) # "completed" | "partial" | "halted" | "failed"
print(result.iterations)
print(result.output[:500])Budget policy
Caps on time, tool calls, iterations, tokens and dollars.
Crash-safe
An atomic checkpoint every iteration; resume after a crash.
Critic
An optional critic reviews each iteration.
Scheduler
Run autopilots on a schedule with the daemon.