7,318 questions
Score of 0
0 answers
107 views
FastAPI event loop blocked by Scikit-Learn Joblib thread-pool exhaustion during concurrent async inference
I am deploying a Random Forest model using FastAPI. Because Scikit-Learn models are synchronous and CPU-bound, I am offloading the inference to asyncio.get_running_loop().run_in_executor() to prevent ...
Score of 3
1 answer
129 views
FastAPI returning "Out of range float values are not JSON compliant" with Pandas NaN values
I am building a FastAPI endpoint that reads data, processes it into a Pandas DataFrame, and returns it as a JSON response.
However, my dataset contains missing data (NaN). When I convert the DataFrame ...
Tooling
1
vote
0
replies
62
views
What is a scalable alternative to embedding-based skill canonicalization in an ATS system
I am building an Applicant Tracking System (ATS) where candidates upload resumes and recruiters post job descriptions. The goal is to match candidates to relevant jobs.
Currently, my matching engine ...
Tooling
2
votes
2
replies
70
views
Is anaconda best for Django and web dev packages?
I am learning machine learning and deep learning using miniconda environment on native python. Now I am looking to learn Django and other backend packages like fastapi and tornado. Is conda enough for ...
Best practices
1
vote
3
replies
101
views
About the Pythonic code on FastAPI and Flask back end
I've done some jobs with the FastAPI or Flask on the backend, but in both situations there was no type of layering of the responsabilities. Like everything was done into the controller layer right ...
Score of 1
0 answers
111 views
How to correctly compare two encoded jwt refresh tokens
I using jwt in fastpai app, and when I create access and refresh tokens on user login I also create user session for specific user id in database, so as I understood I need to encrypt refresh token ...
Score of 0
0 answers
80 views
FastAPI Docker container ignores SIGTERM — pod takes 30s to terminate and lifespan shutdown never runs
I containerized a FastAPI service (myapp, Python 3.12, port 8080) and deploy it to a local k3d cluster. The app works, but every kubectl delete pod / rolling update takes ~30 seconds, and my FastAPI ...
Score of -1
1 answer
60 views
FastAPI returns 422 Unprocessable Entity on POST from Next.js fetch despite matching Pydantic model [duplicate]
I'm sending a POST request from a Next.js 14 client to a FastAPI endpoint. The request body matches my Pydantic model exactly, but I keep getting a 422 Unprocessable Entity instead of a 200.
Expected: ...
Score of 0
1 answer
91 views
FastAPI StreamingResponse buffers LLM tokens until completion when consumed by Next.js fetch. How can I fix this? [duplicate]
I am building an AI chat feature with a Next.js frontend and a FastAPI backend.
The backend receives tokens from an LLM provider and returns them to the browser using StreamingResponse. My goal is for ...
Score of 0
0 answers
137 views
How to stream OpenAI API response chunks from FastAPI to a Next.js 14 App Router frontend using Server-Sent Events (SSE)?
I'm building an AI chat feature where FastAPI streams OpenAI responses to my Next.js 14 (App Router) frontend using SSE, but the stream either stops after the first chunk or delivers all chunks at ...
Best practices
0
votes
1
replies
123
views
FastAPI Controller/Service/Repo architecture routing with dependency injection
I'm mostly a C# and React dev working on a new project using Python with FastAPI to build the back-end for a tool.
I originally had logic like this in my `main.py` for setting up the fastapi app:
...
Score of 0
0 answers
101 views
FastAPI + Azure Functions -> intermittent 401 Unauthorized
I have an Azure Function (with a Flex Consumption plan) using FastAPI, and it has been working well for the last month.
Recently (starting last week), without any apparent reason, we started getting ...
Advice
0
votes
1
replies
99
views
Python-Chess, Stockfish, FastAPI, React Stream Continuous Engine Evaluation
So, I am building a chess app where the frontend using the Chess.js library parses a pgn file I've downloaded from Chess.com. I'm storing a moveList and a moveIndex. When the moveIndex changes, a new ...
Score of 0
1 answer
83 views
FastAPI Response is omitting fields from nested objects when data exists
I have a FastAPI get endpoint that, to put it shortly, gets information from a database, compiles it into an object with two fields that are lists of different objects, then returns the parent object. ...
Tooling
0
votes
4
replies
159
views
Recommended languages/APIs/frameworks for an online turned based word game
It's a word chain game. One person starts with a word and the other person continues with a word that ends with the last letter of the previous word. It should have simple UI similar to Wordle by NYT. ...