bifrostlab / llm-assistant

Multifunctional LLM Assistant for Discord
8 stars 6 forks source link

build: Use dotenv and remove pydantic-settings #55

Closed nqngo closed 6 months ago

nqngo commented 6 months ago

This PR removes the use of pydantic-settings and use dotenv to load environments variables.

settings.py assumes a .env is always available and required in the application for it to deploy. While this design works in dev, it will broke the Docker image. .env is meant to be ephemeral. In production, the environment is set directly during deploy.

As such, pydantic-settings can be removed and the dotenv is better suited to take in the environment variable.

This PR also ensure the model choices are now not-hardcoded and can be overrided by the LLM_DEFAULT_MODEL variable. By default, this DEFAULT_MODEL is set to phi to maintain backward compatibility.