Prediction interrupted; please retry (code: PA) when passing a file object as input

Calling replicate.run with a local file object failed with a Prediction interrupted error (code PA), while the same model worked from the Replicate website. Maintainer mattt explained the difference: client libraries send files in the request body as inline-encoded URIs, and the API enforces request size limits. Files around 20 MB or larger trip the limit. The reporter confirmed the fix: upload the file somewhere reachable, a signed S3 URL works for non-public files, and pass that URL as the input instead, which is what the website does internally anyway.

The (code: PA) interruption on file inputs happens when the file is too large to send inline, since the client base64-encodes it into the request body and the API caps request size. Upload the file somewhere reachable, a signed S3 URL works for private files, and pass that URL as the input instead of the file object. The model will fetch it itself, exactly like the Replicate website does. The reporter closed the issue after confirming this works, with no real difference in prediction time. Source: https://github.com/replicate/replicate-python/issues/135