Skip to content

Commit 350bb37

Browse files
authored
add doc page for pg configs (#170)
* add doc page for pg configs
1 parent 638b128 commit 350bb37

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

docs/configuration.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Configuring pg_vectorize
2+
3+
## Changing the database
4+
5+
To change the database that pg_vectorize background worker is connected to, you can use the following SQL command:
6+
7+
```sql
8+
ALTER SYSTEM SET vectorize.database_name TO 'my_new_db';
9+
```
10+
11+
Then, restart Postgres.
12+
13+
## Changing Embedding and LLM base URLs
14+
15+
All Embedding model and LLM providers can have their base URLs changed.
16+
17+
For example, if you have an OpenAI compliant embedding or LLM server (such as [vLLM](https://github.com/vllm-project/vllm)), running at `https://api.myserver.com/v1`, you can change the base URL with the following SQL command:
18+
19+
```sql
20+
ALTER SYSTEM SET vectorize.openai_base_url TO 'https://api.myserver.com/v1';
21+
SELECT pg_reload_conf();
22+
```
23+
24+
## Changing the batch job size
25+
26+
Text data stored in Postgres is transformed into embeddings via HTTP requests made from the pg_vectorize background worker. Requests are made to the specified embedding service in batch (multiple inputs per request). The number of inputs per request is determined by the `vectorize.batch_size` GUC. This has no impact on transformations that occur during `vectorize.search()`, `vectorize.encode()` and `vectorize.rag()` which are always batch size 1 since those APIs accept only a single input (the raw text query).
27+
28+
```sql
29+
ALTER SYSTEM SET vectorize.batch_size to 100;
30+
```
31+
32+
## Available GUCs
33+
34+
The complete list of GUCs available for pg_vectorize are defined in [extension/src/guc.rs](https://github.com/tembo-io/pg_vectorize/blob/638b12887f14d47de0793b16d535b226d8f371b9/extension/src/guc.rs#L33).

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ nav:
2525
- 'examples/openai_embeddings.md'
2626
- 'examples/scheduling.md'
2727
- Model Providers: 'models/index.md'
28+
- Extension Configuration: 'configuration.md'
2829
markdown_extensions:
2930
- toc:
3031
permalink: true

0 commit comments

Comments
 (0)