Vibeleaderboard
← All Intel
Intel / article

Cloudflare Python Workers Reach GA With Native Bindings and Framework Support

Source
blog.cloudflare.com
Author
Cloudflare
Date

Context

Cloudflare has made Python Workers generally available, two years after introducing them. Workers is Cloudflare's platform for running code on its global network without managing servers, and Python runs there through Pyodide, a version of the Python interpreter compiled to WebAssembly, the portable code format the Workers runtime already executes. General availability means Cloudflare now treats Python as a fully supported language alongside TypeScript. The practical change in this release is that much ordinary Python code no longer has to account for the it runs in.

Cloudflare's announcement describes four of those fixes. Calls to Cloudflare services such as queues and storage previously required converting Python objects into JavaScript objects by hand, which Cloudflare says was a common source of errors for both people and AI agents; the runtime now does the conversion. Frameworks such as FastAPI, Django and Flask run through small connectors, with the Workers platform itself playing the role a server like Uvicorn plays elsewhere. Database drivers such as asyncpg failed because network socket calls inside a WebAssembly sandbox always fail, so Cloudflare implemented those calls on top of the Workers networking interface, which lets standard PostgreSQL and MySQL drivers connect through its Hyperdrive service. Finally, Cloudflare contributed changes upstream so HTTP clients like requests and httpx route through the JavaScript fetch interface, which is what lets libraries such as openai, langchain and work.

What still limits Python Workers is any package with native C, C++ or Rust code, which has to be compiled to WebAssembly before it can run. Until now Cloudflare compiled and hosted such packages by hand, which kept the usable set small. Cloudflare proposed PEP 783, a Python standard for a WebAssembly platform called PyEmscripten, and it was accepted after more than a year of discussion, so package maintainers can now publish builds that work in any environment implementing it. Cloudflare says the ecosystem is still adopting the standard, so whether a given package with native code runs depends on its maintainer shipping such a build, or on Cloudflare building it on request.

Terms in this piece · Glossary
  • sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
  • MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
Read the source blog.cloudflare.com
More from Cloudflare
Recommended reads
Comments

Checking sign-in…

Loading comments…