# Gemini API Embedding Configuration Clarification

**URL:** https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719
**Category:** Support
**Tags:** ai
**Created:** [October 15, 2025, 12:40am UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719 "2025-10-15T00:40:25Z")
**Posts on this page:** 5
**Page:** 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: [October 15, 2025, 12:40am UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719/1 "2025-10-15T00:40:25Z")

</div>

@Falco 2 clarification regarding embeddings:

1. What does `Sequence length` refer to in the embedding configuration? Is that related to the `Input token limit` as described here: [https://ai.google.dev/gemini-api/docs/embeddings#model-versions](https://ai.google.dev/gemini-api/docs/embeddings#model-versions)
2. How does one limit the rate of the embedding API’s? I’ve had to reset the embedding model due to the deprecation of the old model from Gemini so now it’s trying to generate new vectors for the entire forum (if I understood your other post correctly). The problem is that it’s doing it way too fast and it’s hitting 429 too many request rejections from Gemini. Is there a way to throttle it? I’m within the RPD/TPM limits but the Gemini dashboard is showing that discourse is hitting the API way too many times. Would appreciate any advice you may have here (everything was working fine until I had to create a new embedding model due the deprecation of Gemini’s old model).

All well within rate limits:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/b/7/9b78ae270d5f1a10f14290e3d85f5dcdb18fc519.png)

but getting a lot of 429 (too many request) errors:

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/d/1/5d1458556abeb5282089a665e064ad9ebae68ca2.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 15, 2025, 3:36pm UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719/2 "2025-10-15T15:36:29Z")

</div>

> [@RBoy](#):
>
> What does `Sequence length` refer to in the embedding configuration? Is that related to the `Input token limit` as described here: [https://ai.google.dev/gemini-api/docs/embeddings#model-versions](https://ai.google.dev/gemini-api/docs/embeddings#model-versions)

Yes, it is `2048` for that specific model, but you can configure it to a lower value to err on the side of caution since the Gemini API lacks an auto truncate parameter.

> [@RBoy](#):
>
> How does one limit the rate of the embedding API’s?

Hidden site setting named `ai_embeddings_backfill_batch_size`. Try setting it to 50 if your API provider can’t handle our defaults.

---

<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: [October 16, 2025, 2:36am UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719/3 "2025-10-16T02:36:54Z")

</div>

Tx. It was set to 50 still getting 1000’s of errors. I’m going to try lowering it to 20 and see how it goes.  
Maybe consider adding the `ai_embeddings_backfill_batch_size` to the embedding configuration UX screen as this may affect a lot users who are using Gemini basic plans for small sites (and possibly other providers).

---

<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: [October 16, 2025, 3:05am UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719/4 "2025-10-16T03:05:40Z")

</div>

On a side note, this appears to be the batch size, how many requests in a single call. Perhaps the issue is that number of requests being made per minute (not per batch). Is there a way to throttle how many backfill requests are sent per minute or per hour?

Also found this if it helps other users, the new gemini embedding is having issues with limits set to 0 if exceeded. There’s a temp workaround to using text embedding instead or maybe just wait for a bit and see if resolves. Having said that I still think it’s a good idea for discourse to add an option to limit the number of API calls per minute for backfills to avoid this problem in the first place.

> **[Gemini Embeddings Free Tier Quota Stuck at 0 After Overage – No Reset Across...](https://discuss.ai.google.dev/t/gemini-embeddings-free-tier-quota-stuck-at-0-after-overage-no-reset-across-projects/106517/15)**
>
> Hi, I’m encountering the same error when using the Generative Language / Gemini API: Quota exceeded for metric: generativelanguage.googleapis.com/embed\_content\_free\_tier\_requests, limit: 0 It seems that my quota for that metric is set to 0,...

PS: SUPER COOL to see google also using discourse - wonder what AI they use to power their forum search 😉 ☀

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [November 15, 2025, 3:06am UTC](https://meta.discourse.org/t/gemini-api-embedding-configuration-clarification/385719/5 "2025-11-15T03:06:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
