The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
add data for 512d embeddings to ai docs
egor-romanovd96e5642f21b
diff --git a/apps/docs/pages/guides/ai/choosing-instance-type.mdx b/apps/docs/pages/guides/ai/choosing-instance-type.mdxindex c6bb503c4aa..919eb77c332 100644--- a/apps/docs/pages/guides/ai/choosing-instance-type.mdx+++ b/apps/docs/pages/guides/ai/choosing-instance-type.mdx@@ -1,4 +1,6 @@import Layout from '~/layouts/DefaultGuideLayout'+import { Tabs } from 'ui'+export const TabPanel = Tabs.Panelexport const meta = {id: 'ai-choosing-instance-type',@@ -20,32 +22,76 @@ We used [Vecs](https://github.com/supabase/vecs) to create a collection, upload### Results-The number of vectors in `gist-960-angular` was cut to fit the instance size.--| Plan | CPU | Memory | Vectors | RPS | Latency Mean | Latency p95 | CPU Usage - Max % | Memory Usage - Max |-| ------ | ------ | ------ | ------- | --- | ------------ | ----------- | ----------------- | ------------------ |-| Free | 2-core | 1 GB | 30,000 | 75 | 0.065 sec | 0.088 sec | 90% | 1 GB + 100 Mb Swap |-| Small | 2-core | 2 GB | 100,000 | 78 | 0.064 sec | 0.092 sec | 80% | 1.8 GB |-| Medium | 2-core | 4 GB | 250,000 | 58 | 0.085 sec | 0.129 sec | 90% | 3.2 GB |-| Large | 2-core | 8 GB | 500,000 | 55 | 0.088 sec | 0.140 sec | 90% | 5 GB |--The full number of vectors in `gist-960-angular` dataset - 1,000,000.--| Plan | CPU | Memory | Vectors | RPS | Latency Mean | Latency p95 | CPU Usage - Max % | Memory Usage - Max |-| ---- | ------- | ------ | --------- | ---- | ------------ | ----------- | ----------------- | ------------------ |-| XL | 4-core | 16 GB | 1,000,000 | 110 | 0.046 sec | 0.070 sec | 45% | 14 GB |-| 2XL | 8-core | 32 GB | 1,000,000 | 235 | 0.083 sec | 0.136 sec | 33% | 10 GB |-| 4XL | 16-core | 64 GB | 1,000,000 | 420 | 0.071 sec | 0.106 sec | 45% | 11 GB |-| 8XL | 32-core | 128 GB | 1,000,000 | 815 | 0.072 sec | 0.106 sec | 75% | 13 GB |-| 12XL | 48-core | 192 GB | 1,000,000 | 1150 | 0.052 sec | 0.078 sec | 70% | 15.5 GB |-| 16XL | 64-core | 256 GB | 1,000,000 | 1345 | 0.072 sec | 0.106 sec | 60% | 17.5 GB |--- Lists set to `Number of vectors / 1000`-- Probes set to `10`+<Tabs+ scrollable+ size="small"+ type="underlined"+ defaultActiveId="gist960"+>+<TabPanel id="gist960" label="gist-960, probes = 10">++Emdeddings of 960 dimensions from gist-960 dataset with 1,000,000 vectors.++| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |+| ------ | --------- | ----- | ---- | ------------ | ----------- | ------------------ | ------ |+| Free | 30,000 | 30 | 75 | 0.065 sec | 0.088 sec | 1 GB + 100 Mb Swap | 1 GB |+| Small | 100,000 | 100 | 78 | 0.064 sec | 0.092 sec | 1.8 GB | 2 GB |+| Medium | 250,000 | 250 | 58 | 0.085 sec | 0.129 sec | 3.2 GB | 4 GB |+| Large | 500,000 | 500 | 55 | 0.088 sec | 0.140 sec | 5 GB | 8 GB |+| XL | 1,000,000 | 1000 | 110 | 0.046 sec | 0.070 sec | 14 GB | 16 GB |+| 2XL | 1,000,000 | 1000 | 235 | 0.083 sec | 0.136 sec | 10 GB | 32 GB |+| 4XL | 1,000,000 | 1000 | 420 | 0.071 sec | 0.106 sec | 11 GB | 64 GB |+| 8XL | 1,000,000 | 1000 | 815 | 0.072 sec | 0.106 sec | 13 GB | 128 GB |+| 12XL | 1,000,000 | 1000 | 1150 | 0.052 sec | 0.078 sec | 15.5 GB | 192 GB |+| 16XL | 1,000,000 | 1000 | 1345 | 0.072 sec | 0.106 sec | 17.5 GB | 256 GB |++</TabPanel>+<TabPanel id="glove512" label="GloVe-512, probes = 10">++Emdeddings of 512 dimensions from GloVe Reddit comments dataset with 1,623,397 vectors.++| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |+| ------ | --------- | ----- | ---- | ------------ | ----------- | ------------------ | ------ |+| Free | 100,000 | 100 | 250 | 0.395 sec | 0.432 sec | 1 GB + 300 Mb Swap | 1 GB |+| Small | 250,000 | 250 | 440 | 0.223 sec | 0.250 sec | 2 GB + 200 Mb Swap | 2 GB |+| Medium | 500,000 | 500 | 425 | 0.116 sec | 0.143 sec | 3.7 GB | 4 GB |+| Large | 1,000,000 | 1000 | 515 | 0.096 sec | 0.116 sec | 7.5 GB | 8 GB |+| XL | 1,623,397 | 1275 | 465 | 0.212 sec | 0.272 sec | 14 GB | 16 GB |+| 2XL | 1,623,397 | 1275 | 1400 | 0.061 sec | 0.075 sec | 22 GB | 32 GB |+| 4XL | 1,623,397 | 1275 | 1800 | 0.027 sec | 0.043 sec | 20 GB | 64 GB |+| 8XL | 1,623,397 | 1275 | 2850 | 0.032 sec | 0.049 sec | 21 GB | 128 GB |+| 12XL | 1,623,397 | 1275 | 3700 | 0.020 sec | 0.036 sec | 26 GB | 192 GB |+| 16XL | 1,623,397 | 1275 | 3700 | 0.025 sec | 0.042 sec | 29 GB | 256 GB |++Random vectors were generated for queries.++</TabPanel>+<TabPanel id="glove512_60" label="GloVe-512, probes = 60">++Emdeddings of 512 dimensions from GloVe Reddit comments dataset with 1,623,397 vectors.++| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |+| ------ | --------- | ----- | --- | ------------ | ----------- | --------- | ------ |+| Free | 100,000 | 100 | - | - | - | - | 1 GB |+| Small | 250,000 | 250 | - | - | - | - | 2 GB |+| Medium | 500,000 | 500 | 75 | 0.656 sec | 0.750 sec | 3.7 GB | 4 GB |+| Large | 1,000,000 | 1000 | 102 | 0.488 sec | 0.580 sec | 7.5 GB | 8 GB |+| XL | 1,000,000 | 1000 | 188 | 0.525 sec | 0.596 sec | 14 GB | 16 GB |+| XL | 1,623,397 | 1275 | 75 | 0.679 sec | 0.798 sec | 14 GB | 16 GB |+| 2XL | 1,623,397 | 1275 | 160 | 0.314 sec | 0.384 sec | 22 GB | 32 GB |+| 4XL | 1,623,397 | 1275 | 300 | 0.083 sec | 0.113 sec | 20 GB | 64 GB |+| 8XL | 1,623,397 | 1275 | 565 | 0.105 sec | 0.141 sec | 21 GB | 128 GB |+| 12XL | 1,623,397 | 1275 | 840 | 0.093 sec | 0.124 sec | 26 GB | 192 GB |+| 16XL | 1,623,397 | 1275 | 940 | 0.084 sec | 0.108 sec | 29 GB | 256 GB |++Random vectors were generated for queries.++</TabPanel>+</Tabs><Admonition type="note">-It is possible to upload more than 1,000,000 vectors to a single table if Memory allows it (for example, 2XL instance and higher). But it will affect the performance of the queries: RPS will be lower, and latency will be higher. Scaling should be almost linear, but it is recommended to benchmark your workload to find the optimal number of vectors per table and per instance.+It is possible to upload more vectors to a single table if Memory allows it (for example, 2XL instance and higher). But it will affect the performance of the queries: RPS will be lower, and latency will be higher. Scaling should be almost linear, but it is recommended to benchmark your workload to find the optimal number of vectors per table and per instance.</Admonition>