Ultra-fast async Python web framework — ASGI-native, batteries included
Project description
Veloce
Fast, ergonomic async Python web framework — ASGI-native, batteries included.
Documentation: veloceframework.com
Source code: https://github.com/Lokesh-Tallapaneni/veloce
Veloce is a from-scratch async Python web framework. The router, request/response pipeline, dependency injection system, OpenAPI generator, WebSocket layer, and test client are all in-tree — not wrappers around an existing stack.
Position
Veloce is a from-scratch async Python web framework — not a wrapper around Starlette, FastAPI, or Flask. It provides FastAPI-style typed dependency injection, Pydantic v2 request/response validation, OpenAPI 3.1 schema generation, WebSocket support, and Flask-compatible helpers (g, flash, blueprints, session) in a single tree. Production-ready with a radix-tree router, an in-memory test client, and built-in CORS/CSRF/session/rate-limit/security-headers middleware.
Key design points
- Async-only handlers. No sync fallback; every request runs on the event loop.
- Precompiled dispatch. Handler signatures are inspected once at
registration into a
HandlerPlan; the per-request hot path performs no reflection. - Radix-tree routing with typed path converters (
int,float,uuid,path, plus custom). - Typed dependency injection via
Depends,Security,SecurityScopes, includingyield-style dependencies with teardown. - OpenAPI 3.1 generated from Pydantic models, served through Swagger UI and ReDoc out of the box.
- In-memory test client drives the real ASGI surface — no sockets, no separate server process.
Requirements
Python 3.10+.
Veloce depends on a small native-extension stack: orjson,
httptools, pydantic v2, python-multipart, multidict, and
uvloop on non-Windows platforms.
Installation
pip install veloceframework
The installed package exposes the veloce import:
from veloce import Veloce
Example
Create main.py:
from veloce import Veloce
app = Veloce()
@app.get("/")
async def index() -> dict[str, str]:
return {"hello": "world"}
@app.get("/items/{item_id:int}")
async def read_item(item_id: int) -> dict[str, int]:
return {"item_id": item_id}
Run it with any ASGI server:
uvicorn main:app
Open http://127.0.0.1:8000/items/42 to see {"item_id": 42}, or
http://127.0.0.1:8000/docs for the interactive OpenAPI UI.
Feature surface
| Area | Highlights |
|---|---|
| Routing | radix tree, path converters, blueprints with nesting, subdomain routing, host constraints |
| Requests | streaming bodies, multipart, JSON, MultiDict query/headers/cookies, rich URL/header accessors |
| Responses | JSONResponse, HTMLResponse, StreamingResponse, FileResponse, ETag/Last-Modified |
| Dependency inj. | Depends, Security, SecurityScopes, Annotated[T, Depends()], yield + teardown |
| Validation | Pydantic v2 query / path / header / cookie / body, structured 422 errors |
| OpenAPI | OpenAPI 3.1, Swagger UI, ReDoc, security schemes, webhooks, callbacks, operation_id |
| WebSockets | full ASGI surface, dependency injection, subprotocol negotiation, typed iter helpers |
| Middleware | CORS, GZip, TrustedHost, HTTPSRedirect, ProxyFix, Session, CSRF, BaseHTTPMiddleware |
| Templating | Jinja2 with url_for / g / current_app globals, async render, context processors |
| Sessions | signed cookies, server-side backend, permanent_lifetime, secret rotation |
| Testing | in-memory TestClient, multipart, cookies, follow-redirects, session_transaction |
| Tooling | veloce run, veloce routes, veloce shell (Click-backed CLI) |
The full Tier 0/1/2 feature matrix and per-feature design notes live in
docs/.
Benchmarks
Comparative benches against equivalent third-party async and sync
frameworks live in benchmark.py. On the JSON-hello and path-param
hot paths Veloce sustains a 3-7x throughput multiplier on Python 3.12
under the configurations measured. Numbers are workload-specific and
reproducible; run the suite locally before quoting them.
Project status
0.1.0 is the first public release. The public API surface — the
names exported from veloce/__init__.py — is what this version commits
to; further 0.1.x releases follow semantic
versioning and will not break it.
License
MIT. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veloceframework-0.3.0.tar.gz.
File metadata
- Download URL: veloceframework-0.3.0.tar.gz
- Upload date:
- Size: 589.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0993ce8757dc710fc85e6a9ad2439b74019da26f187d0f72f3629bc1199c692
|
|
| MD5 |
cca0d7a2933c0908d899c1083f904ad4
|
|
| BLAKE2b-256 |
1b662d2c189f276ff35f0998cc49895ec0a7a2e53182d95bffccd14c5cbaad30
|
Provenance
The following attestation bundles were made for veloceframework-0.3.0.tar.gz:
Publisher:
release.yml on Lokesh-Tallapaneni/veloce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veloceframework-0.3.0.tar.gz -
Subject digest:
a0993ce8757dc710fc85e6a9ad2439b74019da26f187d0f72f3629bc1199c692 - Sigstore transparency entry: 1684709454
- Sigstore integration time:
-
Permalink:
Lokesh-Tallapaneni/veloce@26c800ca43bb5fa6ca99b7803c075f5d0be7385c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Lokesh-Tallapaneni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@26c800ca43bb5fa6ca99b7803c075f5d0be7385c -
Trigger Event:
push
-
Statement type:
File details
Details for the file veloceframework-0.3.0-py3-none-any.whl.
File metadata
- Download URL: veloceframework-0.3.0-py3-none-any.whl
- Upload date:
- Size: 316.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6abae604be8f3661b8a8633dc6bb4816559b4a08b700491f81a88f6a1fd1ece
|
|
| MD5 |
31324ba908e30d8ebffcb651bcce1bf2
|
|
| BLAKE2b-256 |
10f5671f0ad8667662c2d1bf1c032164dae59c0e1a7848506b96f3cfa49018ad
|
Provenance
The following attestation bundles were made for veloceframework-0.3.0-py3-none-any.whl:
Publisher:
release.yml on Lokesh-Tallapaneni/veloce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veloceframework-0.3.0-py3-none-any.whl -
Subject digest:
e6abae604be8f3661b8a8633dc6bb4816559b4a08b700491f81a88f6a1fd1ece - Sigstore transparency entry: 1684710648
- Sigstore integration time:
-
Permalink:
Lokesh-Tallapaneni/veloce@26c800ca43bb5fa6ca99b7803c075f5d0be7385c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Lokesh-Tallapaneni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@26c800ca43bb5fa6ca99b7803c075f5d0be7385c -
Trigger Event:
push
-
Statement type: