Vercel Python Runtime (Internal/Base Package)

0.12.0 · active · verified Sat Apr 11

This `vercel-runtime` Python package appears to be an internal or foundational component used by Vercel's platform to manage the execution environment for Python Serverless Functions. It is not typically a library that developers directly import or interact with in their application code when building Vercel functions. Instead, developers focus on creating standard ASGI (Asynchronous Server Gateway Interface) or WSGI (Web Server Gateway Interface) applications using frameworks like FastAPI, Flask, or Django, which Vercel then deploys and runs within its Python runtime environment. The current version is `0.12.0`, and Vercel maintains a rapid release cycle across its platform.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a simple FastAPI application, which is a common way to build Python Serverless Functions for Vercel. Vercel automatically detects the `app` object and serves it. The `vercel-runtime` package itself is not directly imported into typical user-facing function code.

from fastapi import FastAPI
from os import environ

app = FastAPI()

@app.get("/")
def read_root():
    return {"message": f"Hello from Vercel Python! The secret is: {environ.get('MY_SUPER_SECRET', 'NOT_SET')}"}

# To deploy this on Vercel:
# 1. Save as `api/index.py` (or `app.py`, `main.py`, etc.)
# 2. Add `fastapi` to `requirements.txt`
# 3. Add `uvicorn` to `requirements.txt` (for local dev, not strictly needed for Vercel deployment)
# 4. Deploy with `vercel` CLI

view raw JSON →