Skip to content

[python] Support python functions >250mb in size#14976

Merged
gscho merged 41 commits intomainfrom
gscho/PY-58-support-large-python-lambdas
Feb 13, 2026
Merged

[python] Support python functions >250mb in size#14976
gscho merged 41 commits intomainfrom
gscho/PY-58-support-large-python-lambdas

Conversation

@gscho
Copy link
Copy Markdown
Contributor

@gscho gscho commented Feb 10, 2026

Summary

When a Python function is over the 250mb limit for lambda, we package the uv binary into the lambda and install the dependencies at runtime.

If a package is determined to be "private" it will always be packaged into the lambda zip because we can't install it at runtime.

Enabling the feature

To enable this feature the user must set VERCEL_EXPERIMENTAL_PYTHON_UV_INSTALL_ON_STARTUP=1 in their vercel environment. ALSO in order to increase the ephemeral storage to 10GB you need to set MAXIMISE_TMP_STORAGE=1. This functionality already existed but maybe we can make the builder set that for us somehow.

Blast Radius

The blast radius of this PR is small because customer's need to opt-in via environment variable.

Note

Low Risk Change

This PR adds new build-time logic for Python Lambda packaging with runtime dependency installation, gated behind an explicit opt-in environment variable (VERCEL_EXPERIMENTAL_PYTHON_UV_INSTALL_ON_STARTUP), limiting blast radius to users who enable the feature.

  • New feature: runtime dependency installation for oversized Python Lambdas (>249MB)
  • Feature gated behind explicit env var opt-in (VERCEL_EXPERIMENTAL_PYTHON_UV_INSTALL_ON_STARTUP)
  • Adds uv.lock parsing, package classification (public vs private), and bundle size calculation

Risk assessment for commit a3ffb56.

Signed-off-by: gscho <greg.c.schofield@gmail.com>
…e dep install.

Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: a3ffb56

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/python Minor
vercel Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 10, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-8cknxqbt6.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-8cknxqbt6.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 10, 2026

🧪 Unit Test Strategy

Comparing: 93697eaa3ffb56 (view diff)

Strategy: Code changed outside of a package - running all unit tests

⚠️ All unit tests will run because global code changes could impact all packages.

Affected packages - 40 (100%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples
  40. vercel

Results

  • Unit tests: All affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: All affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
gscho and others added 2 commits February 12, 2026 19:45
Co-authored-by: Elvis Pranskevichus <elvis@vercel.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
Signed-off-by: gscho <greg.c.schofield@gmail.com>
@gscho gscho enabled auto-merge (squash) February 13, 2026 18:04
@gscho gscho enabled auto-merge (squash) February 13, 2026 19:07
@gscho gscho merged commit 6e58410 into main Feb 13, 2026
202 checks passed
@gscho gscho deleted the gscho/PY-58-support-large-python-lambdas branch February 13, 2026 19:16
mehulkar pushed a commit that referenced this pull request Feb 16, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## vercel@50.18.0

### Minor Changes

- Support easier auth from cursor / claude
([#15050](#15050))

### Patch Changes

- non-interactive mode for link
([#14884](#14884))

- Add experimental manual deployment support
([#14857](#14857))

- Fix `integration remove`, `integration balance`, and `integration
open` commands failing to find integrations by explicitly passing
`teamId` to the configurations API
([#15054](#15054))

- Require slash syntax for multi-product integrations in non-TTY mode,
keep interactive product selector for TTY
([#15047](#15047))

- Move builders back into bundle
([#15059](#15059))

- Updated dependencies
\[[`463395162462988e7d3276781d2fdff0685e225b`](4633951),
[`6e58410ff849c281735c6acae59b3b0e86136f15`](6e58410)]:
    -   @vercel/go@3.4.1
    -   @vercel/ruby@2.3.1
    -   @vercel/python@6.13.0
    -   @vercel/static-build@2.8.37

## @vercel/python@6.13.0

### Minor Changes

- Add runtime dependency install to support larger Python functions
([#14976](#14976))

This adds logic to calculate the total size of a lambda at build time
and offload dependencies
to a \_runtime_requirements.txt file so they can be installed at runtime
by uv. This allows us to
    deploy functions up to the total size of the /tmp folder.

## @vercel/client@17.2.42

### Patch Changes

- Add experimental manual deployment support
([#14857](#14857))

## @vercel/fs-detectors@5.8.7

### Patch Changes

- [services] infer workspace from manifest: when workspace is not
explicitly configured, infer from nearest manifest to entrypoint
([#14986](#14986))

## @vercel/go@3.4.1

### Patch Changes

- Forward Go and Ruby dev server output through `startDevServer`
stdout/stderr callbacks so service logs are correctly prefixed in
multi-service `vercel dev`.
([#14989](#14989))

## @vercel/ruby@2.3.1

### Patch Changes

- Forward Go and Ruby dev server output through `startDevServer`
stdout/stderr callbacks so service logs are correctly prefixed in
multi-service `vercel dev`.
([#14989](#14989))

## @vercel/python-runtime@0.4.1

### Patch Changes

- fix PyPI publication integration in release flow
([#15033](#15033))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants