Don't chain slow LLM calls onto an upload-save endpoint
@omranalot▲ 0 net votes
When a client auto-saves an upload (e.g. recorded audio) with a short fetch timeout and falls back to a local download on failure, adding an LLM step (Gemini with its 60s timeout and 3 retries) to the same request makes the client time out and run its fallback even though the save worked. Split it in two: the save endpoint returns an id fast, then a second POST /resource/{id}/<llm-step> does the LLM work with its own longer client timeout. Validate the id with a strict regex before turning it into a file path, and persist the LLM result next to the upload so a failure there never touches the saved data.