# Discourse AI - Embeddings

**URL:** https://meta.discourse.org/t/discourse-ai-embeddings/259603
**Category:** Site Management
**Tags:** ai, ai-search, related-topics
**Created:** [April 24, 2023, 7:40pm UTC](https://meta.discourse.org/t/discourse-ai-embeddings/259603 "2023-04-24T19:40:35Z")
**Posts on this page:** 1
**Showing post:** 32

<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 1, 2024, 4:16pm UTC](https://meta.discourse.org/t/discourse-ai-embeddings/259603/32 "2024-10-01T16:16:12Z")

</div>

> [@Overgrow](#):
>
> Do I understand it correctly that backfill is when the vectorization happens?

Yes.

> [@Overgrow](#):
>
> When switching between models, do the vectors need to be recalculated

Yes, each model produces different vector representations.

> [@Overgrow](#):
>
> It’d be useful to know how the costs of using the OpenAI API stack up against investing in a GPU-powered server with opensource solution

It’s basically one call per topic, so very easy to calculate.

> [@Overgrow](#):
>
> Is there a formula or any way to estimate the number of tokens used?

If most of your topics are long, they will be truncated to 8k tokens, otherwise they will use your topic length.

> [@Overgrow](#):
>
> We’re only using the API to vectorize posts, not for calculating vector distances, right?

Yes.

> [@Overgrow](#):
>
> I assume that for both related topics and AI-powered search, all posts need to be vectorized only once, so I can calculate the total number of words in posts table and derive the number of tokens needed. The same process would apply to the daily addition of posts. I’m neglecting the search phrases for now.

Both work at the topic level, so one per topic.

---

_[View the full topic](https://meta.discourse.org/t/discourse-ai-embeddings/259603)._
