Prediction
Learn how predictions work in WriftAI and how model executions are processed and returned
What Is a Prediction?
Predictions are the fundamental unit of work in WriftAI — every call to a model results in a prediction.
Some models return results in milliseconds, while others—especially generative models like text-to-image—may take longer to run. To support both fast and slow workloads, WriftAI’s Prediction API is asynchronous by design, but optimized runtimes, caching, and scaling ensure requests begin executing immediately when they arrive.
What a Prediction Involves
Inputs
Data you send to the version, shaped by its input schema.
Execution
WriftAI allocates compute, runs the code defined by the version, and streams data as it executes.
Outputs
The result returned by the model, shaped by the version’s output schema.
Prediction Lifecycle
A prediction moves through a short set of states:
| State | Meaning |
|---|---|
| Pending | The prediction has been queued and is waiting for a runtime. |
| Started | A runtime has picked up the prediction and is executing it. If the runtime was cold, this phase includes loading the model code and weights before running. |
| Succeeded | The prediction completed successfully and outputs are available. |
| Failed | The prediction could not be completed. Logs and error details explain what went wrong. |
These states appear in the Web Interface and are available via the API. To see how these states relate to cold and warm runtimes, see How WriftAI Works.
Execution Time Limits
Predictions have a maximum runtime of 30 minutes. If a model does not finish within this window, WriftAI automatically stops the execution and marks the prediction as failed.
Most models finish well before this limit. If your model genuinely requires more time, contact us — long-running workloads may be eligible for extended compute windows.
Prediction Data Retention
WriftAI stores prediction inputs, outputs, and logs only temporarily — they are kept for 30 minutes after the prediction completes.
After that, the data is deleted and cannot be retrieved. If you need to preserve results, you have two options:
- Save the data from your application
- Use Webhooks to receive updates in real time and store them elsewhere