Utiloori is primarily developed by the crew at Oori Data. We offer software engineering services around LLM applications. |
Table of contents:
- print ansi colors in terminal
- Spin up a PostgreSQL vector database using Docker with a custom config
Wraps text in ANSI color codes (and terminators) for printing colored text to console.
Some terminals, notably VSCode's, try to be clever about not displaying unreadable text; they might override the font color you specify if you specify a background color that is too similar to the font color. For example, if you specify a black font color on a red background, VSCode will override the font color to white.
the following "standard" ansi colors are supported:
- black
- red
- green
- yellow
- blue
- purple
- cyan
- white
from utiloori.ansi_color import ansi_color
print string with green font:
green_string = ansi_color('lorem', 'green')
print(green_string)
print string with purple background (with default, white font):
purple_bg_string = ansi_color('ipsum', bg_color='purple')
print(purple_bg_string)
print string with red font on a blue background:
red_on_blue_string = ansi_color('dolor', 'red', 'blue')
print(red_on_blue_string)
- For security, we will load in secrets using 1password.
- See the setup instructions if you do not have 1password CLI.
- You can now prefix commands with
op run --env-file=op.env -- <your command>
and have the secrets loaded automatically. NOTE: you can add the--no-masking
flag before--
to avoid 1password masking terminal.
- Clone the repository.
- Configure needed env variables,
$PG_USER
and$PG_HOST
, either using your own orop.env
, detailed below. - From the root, run:
op run --env-file op.env -- docker compose -f PGv/compose.PGvector.yml up -d --build
(you can remove --build
if you don't want to rebuild the image)
5. Now you have PGv database running on localhost:5432
and an adminer interface on localhost:8080
- See Sofola Diary entry.
Configurable:
- All the options in
pg_configs/postgresql.conf
, by defaultmax_connections
to 200 andshared_buffers
to 128mb - Inside of
compose.PGvector.yml
orcompose.PGv_remote.yml
POSTGRES_USER
: The username used to connect to the database.POSTGRES_PASSWORD
: The password used to connect to the database.POSTGRES_DB
: The name of the database created.- Ports can be configured inside
compose.PGvector.yml