Hello Fastly Community!
We’re thrilled to announce the Beta release of the Python SDK for Fastly Compute!
Why Python at the Edge?
Our SDK gives your growing body of Python code every possible advantage with industry-leading speed and security:
-
Microsecond Startups: We eliminate CPython’s notorious cold-start delays by executing module top-levels at build time and creating a pre-initialized memory snapshot. In production, your instances start up in microseconds.
-
Bulletproof Isolation: Every single request execution is completely isolated within its own ephemeral WebAssembly sandbox. If your code does something unintended, the blast radius is instantly contained right at the edge.
-
Localized Data Loops: By keeping data-orchestration loops near the user, you can prevent the performance-killing network round trips to a centralized cloud server that typically slow down real-time apps and AI agents.
Cool Use Cases
Here are some ideas for how you can deploy Python logic to the edge:
-
AI & Agentic Workflows: Safely vibe-code your first AI project, execute LLM tool calls, or deploy complex multi-agent architectures.
-
Access Control: Quickly validate access control tokens directly at the edge, close to your users.
What Does the SDK Offer?
This SDK is designed to be fully idiomatic without requiring you to write clunky cross-language wrapper code.
-
It cross-compiles standard CPython and provides a WSGI adapter, allowing you to run apps using popular frameworks like Flask nearly unmodified.
-
We’ve included a compatible implementation of the de-facto-standard requests library that delegates to our optimized network stack (from fastly_compute import requests).
-
It leverages WebAssembly Components to provide type-safe APIs that look and act like pure, modern Python.
Beta Caveats to Keep in Mind
Because this is a beta release focused on speed and security, please note a few current limitations:
-
Native ML computation frameworks aren’t here yet: NumPy, SciPy, and Pandas need a bit more work, but pure Python logic and WASI-supported native extensions are fair game today.
-
Top-level imports are needed: To ensure our memory-snapshotting build process works, packages must be imported at the top level.
-
No filesystem or threads: There isn’t a virtual filesystem or multi-threading support within our sandboxes just yet.
How to Get Started
Visit our GitHub repository for the SDK and quick-start instructions: GitHub - fastly/compute-sdk-python: Python SDK for Fastly Compute · GitHub
We want to hear your unfiltered feedback and help you succeed. Open Source is critical to the work we do at Fastly, and this SDK is an open collaboration for folks using Python. We encourage submitting pull requests or open issues on the GitHub repo. Let us know what you are building, share any Python packages that are giving you trouble, or start a conversation below.
Cheers,
The Fastly Team