tachyonapi

The ridiculously fast backend framework.

Build high-performance APIs with a developer experience you'll love. Optimized from I/O to your business logic, with Cython compilation coming soon.

from tachyonapi import Tachyon
from tachyon.models import Struct

app = Tachyon()

# Use msgspec Structs for ultra-fast validation
class User(Struct):
    id: int
    name: str

@app.get("/users/{}id}")
async def get_user(id: int) -> User:
    # Type validation is automatic and extremely fast.
    return User(id=id, name="Ada Lovelace")

A high-performance ecosystem.

Modern tools and patterns for maximum productivity.

Extreme Performance

Optimized with `msgspec` and `orjson`. Cython compilation for near-native performance coming soon.

Implicit Injection

The DI container resolves and provides dependencies automatically, keeping your code clean and readable.

Code Quality

Developed with TDD for maximum reliability and formatted with Ruff, the fastest linter from Rust.

Scalable Architecture

Promotes the Service-Repository pattern for clear and maintainable separation of concerns.

Flexible Documentation

Automatically generates documentation with Scalar, Swagger and ReDoc. You choose which one to use.

Happy Development

An intuitive API and descriptive errors so you spend less time debugging and more time creating.

Less code. More clarity.

TachyonAPI reduces boilerplate compared to traditional frameworks like FastAPI, especially in dependency injection.

TachyonAPI

from tachyonapi import Tachyon
from tachyon.di import injectable

@injectable
class MyService:
    def get_data(self) -> str:
        return "Data from service"

app = Tachyon()

@app.get("/")
# Clean and direct injection
def endpoint(service: MyService):
    return service.get_data()

FastAPI

from fastapi import FastAPI, Depends

class MyService:
    def get_data(self) -> str:
        return "Data from service"

app = FastAPI()

@app.get("/")
# Boilerplate with Depends
def endpoint(
    service: MyService = Depends(MyService)
):
    return service.get_data()
Feature TachyonAPI FastAPI
Requests/sec (Hello World) ~120k ~90k
JSON Serialization msgspec + orjson pydantic
Dependency Injection Implicit Explicit (Depends)
C Compilation (Cython) Coming Soon
API Docs Scalar / Swagger / ReDoc Swagger / ReDoc

*Benchmarks are representative and may vary.

Advanced architecture, simplified.

Implement robust patterns like Service-Repository. For complex logic, compile your services with Cython for near-native performance (coming soon).

repository.py
# Data access layer
class UserRepository:
    def get_by_id(self, id: int):
        # DB logic...
        return {"id": id, "name": "..."}
service.py
# Business logic (compilable with Cython)
from .repository import UserRepository
from tachyon.inject import injectable

@injectable
class UserService:
    def __init__(self, repo: UserRepository):
        self.repo = repo

    def process_user(self, id: int):
        user = self.repo.get_by_id(id)
        user['processed'] = True
        return user
controller.py
# API layer / Endpoints
from .service import UserService
from .models import User

@app.get("/users/{}id}", response_model=User)
def get_user(
    id: int,
    service: UserService
):
    # 'service' is injected
    return service.process_user(id)

Start building in seconds

Stable release on PyPI
$ pip install tachyon-api