The Python API framework
built for speed.
FastAPI-compatible syntax. msgspec + orjson stack. Endpoint pre-compilation at startup. 4.25x 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
4.25x 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 | 40,545 | 10,283 | |
| Path + query params | 30,637 | 7,133 | |
| Body validation | 31,808 | 8,336 | |
| Nested body | 30,807 | 8,006 | |
| Response model | 34,991 | 6,673 | |
| Header + auth | 34,126 | 8,662 | |
| Dependency injection | 32,941 | 6,225 | |
| Multiple query params | 25,915 | 6,242 | |
| Total throughput | 261,770 | 61,560 |
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.
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"}