promptdojo_

FastAPI inference shape — step 6 of 7

Write the two endpoints every model server needs: health() returning {"ok": <model loaded>, "model_version": ...}, and predict(payload) with the full contract — isinstance boundary check returning ({"error": ...}, 422), otherwise ({"score": ..., "model_version": ...}, 200) using the 5.0 cutoff. Print health, a good request (6 tickets), and a bad one (a list).

full-screen editor opens — close anytime to keep reading.