pub(crate) async fn save_model( state: &Arc<AppState>, model: Model, ) -> Result<Arc<Model>, ApiError>
Save the model on a blocking thread and make it the cached copy. Call with write_lock held.
write_lock