Skip to content

Add ai.remote and RemoteAgent, for running an agent in a worker - #350

Open
msullivan wants to merge 3 commits into
mainfrom
remote-agent
Open

msullivan wants to merge 3 commits into
mainfrom
remote-agent

Conversation

@msullivan

@msullivan msullivan commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

We add a generic protocol (ai.remote.Runner) for doing async
execution of functions in a remote runner.

ai.remote.RemoteAgent will offload the entire loop to a remote
runner when one is configured.

The main ai.Agent can offload tool calls to a remote runner also,
with different values to the execution_strategy to ai.tool:

  • local: always run locally
  • remote-enabled: use remote if a runner is configured
  • remote: always remote, fail otherwise

A remote runner is configured with ai.remote.use_runner.

@msullivan msullivan added the feature New functionality label Nov 13, 2026
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ai-python Ready Ready Preview, v0 Nov 17, 2026 1:16am UTC

@anbuzin

anbuzin commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Instead of having two ways to specify remoteness, (remote_tools and worker mode) we could make it so RemoteAgent always runs the loop remote, and normal ai.Agent always runs loop locally; and for the normal agent you can specify at tool definition time, whether you want that tool to run remote or locally.

Module-wise, I think we can make both of these top-level modules, even though they technically aren't AI-only; we have prior art in the form of ai.telemetry.

@anbuzin

anbuzin commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

We can prefix all of them as ai.experimental though.

@vercel-internal-security-reviewer

Copy link
Copy Markdown

Security review details

We add a generic protocol (`ai.remote.Runner`) for doing async
execution of functions in a remote runner.

`ai.remote.RemoteAgent` will offload the entire loop to a remote
runner when one is configured.

The main `ai.Agent` can offload tool calls to a remote runner also,
with different values to the `execution_strategy` to `ai.tool`:
 * local: always run locally
 * remote-enabled: use remote if a runner is configured
 * remote: always remote, fail otherwise

A remote runner is configured with `ai.remote.use_runner`.
Comment thread src/ai/remote/__init__.py Resolved
Comment thread src/ai/remote/__init__.py Resolved
Comment thread src/ai/remote/__init__.py Resolved

This branch was successfully deployed

1 active deployment
Preview — 89d9f0a0 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants