tachyon-api
v1.1.0 on PyPI

The Python API framework
built for speed.

FastAPI-compatible syntax. msgspec + orjson stack. Endpoint pre-compilation at startup. 5.61x faster throughput with a fraction of the boilerplate.

5.61x
faster than FastAPI
~2.1ms
avg latency
4
core dependencies
app.py
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.61x 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

Tachyon API
req/s
F
FastAPI
req/s

Select a scenario and press Run race to start the simulation

All scenarios — req/s (higher is better) 100 connections · 1 worker · uvloop
Scenario Tachyon FastAPI
Hello World 52,321 10,159
Path + query params 37,384 6,930
Body validation 36,593 8,189
Nested body 38,522 7,888
Response model 44,557 6,370
Header + auth 45,727 7,894
Dependency injection 46,592 6,284
Multiple query params 33,930 6,161
Total throughput 335,626 59,875

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.

Tachyon API
from tachyon_api import Tachyon, Query

app = Tachyon()

@app.get("/hello")
def hello(name: str = Query("World")):
    return {"msg": f"Hello, {name}"}
F
FastAPI
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.

Core

Endpoint pre-compilation

Signature inspection, type resolution, and decoder creation happen once at startup — not on every request.

Performance

msgspec + orjson stack

Validation in C via msgspec.Struct. JSON encoding via orjson. No Pydantic, no stdlib json.

DX

Zero-boilerplate DI

@injectable marks a class as a singleton. Tachyon resolves the full dependency graph automatically.

DX

Type-safe params

Path, Query, Body, Header, Cookie, Form, File — all with alias support, defaults, and 422 errors.

Docs

Multi-UI docs

OpenAPI 3.0 auto-generated. Serve Scalar, Swagger UI, or ReDoc — pick your preference.

Security

Security built-in

HTTPBearer, HTTPBasic, OAuth2PasswordBearer, APIKey — just Depends() and done.

CLI

CLI scaffolding

tachyon new my-api generates a production-ready project. tachyon generate service users --crud adds a full module.

Testing

TDD from day one

TachyonTestClient + dependency_overrides make unit and integration tests clean and deterministic.

Lightweight

4 core dependencies

starlette, msgspec, orjson, uvicorn. That's it. No hidden transitive bloat.

Performance

Cython hot path [fast]

pip install tachyon-api[fast] compiles the request pipeline to C extensions — radix trie, parameter processor, response processor. Falls back to pure Python automatically.

Start in 30 seconds.

Install from PyPI and run your first endpoint.

$ pip install tachyon-api
app.py
from tachyon_api import Tachyon

app = Tachyon()

@app.get("/")
def root():
    return {"message": "Running at lightspeed"}
uvicorn app:app --reload --loop uvloop

Optional — enable Cython C extensions for ~11% faster hot path:

$ pip install tachyon-api[fast] $ python setup.py build_ext --inplace

Compiles the radix trie, parameter processor, and response processor to C. Pure Python fallback is automatic — no code changes needed.