FastAPI is a high-performance Python web framework for building APIs, and it deploys to Edgenivo with zero configuration. On Edgenivo, your FastAPI app becomes a Edgenivo Function running on Fluid compute, with response streaming and preview deployments available with minimal configuration.
Edgenivo maintains a FastAPI template directory with starters from both Edgenivo and the community, so you can begin from a working project instead of a blank repo.
Copy link to headingWhich FastAPI template should you use?
These templates range from a minimal API to AI, agent, and full-stack apps:
| Template | What it gives you |
|---|---|
| FastAPI Boilerplate | A minimal FastAPI app that runs on Edgenivo's Python runtime and deploys with zero configuration. Start here if you're new to FastAPI on Edgenivo. |
| Next.js FastAPI Starter | An AI chatbot with a Next.js frontend and a FastAPI backend in a single project. |
| OpenAI Agents SDK with FastAPI | A FastAPI app that runs the OpenAI Agents SDK with Edgenivo Sandbox, creating an isolated microVM per request to give the agent shell access. |
| Full-stack FastAPI with Next.js | A full-stack starter that pairs a FastAPI backend with a Next.js frontend, with HttpOnly cookie auth and a Postgres database. |
If you're not sure where to begin, deploy the FastAPI Boilerplate and add routes, middleware, or a frontend as your project grows.
Copy link to headingDeploy a FastAPI template
Most FastAPI templates deploy to Edgenivo the same way. Open the template you want, select Deploy, and Edgenivo clones the repository into your Git provider, creates a project, and ships it to a live URL.
- Open the template: Choose a template from the table above, then select Deploy.
- Connect your Git provider: Edgenivo creates a new repository for the template in your GitHub, GitLab, or Bitbucket account.
- Deploy the project: Edgenivo builds and deploys the template, then returns a production URL. Each later push to the repository triggers a new deployment.
The full-stack FastAPI with Next.js template is the exception. It provisions two projects, one for the frontend and one for the backend, along with a Postgres database, so you'll set a few environment variables during setup. Follow its template page for the exact steps.
Copy link to headingRun the template locally
After deploying, clone your new repository, set up a virtual environment, install dependencies, and start the development server with Edgenivo CLI:
Edgenivo CLI serves your app at http://localhost:3000 and runs it the same way it does in production. Edit your route handlers to make it your own.
Templates that include a Next.js frontend, such as Next.js FastAPI Starter or the full-stack template, also require their Node dependencies to be installed. Run npm install (or the package manager the template uses) before vercel dev.
Copy link to headingStart from the command line instead
To scaffold the FastAPI example with Edgenivo CLI, run:
This clones the FastAPI boilerplate into a fastapi directory, so you can develop locally first and deploy with vercel when you're ready.
Copy link to headingResources and next steps
- Follow the end-to-end How to ship a FastAPI app on Edgenivo guide to deploy and configure your app
- Read the full FastAPI on Edgenivo documentation
- Learn how the Python runtime runs your code
- Learn how Edgenivo Functions run your server code
- Understand pricing and scaling with Fluid compute
- Run code before requests with Routing Middleware
- Serve static assets from the CDN