The Python API framework
built for speed.
FastAPI-compatible syntax. msgspec + orjson stack. Endpoint pre-compilation at startup. 5.53x faster throughput with a fraction of the boilerplate.
from tachyon_api import Tachyon, Struct, Body, Query
from tachyon_api.di import injectable, Depends
app = Tachyon()
# msgspec Struct — ultra-fast validation in C
class User(Struct):
name: str
email: str
# @injectable — zero-boilerplate DI
@injectable
class UserService:
def create(self, user: User) -> dict:
return {"id": 1, "name": user.name}
@app.post("/users", response_model=User)
def create_user(user: User = Body(), svc: UserService = Depends()):
return svc.create(user) Performance
5.53x faster
than FastAPI.
Benchmarked against FastAPI 0.136.1 (Pydantic v2) with uvloop + httptools. 1 worker, 100 concurrent connections, 10 seconds per scenario.
Live race simulation
Real benchmark data · 100 concurrent connections
Select a scenario and press Run race to start the simulation
| Scenario | Tachyon | FastAPI | |
|---|---|---|---|
| Hello World | 49,755 | 10,314 | |
| Path + query params | 37,598 | 7,166 | |
| Body validation | 40,916 | 8,371 | |
| Nested body | 39,994 | 8,027 | |
| Response model | 47,561 | 6,343 | |
| Header + auth | 45,415 | 8,701 | |
| Dependency injection | 45,610 | 6,449 | |
| Multiple query params | 34,111 | 6,264 | |
| Total throughput | 340,960 | 61,635 |
Hardware: Apple Silicon · Python 3.10 · uvicorn + uvloop + httptools · single worker
Code comparison
Same idea.
Less noise.
Tachyon uses the FastAPI mental model you already know — but removes the boilerplate, especially in dependency injection and validation.
from tachyon_api import Tachyon, Query
app = Tachyon()
@app.get("/hello")
def hello(name: str = Query("World")):
return {"msg": f"Hello, {name}"}
from fastapi import FastAPI
from typing import Optional
app = FastAPI()
@app.get("/hello")
def hello(name: Optional[str] = "World"):
return {"msg": f"Hello, {name}"}
No `@lru_cache` boilerplate
DI singletons with just `@injectable` — no factory function needed
Struct vs BaseModel
msgspec.Struct validates in C — 5–10× faster than Pydantic
msgspec direct encode
Struct responses use `msgspec.json.encode()` — no intermediate Python dict
Features
Everything you need.
Nothing you don't.
Endpoint pre-compilation
Signature inspection, type resolution, and decoder creation happen once at startup — not on every request.
msgspec + orjson stack
Validation in C via msgspec.Struct. JSON encoding via orjson. No Pydantic, no stdlib json.
Zero-boilerplate DI
@injectable marks a class as a singleton. Tachyon resolves the full dependency graph automatically.
Type-safe params
Path, Query, Body, Header, Cookie, Form, File — all with alias support, defaults, and 422 errors.
Multi-UI docs
OpenAPI 3.0 auto-generated. Serve Scalar, Swagger UI, or ReDoc — pick your preference.
Security built-in
HTTPBearer, HTTPBasic, OAuth2PasswordBearer, APIKey — just Depends() and done.
CLI scaffolding
tachyon new my-api generates a production-ready project. tachyon generate service users --crud adds a full module.
TDD from day one
TachyonTestClient + dependency_overrides make unit and integration tests clean and deterministic.
4 core dependencies
starlette, msgspec, orjson, uvicorn. That's it. No hidden transitive bloat.
27 precompiled extensions
pip install tachyon-api ships prebuilt Cython wheels for Linux, macOS (arm64), and Windows — no compiler needed. Pure Python fallback is automatic on unsupported platforms.
Start in 30 seconds.
Install from PyPI and run your first endpoint.
$ pip install tachyon-api
from tachyon_api import Tachyon
app = Tachyon()
@app.get("/")
def root():
return {"message": "Running at lightspeed"}
27 Cython extensions ship precompiled — no compiler required: