Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
/ brevia-template Public archive

Template to implement your Brevia API project

Notifications You must be signed in to change notification settings

brevia-ai/brevia-template

Repository files navigation

Brevia API template

Use this repository as a template to implement your Brevia API project

Quickstart

Poetry is required to setup this API. It is also recommended to use virtualenv inside the project folder (you can simply do that with poetry config virtualenvs.in-project true) we assume this configuration from now on, but you are free to use your usual virtualenv configuration.

Setup

  • install the dependencies by running poetry install, a virtualenv will automatically be created in the .venv folder
  • activate the virtualenv by running the poetry shell command.
  • copy config/.env.sample file to config/.env where environment variables are stored
  • check these vars especially OPENAI_API_KEY with the secret key of OpenAI and PGVECTOR_* see the Database section

Database

You can run docker compose --profile admin up to run postgres+pgvector and pgadmin docker images. With your browser, open pgadmin at http://localhost:4000

The 4000 port is configurable with the PGADMIN_PORT environment var in the .env file.

Launch migrations to create the initial schema with Alembic by using this brevia command

db_upgrade

Launch

You are now ready to go, simply run

uvicorn --env-file .env main:app`

and your Brevia API project is ready to accept calls!

About

Template to implement your Brevia API project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages