cloudflare / cloudflare/workers-sdk

Cloudflare Vite plugin: dev startup latency spikes with remote AI binding (12s remote vs 0.5s local)

Open
#13,033 5 comments 0 reactions 2 assignees Claimed by @korinne View on GitHub
api package:remote-bindings package:vite-plugin
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
187

Description

### What versions & operating system are you using?

macOS
Node 20
npm 10
Vite 8.0.2
@cloudflare/vite-plugin 1.30.0
Wrangler 4.76.0

### Please provide a link to a minimal reproduction

https://github.com/jimmycallin/cloudflare-vite-startup-latency-mre

### Describe the Bug

I'm seeing a large dev startup regression when running with remote bindings enabled, specifically with an AI binding configured as remote. In the same minimal repository and on the same machine, local bindings mode starts quickly, while remote mode is much slower.

**Reproduction steps**:

Clone the repro repository.

Run remote mode:
```
npm run dev:once:remote
```
Run local mode:
```
npm run dev:once:local
```

Observed behavior:
With AI remote binding configured in wrangler.jsonc:
```
Remote mode:
http:listening around +12498.7ms
Vite ready in around 12832ms
```
Local mode:
```
http:listening around +255.7ms
Vite ready in around 577ms
```
Expected behavior:

Remote mode startup should be closer to local mode startup and not exhibit an approximately order-of-magnitude increase in this minimal setup.

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.