7,324 questions
-5
votes
0
answers
42
views
Intermittent 502/504 errors in Kubernetes (Traefik + FastAPI/Uvicorn), worse under load spikes [closed]
I have a FastAPI service running on Kubernetes behind Traefik ingress (Previously had Nginx but the issue is consistent).
Setup
FastAPI (Uvicorn, ~8 workers)
Kubernetes limits: 500m CPU / 1Gi memory
...
Advice
0
votes
1
replies
80
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 ...
0
votes
1
answer
67
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
147
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. ...
Tooling
0
votes
1
replies
104
views
How do I create an authentication feature with FastAPI and React?
How do I create an authentication feature with FastAPI and React? What tools can I use for this? Is using FastAPI-Users sufficient? Or are there other similar libraries? I also found a note in the ...
Best practices
0
votes
1
replies
77
views
Best practices for scaling LangChain agent architecture in FastAPI
I have a FastAPI app using LangChain agents that works fine at low traffic but struggles at scale.
Current setup:
from fastapi import FastAPI
from langchain.agents import initialize_agent, AgentType
...
Advice
1
vote
2
replies
94
views
How to structure reusable response models in FastAPI for multiple content formats?
I’m working on a FastAPI backend that generates different types of content (social posts, blogs, emails).
Many responses share common fields (id, metadata, generated text), but each format also has ...
2
votes
1
answer
99
views
Can't accept a list of files through FastAPI
from fastapi import FastAPI, File, UploadFile, HTTPException
from pathlib import Path
from typing import List
@app.post("/uploadfile/")
def create_upload_file(file: List[UploadFile] = ...
0
votes
1
answer
88
views
Concurrent update error: race condition error in FastAPI
I have a function, that updated database
@router.put("/{task_id}/status")
def update_status(task_id: str, task_data: UpdateStatus, db: Session = Depends(get_db)):
task = ...
Advice
0
votes
2
replies
56
views
How to build a context-aware chatbot that guides users between FastAPI endpoints using provided documentation?
I have a FastAPI application with multiple endpoints (e.g., /add_to_cart, /checkout, etc.), and I also have OpenAPI documentation that defines not only the endpoints but also the logical flow between ...
Best practices
0
votes
0
replies
33
views
httpx.AsyncClient - single or multiple pools per domain
I am creating an async FastAPI service that trigger models via post requests.
Each model has a different domain.
It should support high throughput and low latency.
What is the best way managing it? ...
2
votes
1
answer
111
views
Python smtplib returns 250 OK but Gmail recipient never receives email (company domain sender)
I’m using Python (`smtplib` + `email.mime`) to send OTP emails from our company domain email account to users (many are on Gmail).
Even though the client shows 200, on my test emails I never received ...
3
votes
2
answers
129
views
FastAPI response model for env-dependent variable return type
_Item = TypeVar("_Item", BaseItem)
@app.get(path="items")
def get_items() -> list[_Item]:
return _get_items()
Pylance complains:
TypeVar "_Item" appears only ...
0
votes
0
answers
44
views
Testing LangGraph functional API entrypoint with injected checkpointer raises RuntimeError: checkpointer not set
I'm building a FastAPI application that uses LangGraph's functional API (@entrypoint) for defining workflows. Each entrypoint requires a checkpointer, and I want to use PostgresSaver in production but ...
2
votes
1
answer
49
views
escape circular imports with fastapi
i am learning fastapi and i structure an app like this
app in FastAPI:
models.py file to hold database and other python important methods
routes.py file to hold the routes (URLs)
schemas.py file to ...