4 min Devops

Cloudflare builds AI-driven alternative to Next.js

Cloudflare builds AI-driven alternative to Next.js

Cloudflare has quickly developed an experimental alternative to Next.js, largely powered by generative AI. The project, called vinext, was built in a week by a single engineer in collaboration with an AI model. It implements approximately 94 percent of the Next.js API. Development costs were estimated at $1,100 in AI tokens.

The experiment was not intended to demonstrate AI capabilities, but to address a structural problem in Next.js deployments. The popular React framework is highly optimized for use on Vercel. Anyone who wants to run Next.js with full functionality on other serverless platforms, such as Cloudflare Workers, Netlify, or AWS Lambda, must modify the build output with additional tooling. According to Cloudflare, this leads to additional complexity and vulnerability, especially with new Next.js versions.

The Next.js creators are working on official deployment adapters, but that approach is still in development and relies on Turbopack, Vercel’s bundler. In addition, the Next.js development environment runs exclusively on Node.js, making it difficult to test platform-specific APIs from Cloudflare during development.

Previous attempts to overcome this problem, such as the OpenNext project, have shown how difficult it is to build on Next.js output without control over the underlying toolchain. According to Cloudflare, unpredictable changes between versions make such solutions fragile and maintenance-intensive.

Architectural change instead of adaptation

With vinext, Cloudflare therefore opted for a different approach. Instead of adapting Next.js, the API has been largely reimplemented on top of Vite, a widely used build tool. Vinext acts as a drop-in replacement for Next.js. Existing applications can often continue to work without modifications to project structure or configuration, while the build and runtime are no longer dependent on Turbopack.

Virtually all code was generated by AI, with the engineer serving as architect and director. The process began with the development of a global architecture, after which the AI implemented parts of the Next.js API in stages. Existing tests in the Next.js codebase were extensively used to verify compatibility. Human intervention remained necessary to correct incorrect assumptions.

Initial benchmarks show clear build advantages

Although the project is explicitly presented as experimental and has not yet been manually reviewed, the initial results are striking. Internal benchmarks show build times up to 4x lower than with Next.js 16 and Turbopack, while client bundles are significantly smaller. The figures are based on a single test application and are primarily indicative.

For the time being, vinext is primarily focused on Cloudflare Workers as a deployment target. With a single command, an application is built and rolled out, including support for server-side rendering, React Server Components, and client-side navigation. Caching and Incremental Static Regeneration are available as standard via Cloudflare KV. Cloudflare is also experimenting with traffic-aware pre-rendering, whereby only pages with demonstrable traffic are generated in advance to avoid long build times.

Despite its experimental status, several production applications are now running on vinext, including a government website. This distinguishes this project from an earlier AI experiment by Cloudflare involving a Matrix server, which critics said was presented as too ambitious. The Register writes that vinext appears to be a more realistic project, partly due to extensive testing and a clear definition of what is and is not supported.

In addition to the technical implications, Cloudflare also sees the experiment as a signal to the broader software sector. Reimplementing a complex framework in such a short time would have been unthinkable without AI. At the same time, it raises questions about the role of existing abstractions. Many of these are designed to compensate for human limitations, while AI can oversee larger systems in context. This opens the door to simpler stacks, but also to codebases that are more difficult for humans to understand.