GitHubGet started

Give a model a job
runs the rest

    $ pip install ailoy-py

    Everything around the model, handled by the SDK

    agent.py
    from ailoy import AgentBuilder
    
    agent = await AgentBuilder("anthropic/claude-haiku-5-5").build()
    
    async for output in agent.run("Plan my week"):
        print(output["message"])
    1. Backendcli
    2. Runs onClaude Code (claude), logged in
    3. NeedsNo API key
    agent.py
    agent = await (
        AgentBuilder("anthropic/claude-haiku-5-5")
        .system_tools().console(console)
        .build()
    )
    1. RunsIn the agent's VM
    2. Callshell("python3 render.py")
    3. Resultexit 0
    agent.py
    agent = await (
        AgentBuilder("anthropic/claude-haiku-5-5")
        .mount_readonly("./skills/laya", "/skills/laya")
        .skill("/skills/laya")
        .build()
    )
    
    agent.run("Route this ticket to a department")
    1. Pickslaya, its description fits the task
    2. Reads/skills/laya/SKILL.md
    3. Runspython3 run_laya.py
    4. AnswersFrom the result
    agent = await (
        AgentBuilder("anthropic/claude-haiku-5-5")
        .tool(desc)
        .build()
    )
    
    async for output in agent.run("When does order A-1001 arrive?"):
        print(output["message"])
    1. YouWhen does order A-1001 arrive?
    2. Modelorder_status("A1001")
    3. Toolerror: no order A1001
    4. Modelorder_status("A-1001")
    5. Tool{"status": "shipped", "eta": "2026-10-24"}
    6. ModelIt has shipped and arrives on 24 October 2026
    1. 01

      Any model, same code

      Claude, GPT and Gemini run through the CLI you are logged into. Open models run on their own API, OpenRouter or your vLLM server.

      Backends
      cli, api, bedrock, openrouter, vllm
      Models
      Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen
      Model providers →
    2. 02

      Tools built in, yours in a line

      A shell, files, web search and a browser are built in. An MCP server or a function of your own is one line more.

      In its VM
      A shell and file tools, matched to the model
      From your app
      Web search, web fetch, 19 browser tools
      Tools →
    3. 03

      Teach it a skill for the job

      A skill is a folder of instructions for one kind of task. The agent opens it only when a task calls for it.

      A skill holds
      SKILL.md, plus its scripts and data
      Read up front
      Only its name and description
      Skills →
    4. 04

      The agent loop, handled

      Ailoy runs the back and forth between the model and its tools. A failed call goes back to the model to fix.

      agent.run
      One complete message per step
      run_stream
      Tokens as the model writes them
      Message format →

    Every model gets the tools it was trained on

    system_tools() hands GPT the Codex tools and Claude the Claude Code tools, all running in the agent's VM.

    ModelRun commandsRead filesEdit filesSee images
    GPTshellshellapply_patchimgread
    Claudeshellreadwriteeditimgread
    Geminishellread_filewriteeditimgread
    Open modelsshellreadwriteeditNone

    Long runs stay inside the model's window

    Long jobs keep going instead of failing at the model's limit, and each call sends fewer tokens. .context_manager() trims old tool results and keeps your last 3 turns whole.

    Without .context_manager()With itOld results cut
    010k20k30k40k50kmax_input_tokens 30,000Turn 1Turn 2Turn 3Turn 4Turn 5Turn 6010k20k30k40k50kmax_input_tokens 30,000Turn 1Turn 3Turn 5
    49,900 28,360tokens on the last call
    12 of 24tool results cut
    0messages dropped

    Keep reading

    FAQs

    Can I use a model on my own server?

    Yes. Run DeepSeek, Kimi, GLM or Qwen on a vLLM server and point Ailoy at it with VLLM_BASE_URL. Your agent code stays the same.

    How much of a tool result does the model see?

    Up to 30,000 characters of each part. A longer one keeps its first and last 15,000 characters around a note of how many were cut.

    Does the agent use my own browser?

    Yes, by default it drives your Chrome over CDP, with remote debugging on. With isolated=True it gets a browser of its own on a fresh profile.

    Can I pick up a conversation later?

    Yes. Save agent.history and pass it to .history() on the builder, and the next run continues where the last one left off.

    Can I stream the answer word by word?

    Yes. agent.run gives you a complete message for each step, and agent.run_stream gives you tokens as the model writes them.

    Run your first agent
    in a few lines of code

    Install the package, name a model and run it