r/Backend • u/Commercial_You- • 3d ago
FASTAPI
hi i wanna learn fastapi for ml projects, dont know anything about backend so what all do i need to know like what topics, any playlist you can recommend with backend basics to a point where i can finally start to learn fastapi?
19
Upvotes
2
u/PhilosopherOther1360 2d ago
The fastapi documentation is actually pretty good
1
u/Discordbothost 2d ago
Try a POST /predict route that returns a fixed label first. In /docs, send one valid request and one with a required field missing. Once both behave as expected, swap the fixed label for your model.
1
u/nn_gyunx 2d ago
Skip the playlists and work through the FastAPI tutorial in order, but the parts that actually bite you later are the boring fundamentals: what each status code promises the client, how request and response bodies map to pydantic models, and where you catch exceptions so bad input comes back as a 422 instead of a 500. Learn one real database with migrations next to it and keep config in env vars from day one, or you'll be rewriting half the app the first time you deploy it. For ML serving specifically, load the model once at startup instead of per request, keep inference off the event loop, and put a timeout on predictions so one slow model call doesn't take your health check down with it.
1
u/Adorable_Expert_7350 1d ago
You don't need to learn the entire backend ecosystem before starting FastAPI. Focus on HTTP, REST APIs, JSON, request/response handling, status codes, and basic SQL first. Then jump into FastAPI and build a simple ML prediction API; learn the advanced backend concepts as your projects demand them.
1
u/Electronic-Run5947 3d ago
Use any playlist, like freecodecamp.org, any YT channel with most views, and ur understanding. Learn fundamentals and basic, and then merge urself into ML.