vlambda
An ASGI-like server for Python lambdas, written in V. Uses vcraft for the V↔Python bridge.
Live at: https://vlambda.ricardorobles.es
What is vlambda?
vlambda lets you write Python functions ("lambdas") and serve them as HTTP endpoints. It's like AWS Lambda, but self-hosted, with no cold starts, and ~0.3ms per invocation.
def handler(request):
return {"msg": "hello", "path": request.path}
POST that code to /vlambda and it becomes GET /f/<slug> instantly.
Features
- No cold starts in persistent mode — Docker uses a fresh Landlock process per invocation, which adds a small startup cost
- Fast — ~3,000 req/s (concurrent, free-threaded Python), ~0.3ms/req
- Auth — JWT-based authentication with per-user ownership
- Web UI — Dashboard for managing lambdas, code editor, metrics
- Async invocation — Fire-and-forget with task tracking
- Sandbox — Landlock + seccomp in Docker, plus restricted Python builtins and blocked modules
- Metrics — Prometheus-compatible + Chart.js dashboard
- Per-lambda method — GET, POST, PUT, PATCH, DELETE
- Naming — Human-readable names for lambdas
- Multi-file projects — ZIP uploads, file editor,
requirements.txt/pyproject.toml - Versions and aliases — rollback and
prod/stagingaliases - PyPI packages — install per lambda/project from the UI
- Persistent metrics and logs — survive restarts, queryable by slug/name
- CORS — applied to every
/f/response, withOPTIONSpreflight - Static files — projects serve
index.html, CSS, JS and assets at/f/<slug>/<path> - API tokens — long-lived tokens with scopes and revocation
- Export / import / duplicate — move lambdas and projects as JSON
- POC templates — HTML +
fetch, webhook, JSON API, static site - Free-threaded builds —
cp314t/cp315twheels
Installation
uv pip install vlambda
Or with pip:
pip install vlambda
Usage
python -m vlambda --port 8080 --sqlite_path ./vlambda.db --num_coroutines 10
Or with environment variables:
VLAMBDA_PORT=8080 VLAMBDA_DB=./vlambda.db VLAMBDA_COROUTINES=10 python -m vlambda
Then open http://localhost:8080/ in your browser.
Build a POC in five minutes
- Open the UI and log in.
- Pick a template in New lambda (
JSON API + CORS,Webhook receiver,Form receiver,HTML page…) and create it. - Open the invoke URL
https://your-host/f/<slug>. - Need files? Upload a ZIP in Upload project; anything in the project is
served at
/f/<slug>/<path>and any unknown path runshandler(request).
More complete examples live in examples/: a static site, an
HTML + fetch POC, a webhook receiver and a JSON API.
API tokens
Create a token in System → API tokens, or with the API:
curl -X POST "$VLAMBDA_URL/tokens" \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"name":"ci","scopes":["read","write"]}'
The response contains the token (vl_…) once. Use it as
Authorization: Bearer vl_…. Scopes are read, write and admin; revoke a
token with DELETE /tokens/<id>. Tokens do not expire.
Docker + Dokploy
The repository includes a production image (Dockerfile, installs from PyPI) and
a development image (Dockerfile.dev, builds the local wheel). Both use a
free-threaded Python 3.14 venv, run each invocation in a Landlock + seccomp
sandbox and expose plain HTTP on port 8080; Dokploy (or another proxy) handles
TLS and the public domain.
The sandbox needs no extra Docker flags, capabilities or host sysctl changes. It requires a Linux kernel with Landlock (5.13+; Ubuntu 22.04+, Debian 12+).
export VLAMBDA_SECRET="$(openssl rand -hex 32)"
export VLAMBDA_ADMIN_TOKEN="$(openssl rand -hex 32)"
docker compose -f docker/compose.yml up -d --build
With Dokploy, create an application from the image, map the domain to container
port 8080, and set VLAMBDA_SECRET and VLAMBDA_ADMIN_TOKEN. Dokploy terminates
TLS, so the container does not manage certificates.
See docker/README.md for details, limits and the reset command.
CLI Options
| Flag | Env Var | Default | Description |
|---|---|---|---|
--port |
VLAMBDA_PORT |
8080 | Listen port |
--sqlite_path |
VLAMBDA_DB |
./vlambda.db | SQLite database path |
--num_coroutines |
VLAMBDA_COROUTINES |
10 | Worker pool size |
--max_body_size |
VLAMBDA_MAX_BODY |
1048576 | Max request body (bytes) |
--rate_limit |
VLAMBDA_RATE_LIMIT |
100 | Requests/sec per IP |
--invoke_timeout |
VLAMBDA_TIMEOUT |
30 | Lambda invocation timeout (s) |
--max_memory_mb |
VLAMBDA_MAX_MEMORY_MB |
0 | RAM limit (0=unlimited) |
--cors_origin |
VLAMBDA_CORS |
* | CORS allowed origin |
--cert |
VLAMBDA_CERT |
TLS certificate path | |
--key |
VLAMBDA_KEY |
TLS key path | |
VLAMBDA_REGISTRATION |
1 | Allow public registration (0 disables it) |
API
Authentication
GET /config— Public runtime flags (whether registration is open)POST /register— Register user (body:username:password); returns403when registration is disabledPOST /login— Login (body:username:password) → JWT tokenPOST /admin/users— Create a user withX-Admin-Tokenand bodyusername:password(for closed registration)
Lambdas (requires auth)
POST /vlambda?method=GET&name=my-lambda— Create lambda (body: Python code)GET /vlambda— List lambdas (pipe-delimited)GET /vlambda?format=json— List lambdas as JSONGET /vlambda/<slug>— Get lambda codePUT /vlambda/<slug>?method=POST&name=new-name— Update lambdaDELETE /vlambda/<slug>— Delete lambda
API tokens (requires auth)
POST /tokens— Create a token:{"name":"ci","scopes":["read","write"]}GET /tokens— List tokens (never returns the secret)DELETE /tokens/<id>— Revoke a token
Tokens are accepted anywhere a JWT is accepted. read allows listing and
reading, write allows mutating lambdas/projects, admin allows token
management and admin routes.
Export / import
GET /vlambda/<slug>/export— Export code or project files as JSONPOST /vlambda/import— Create from an exported JSON bodyPOST /vlambda/<slug>/duplicate— Copy a lambda or project
Project exports include text files. Binary files are listed in
skipped_files and are not copied.
Invocation
GET/POST/PUT/PATCH/DELETE /f/<slug>— Invoke lambda (method must match)OPTIONS /f/<slug>— CORS preflight (returns204)GET /f/<slug>/<path>— Serve a project file, or invoke the handler if the file does not existPOST /async/<slug>— Async invoke (returns task_id)GET /task/<id>— Get async task result
Projects
POST /vlambda?project=1&entry=main.py— Upload a ZIP project (base64 body)GET /project/<slug>— Read project filesPUT /project/<slug>— Save project filesGET /f/<slug>/— Serveindex.htmlGET /f/<slug>/<path>— Serve a static file (vendor/,.git/and..blocked)
Versions and aliases
GET /vlambda/<slug>/versions— List versionsGET /vlambda/<slug>/version/<n>— Read a versionPOST /vlambda/<slug>/rollback?version=<n>— Roll backGET /vlambda/<slug>/aliases— List aliasesPOST /vlambda/<slug>/alias?name=prod&version=<n>— Create aliasGET /f/<slug>?alias=prod— Invoke an alias
Packages
GET /vlambda/<slug>/packages— List requirementsPOST /vlambda/<slug>/packages— Install PyPI packages into the vendor dir
Monitoring (requires auth)
GET /health— Health checkGET /ready— ReadinessGET /metrics— Prometheus metricsGET /metrics/json— Live JSON metricsGET /metrics/history?days=N&slug=— Raw persisted metricsGET /metrics/stats?days=N&slug=— p50/p95/p99GET /metrics/aggregate?days=N&slug=— Per-lambda aggregatesGET /metrics/summary?days=N&slug=— Daily rollupsGET /metrics/export?days=N&slug=— CSV exportDELETE /metrics/history?days=N&slug=— Delete metrics older than N days (days=0deletes all)GET /logs/history?days=N&slug=— Persisted lambda logsDELETE /logs/history?days=N&slug=— Delete logs older than N days (days=0deletes all)GET /pool/stats,GET /dlqPOST /shutdown— Graceful shutdown
Logging
Lambdas can persist structured logs with request.log():
def handler(request):
request.log("processing " + request.path)
request.log("debug details", "debug")
return {"ok": True}
Logs are stored in the metrics database and can be queried with
GET /logs/history?days=1&slug=<slug>. The UI Logs view shows them alongside
invocations. The "Save logs" template in the editor is a ready-to-run example.
Metrics and logs are pruned after VLAMBDA_METRICS_RETENTION days (default 7).
From the UI you can also prune data older than the selected period, or delete
all matching rows, with the current lambda filter applied.
Lambda Format
Every lambda must define a handler function:
def handler(request):
return {"msg": "hello", "path": request.path}
The request object has: method, path, query_string, headers, body.
Safe builtins: abs, all, any, bool, dict, enumerate, filter, float, int, len, list, map, max, min, range, reversed, round, set, sorted, str, sum, tuple, zip, print, etc.
Blocked modules: os, posix, subprocess, sys, importlib, ctypes, socket, _socket, urllib, http, shutil, pathlib, io, pickle, marshal, resource, fcntl, mmap, sqlite3, etc.
Safe modules: json, math, re, datetime, collections, itertools, functools, hashlib, base64, string, random, statistics, etc.
Security
User code runs in a fresh runner process confined with Landlock and seccomp.
Landlock limits the filesystem to /opt, /usr, /lib, /etc, the current
project/vendor and a private temporary directory; /data, /proc, /sys and
the rest of the server cannot be read or listed. seccomp blocks network, cross-process
signals, ptrace, mount, namespace changes and similar syscalls. Resource
limits are applied too, and each invocation gets a fresh process.
The Docker image keeps public registration open by default for toy deployments.
Set VLAMBDA_REGISTRATION=0 to close it and create users with
POST /admin/users instead. A daily data reset removes state, but it does not
undo a kernel-level escape. Keep this deployment disposable and do not store
valuable secrets in it; for stronger isolation use gVisor, Firecracker or one
container per tenant.
Web UI
Open http://localhost:8080/ in your browser for the dashboard:
- Login/Register
- Lambda dashboard with search, filter and pagination
- CodeMirror editor with Python highlighting
- Multi-file project editor and ZIP upload
- Versions, rollback and aliases
- PyPI package installation
- API playground
- Persistent metrics with charts and filters
- Logs viewer with
request.log() - System status and frontend log drawer
Reset
The demo can be wiped with:
python -m vlambda reset --yes --url http://127.0.0.1:8080 --token "$VLAMBDA_ADMIN_TOKEN"
For a disposable demo, run it from cron every day:
0 3 * * * docker exec -e VLAMBDA_ADMIN_TOKEN="..." <container> /opt/venv/bin/python -m vlambda reset --yes --url http://127.0.0.1:8080
Performance
| Metric | Value |
|---|---|
| Cold start | 0ms in persistent mode; fresh sandbox process in Docker |
| Warm invocation | ~0.3ms |
| Throughput (concurrent, free-threaded) | ~3,000 req/s |
| Throughput (response cache hits) | ~100x faster |
Architecture
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Browser │────▶│ V HTTP │────▶│ Python │
│ (UI) │◀────│ Server │◀────│ Pool │
└─────────────┘ │ (net.http) │ │ (workers) │
│ │ └─────────────┘
│ ┌────────┐ │ │
│ │ SQLite │ │ │
│ │ (WAL) │ │ ┌─────────────┐
│ └────────┘ │ │ Sandbox │
└──────────────┘ │ (restricted│
│ builtins) │
└─────────────┘
License
MIT License - see LICENSE for details.
Author
Ricardo Robles Fernández - https://github.com/rroblf01/vlambda
Metadata
Release files for vlambda 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vlambda-0.2.2.tar.gz | 380.4 kB | With provenance | Details for vlambda-0.2.2.tar.gz |
Built distributions (wheels)
Total release size: 15.4 MB
Release files / vlambda-0.2.2.tar.gz
| Download URL | vlambda-0.2.2.tar.gz |
|---|---|
| Size | 380.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e99587b208c8adde7fb97f243355a89a96edc249aafbc6f0379e3f168ea9734
|
|
BLAKE2b-256 checksum How to use checksums |
519d8a9c58977b23343a6510394c8c5c72a2eb647bcbdf2aa97b382abb0b93ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp315-cp315t-manylinux_2_28_x86_64.whl
| Download URL | vlambda-0.2.2-cp315-cp315t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5c105c073a501bbae79e894710fc8b49e7ab502148450a6158ddd1e2232dfd5d
|
|
BLAKE2b-256 checksum How to use checksums |
2d99ef8427a24344444b221d5868e87b7018af66ab9d79e7fb63d8949aeba039
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp315-cp315t-manylinux_2_28_aarch64.whl
| Download URL | vlambda-0.2.2-cp315-cp315t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
b10347e9491ba3030f209da8498ad5fe5f35ee7513de523b4287f30f3c7bf7e0
|
|
BLAKE2b-256 checksum How to use checksums |
8d3f363b2f0901ac6b1c057d98898528f28ef1a6fb3cbd81ff75ecfdd2667e77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp315-cp315-manylinux_2_28_x86_64.whl
| Download URL | vlambda-0.2.2-cp315-cp315-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a0892e8a30fadea388d82241ef7aed0f5a7be3fe0a3aefb2b1770fd005cace05
|
|
BLAKE2b-256 checksum How to use checksums |
4526d2ae9749ac412c99a0df685a0909a9af58aa239f4da3a5b25f73676e4dcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp315-cp315-manylinux_2_28_aarch64.whl
| Download URL | vlambda-0.2.2-cp315-cp315-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
f7ccb7025b56bab07f8986ab8867802d3d81e7c5ebd6d4e0c8697c660b74e174
|
|
BLAKE2b-256 checksum How to use checksums |
06d9c2f3571a07b40b55290980c6b83ae63c3b35f0fc618dfeb09c4480d10ce6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | vlambda-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
86b95178915c041de3dcae0fa0e2ba802e6467a94419815f4ce32dfeb1ff6637
|
|
BLAKE2b-256 checksum How to use checksums |
2bfe2e5dad1ca2707fbb7dc5c49f549ab62cfc58a49b8522e4ca30fe628dcf86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | vlambda-0.2.2-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
becd3a4fea235167e0994f3e2665236ce28424541b2772ebb571d5a887923ffd
|
|
BLAKE2b-256 checksum How to use checksums |
0c3a9d28171c48267a915e87b249c606c2ae8fca0b0c987cc2038c9da3d9fc95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | vlambda-0.2.2-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9ea981398da29f18ce6f244fc2d9cabbb03a7a0eb7744b96a38b4d22f2733e59
|
|
BLAKE2b-256 checksum How to use checksums |
d63fb1751ecc8daa4d7ea9964f3c6886b542de68cf4bd7ffc76c700b7ef1cdfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / vlambda-0.2.2-cp314-cp314-manylinux_2_28_aarch64.whl
| Download URL | vlambda-0.2.2-cp314-cp314-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
2a084b7742be3054361e6d8729d5b2d62d7fa49f2dbcf6508940b6c9bf475880
|
|
BLAKE2b-256 checksum How to use checksums |
4c375646574ba01462f4bd06c08630d4fb1e30fb9db63c13c63e541a777cef64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for vlambda 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for vlambda-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.