Skip to main content

What is FastrAPI?

FastrAPI is a high-performance web framework that supercharges your Python APIs with the power of Rust. Built on Axum and PyO3, it delivers unmatched speed, type safety, and developer-friendly Python syntax. Create robust, async-ready APIs with minimal overhead and maximum throughput. FastrAPI is your drop-in replacement for FastAPI, offering familiar syntax with up to 33x faster performance.

Why use FastrAPI?

Lightning speed

Powered by Rust and Axum, FastrAPI delivers up to 33x faster performance than FastAPI, making your APIs scream.

Python-first

Write clean, familiar Python code, no Rust knowledge needed. FastrAPI handles the heavy lifting behind the scenes.

Ironclad type safety

Inherits Rust’s robust type system for rock-solid reliability, catching errors before they hit production.

Async native

Built on Tokio’s async runtime, FastrAPI maximizes concurrency for handling thousands of requests with ease.

Key features

Pydantic powered

Seamless integration with Pydantic for effortless request and response validation, keeping your data in check.
from pydantic import BaseModel
from fastrapi import FastrAPI

api = FastrAPI()

class User(BaseModel):
    name: str
    age: int

@api.post("/create_user")
def create_user(data: User):
    return {"msg": f"Hello {data.name}, age {data.age}"}

Ultra lightweight

Minimal runtime overhead with maximum throughput. FastrAPI handles thousands of requests per second with ultra-low latency.

Drop-in replacement

Drop-in compatibility with FastAPI’s beloved decorator syntax, so you can switch without rewriting your codebase:
- from fastapi import FastAPI
+ from fastrapi import FastrAPI

Performance benchmarks

Benchmarks using k6 show FastrAPI outperforms FastAPI + Gunicorn across multiple worker configurations.
Test environment:
  • Kernel: 6.16.8-arch3-1
  • CPU: AMD Ryzen 7 7735HS (16 cores, 4.83 GHz)
  • Memory: 15 GB
  • Load test: 20 Virtual Users (VUs), 30s
FrameworkAvg Latency (ms)Median Latency (ms)Requests/secP95 Latency (ms)P99 Latency (ms)
FastrAPI0.590.0031,3602.3911.12
FastAPI + Gunicorn (1 worker)21.0819.6793738.4793.42
FastAPI + Gunicorn (16 workers)4.844.173,88210.2281.20
FastrAPI handles thousands of requests per second with ultra-low latency, making it ~33× faster than FastAPI + Gunicorn with 1 worker.

Do I need to know Rust?

Nope. FastrAPI lets you write 100% Python code while leveraging Rust’s performance under the hood.

Can it handle complex APIs?

Absolutely. With full Pydantic integration and async support, FastrAPI scales effortlessly for small projects and enterprise-grade APIs alike.

Will it keep up with FastAPI updates?

Yes. FastrAPI mirrors FastAPI’s decorator-based syntax, ensuring compatibility and instant access to familiar workflows.

Next steps

Installation

Install FastrAPI and get started in minutes

Quickstart

Build your first FastrAPI application

Migration guide

Migrate from FastAPI to FastrAPI

GitHub

View the source code and contribute

Build docs developers (and LLMs) love