
Vercel Python Services
Stand up a Python FastAPI (or similar) service on Vercel alongside an optional JS frontend using experimentalServices.
Overview
vercel-python-services is an agent skill for the Build phase that guides solo builders through Vercel experimentalServices with a Python backend and optional JavaScript frontend.
Install
npx skills add https://github.com/vercel-labs/py-ai --skill vercel-python-servicesWhat is this skill?
- Root `vercel.json` only; each service owns its own dependencies independently
- Backend routes defined without `/api` prefix; Vercel strips prefix before forwarding
- `vercel dev -L` runs all services on port 3000 with unified routing—no localhost proxy hacks
- Services must include `entrypoint` and `routePrefix`; unknown fields crash preview
- Optional CORS-ready FastAPI pattern for frontend calling `/api/...` paths
- Local unified dev server on port 3000 via `vercel dev -L`
Adoption & trust: 28 installs on skills.sh; 70 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want Python APIs on Vercel next to a web UI but multi-service config, route prefixes, and dev routing are easy to misconfigure.
Who is it for?
Full-stack solo projects choosing Vercel hosting with FastAPI or similar Python services plus a separate frontend service.
Skip if: Single-server Python apps on raw VPS, or teams not using Vercel’s experimentalServices model.
When should I use this skill?
Creating Python backends or multi-service projects with a Python backend and JavaScript frontend on Vercel.
What do I get? / Deliverables
A validated multi-service `vercel.json`, working local `vercel dev -L` setup, and frontend calls to `/api` routes that reach the Python service correctly.
- Validated vercel.json services configuration
- Runnable Python API routes
- Working local multi-service dev setup
Recommended Skills
Journey fit
Multi-service Vercel backends are core product construction, canonical shelf Build → backend. experimentalServices, route prefixes, and `/api` stripping are server and routing concerns, not launch SEO or grow analytics.
How it compares
Vercel multi-service layout skill, not a generic FastAPI tutorial or Docker-only backend guide.
Common Questions / FAQ
Who is vercel-python-services for?
Solo and indie builders shipping on Vercel who need a Python backend service coexisting with a JS frontend in one monorepo-style project.
When should I use vercel-python-services?
During Build backend work when creating experimentalServices entries, fixing preview crashes from bad vercel.json, or wiring `/api` routes from the frontend.
Is vercel-python-services safe to install?
It describes deployment patterns; review the Security Audits panel on this page and lock down CORS and secrets before production.
SKILL.md
READMESKILL.md - Vercel Python Services
# Python Services with Vercel Build multi-service projects using Vercel's `experimentalServices` API with a Python backend and (optional) JavaScript frontend. ## Setup 1. Create the project files (see references for the minimal working example). Choose frameworks for each service according to user's requests. 2. Define backend routes without the `/api` prefix (e.g. `@app.get("/health")`). Vercel strips the prefix before forwarding to the backend. 3. Validate services in `vercel.json` have `entrypoint` and `routePrefix`, but no extra unknown fields, otherwise that will cause preview to crash Only `vercel.json` lives at the root. Each service manages its own dependencies independently. ## Usage - Use `vercel dev -L` from the project root to run all services as one application. The CLI will handle each individual service's routing and dev server and put the application on port 3000. - Frontend calls `/api/...` — Vercel routes these to the backend, which sees only the path after the prefix. No localhost URLs, no proxy needed. 3.12 import fastapi import fastapi.middleware.cors app = fastapi.FastAPI() app.add_middleware( fastapi.middleware.cors.CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get("/health") async def health() -> dict[str, str]: return {"status": "ok"} [project] name = "backend" version = "0.1.0" description = "FastAPI backend service" requires-python = ">=3.12" dependencies = [ "fastapi[standard]>=0.128.1", ] { "name": "frontend", "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build" }, "dependencies": { "react": "^19.2.0", "react-dom": "^19.2.0" }, "devDependencies": { "@vitejs/plugin-react": "^5.1.1", "typescript": "~5.9.3", "vite": "^7.2.4" } } import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], }) { "experimentalServices": { "frontend": { "entrypoint": "frontend", "routePrefix": "/" }, "backend": { "entrypoint": "backend/main.py", "routePrefix": "/api" } } }