Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on app database rather than replicate for prediction polling #64

Merged
merged 8 commits into from
Dec 4, 2023

Conversation

aron
Copy link
Contributor

@aron aron commented Dec 4, 2023

Currently we're hitting the replicate backend every 500ms per prediction while waiting for the prediction to complete. This results in a lot of bandwidth between the client and replicate and eats up a fair amount of time.

This PR tweaks the logic to hit the database instead and return a {id: string, status: "unknown"} string if no record is found (i.e we've not yet received the success hook from replicate).

I also had to get this running locally so I've made some small tweaks to the error handling and extended the configuration to support a configurable image bucket NEXT_PUBLIC_SUPABASE_IMAGES_HOST so local images work as expected.

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zoo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2023 1:45pm

@cbh123
Copy link
Contributor

cbh123 commented Dec 4, 2023

Thank you Aron! This looks great to me, and works on my tests

@cbh123 cbh123 merged commit d4b1b5a into main Dec 4, 2023
3 checks passed
@cbh123 cbh123 deleted the reduce-prediction-load branch December 4, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants