Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Intro to FastAPI: Tips and Tricks for ML
Search
Sebastián Ramírez
April 13, 2023
Technology
420
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to FastAPI: Tips and Tricks for ML
Sebastián Ramírez
April 13, 2023
More Decks by Sebastián Ramírez
See All by Sebastián Ramírez
FastAPI and All the Things
tiangolo
0
18
FastAPI and Friends: Big Plans
tiangolo
0
11
What's new in FastAPI for AI
tiangolo
0
780
2025-10 PyCon Brasil keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
37
PyCon Taiwan Keynote - Behind the scenes of FastAPI and friends for developers and builders
tiangolo
0
290
Modern Python through FastAPI and friends - PyCon Sweden
tiangolo
0
97
Await for it: mixing async and blocking code - PyCon MEA - Dubai
tiangolo
0
88
Modern Python through FastAPI and friends - PyCon MEA - Dubai
tiangolo
0
920
CLI apps with Typer - Python type annotations and shell completion
tiangolo
0
470
Other Decks in Technology
See All in Technology
Flutter Widget Previewerで始めるUIプレビューとVRTの自動化
sakusaku3939
0
210
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
6
3.6k
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
150
AIで選択肢が広がった組織設計の理想と現実
konifar
16
7.7k
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
130
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
180
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
2
170
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
130
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
630
IoTとは〜? 数字で見るSORACOM UG【SORACOM UG Explorer 2026】
soracom
PRO
0
180
Sizing, Benchmarking and Performance Tuning Apache Flink Clusters
rmetzger
0
110
公共システムAdventCalendar2026
toru_kubota
0
200
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
2k
Balancing Empowerment & Direction
lara
6
1.4k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
How to Ace a Technical Interview
jacobian
280
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
570
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
290
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Transcript
Intro to High performance, easy to learn, fast to code,
ready for production Tips and Tricks for ML
Who am I? Sebastián Ramírez github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo tiangolo.com Berlin,
Germany I created:
• Python Web API framework • 50K+ GitHub stars (about
1K+ per month) • Used by Microsoft, Uber, Netflix, etc. • Performance in the top rank for Python • 3rd most used (Python Developers Survey) • Fastest growth (Python Developers Survey) • 3rd most loved (StackOverflow Developer Survey) @tiangolo
• OpenAPI • JSON Schema • OAuth2 🔄 Automatic data
conversion ✨ ✅ Automatic data validation ✨ FastAPI is based on standards 📝 Automatic API docs ✨ • Standard type annotations @tiangolo
Based on standards - for free @tiangolo
Based on Python type hints • Autocompletion everywhere • Type
checks and type errors @tiangolo
Types provide autocompletion @tiangolo
Easy and short @tiangolo
Less API code @tiangolo
Basic FastAPI app @tiangolo https://somedomain.com/items/5?q=some+query
Basic FastAPI app - docs @tiangolo https://somedomain.com/docs
Automatic docs @tiangolo
Basic FastAPI app with body @tiangolo
Basic FastAPI app with body - docs @tiangolo
Basic FastAPI app with body - docs @tiangolo
Basic FastAPI app with body @tiangolo
Basic FastAPI app with body and query @tiangolo
Basic FastAPI app with body and query - docs @tiangolo
https://somedomain.com/food/?delivery=true
Basic FastAPI app with body and query @tiangolo
JSON array of objects in body @tiangolo
JSON array of objects in body - docs @tiangolo
JSON array of objects in body @tiangolo
JSON array of objects in body - invalid data @tiangolo
JSON array of objects in body - validation @tiangolo
Data validation @tiangolo
FastAPI auto-completion @tiangolo
Type checks @tiangolo
All based on standard Python types @tiangolo
FastAPI - Performance @tiangolo
FastAPI - Performance @tiangolo
FastAPI - Other features @tiangolo • Dependency Injection • Security
- OAuth2 • WebSockets • Files • Background Tasks • Easy GraphQL integration • Templates • More...
Simple ML model and usage 🤖 @tiangolo
Load ML models - slow disk reads 🤖 @tiangolo ✨
Read from disk as few times as possible ✨
Load ML models - slow disk reads 🤖 @tiangolo
Simple ML model - only load 🤖 @tiangolo
ML model in FastAPI - simple - good ✅ @tiangolo
ML model in FastAPI - bad 🚨 @tiangolo
ML model in FastAPI - very bad 🚨 @tiangolo
ML model in FastAPI - very bad 🚨 @tiangolo
Load model and cache 😎 @tiangolo
FastAPI with cached model ⚡ @tiangolo
FastAPI with cached model ⚡ @tiangolo
FastAPI - preload cached model in healthcheck ⚡ @tiangolo
FastAPI - preload ⚡ @tiangolo
FastAPI - async and models - bad 🚨 @tiangolo
FastAPI - async and models - bad 🚨 @tiangolo
Blocking code in async blocks the event loop 😱 @tiangolo
✨ Don’t put blocking code directly in async functions ✨
FastAPI - non async and models - simple - good
✅ @tiangolo
FastAPI - non async and models - simple - good
✅ @tiangolo
FastAPI - async and models - good ✅ @tiangolo
FastAPI - async and models - good ✅ @tiangolo
FastAPI - model in dependency ✨ @tiangolo
FastAPI - model in dependency - testing ✅ @tiangolo
FastAPI - model in dependency - testing ✅ @tiangolo
FastAPI - squeeze performance 🚤 @tiangolo
FastAPI - squeeze performance 🚤 @tiangolo
None
Thank you! Sebastián Ramírez tiangolo.com fastapi.tiangolo.com github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo