[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size

310 views · 0 likes · 3 posts


Vdatttiwari Compliancean (@vdatttiwari-complian) · 2024-09-16

I am trying to deploy my python project with fastapi using vercel, but keep on facing this error: Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size.
this is my vercel.json:
{
    "builds": [
      {
        "src": "/api/main.py",
        "use": "@vercel/python",
        "config": {
            "excludeFiles": "/{.next,*.cache,node_modules,public,app}/**"
            }
      }
    ],
    "routes": [
      {
        "src": "/(.*)",
        "dest": "api/main.py"
      }
    ]
   
}

this is my build system report. 
▲ Build system report

14:18:20.586• No memory or disk space problems detected

14:18:20.586• Folder sizes on disk:

14:18:20.586 ‣ Input source code: 234 MB

14:18:20.586 ‣ Build cache: <1 MB

14:18:20.586 ‣ Output files: 3 MB

14:18:20.586 ‣ Node modules: 157 MB

14:18:20.586• No files larger than 100 MB detected on disk

How can deploy my application without this error


Pauline P. Narvas (@pawlean) · 2024-09-16

Hi, @vdatttiwari-complian! Welcome to the Vercel Community :smile: 

It looks like you exceeded the maximum size of 250 MB on your project. 

From the documentation:

> For Serverless Functions, the maximum uncompressed size is 250 MB including layers which are automatically used depending on [runtimes](https://vercel.com/docs/functions/runtimes#runtime). These limits are [enforced by AWS](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html).
> 
> You can use [`includeFiles` and `excludeFiles`](https://vercel.com/docs/projects/project-configuration#functions) to specify items which may affect the function size, however the limits cannot be configured. These configurations are not supported in Next.js, instead use [`outputFileTracingIncludes`](https://nextjs.org/docs/app/api-reference/next-config-js/output).


Pauline P. Narvas (@pawlean) · 2026-02-25

Just wanted to flag that Vercel has doubled the Python Functions bundle size limit — it's now **500MB unzipped** (previously 250MB).

If your FastAPI project was close to or just over the old 250MB cap, you should be able to redeploy as-is without needing to trim dependencies. Hope this helps!

Reference: https://vercel.com/changelog/python-vercel-functions-bundle-size-limit-increased-to-500mb