# "Net::HTTPBadResponse" errors on Gemini Embeddings

**URL:** <https://meta.discourse.org/t/net-httpbadresponse-errors-on-gemini-embeddings/296952>\
**Category:** Bug\
**Tags:** ai, related-topics\
**Created:** [February 14, 2024, 9:07pm UTC](https://meta.discourse.org/t/net-httpbadresponse-errors-on-gemini-embeddings/296952 "2024-02-14T21:07:52Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)\
**Post date:** [February 14, 2024, 9:07pm UTC](https://meta.discourse.org/t/net-httpbadresponse-errors-on-gemini-embeddings/296952/1 "2024-02-14T21:07:52Z")

</div>

I’m using Gemini for the LLM, I’m noticing a lot of errors in the logs and it appears to be coming from a embeddings backfill task.

> Job exception: Net::HTTPBadResponse
> 
> /var/www/discourse/plugins/discourse-ai/app/jobs/scheduled/embeddings\_backfill.rb:122:in `populate\_topic\_embeddings’

Based on the architecture diagram above, it should only run on a new topic but it appears that there’s a backfill task which runs on existing topics as well. That in itself it actually a good thing since it helps existing topics as well.

My clarification is related to limits. If Gemini is limited to 60 queries per minute, I suspect that the threshold may be causing the errors (is there a way to confirm?).  
When a threshold is hit, does discourse retry to embeddings for the failed topic after a while? If so, how often and for how long? If not, is there a way to manually trigger the backfill task for related topics to go back and handle the unprocessed topics?

---

_[View the full topic](https://meta.discourse.org/t/net-httpbadresponse-errors-on-gemini-embeddings/296952)._
