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.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: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
| Framework | Avg Latency (ms) | Median Latency (ms) | Requests/sec | P95 Latency (ms) | P99 Latency (ms) |
|---|---|---|---|---|---|
| FastrAPI | 0.59 | 0.00 | 31,360 | 2.39 | 11.12 |
| FastAPI + Gunicorn (1 worker) | 21.08 | 19.67 | 937 | 38.47 | 93.42 |
| FastAPI + Gunicorn (16 workers) | 4.84 | 4.17 | 3,882 | 10.22 | 81.20 |
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