From 2605f09e1523783e27add2938147071b335329d4 Mon Sep 17 00:00:00 2001 From: Sebastian Sosa <1sebastian1sosa1@gmail.com> Date: Sat, 8 Feb 2025 17:34:41 -0500 Subject: [PATCH 1/3] expose port & required env vars & instructions for running in dev --- .env.example | 5 +++++ README.md | 17 +++++++++++++++++ docker-compose.yml | 2 ++ 3 files changed, 24 insertions(+) diff --git a/.env.example b/.env.example index c87c2ef8fd..82b09ca25e 100644 --- a/.env.example +++ b/.env.example @@ -20,3 +20,8 @@ REPLICATE_API_TOKEN = "" ANTHROPIC_API_KEY = "" # Infisical INFISICAL_TOKEN = "" + +# Development Configs +LITELLM_MASTER_KEY = "sk-1234" +DATABASE_URL = "postgresql://llmproxy:dbpassword9090@db:5432/litellm" +STORE_MODEL_IN_DB = "True" \ No newline at end of file diff --git a/README.md b/README.md index 12b8bfa9dd..7260e50bc8 100644 --- a/README.md +++ b/README.md @@ -451,3 +451,20 @@ If you have suggestions on how to improve the code quality feel free to open an + + +## Run in Developer mode +### Services +1. Setup .env file in root +2. Run dependant services `docker-compose up db prometheus` + +### Backend +1. (In root) create virtual environment `python -m venv .venv` +2. Activate virtual environment `source .venv/bin/activate` +3. Install dependencies `pip install -e ".[all]"` +4. Start proxy backend `uvicorn litellm.proxy.proxy_server:app --host localhost --port 4000 --reload` + +### Frontend +1. Navigate to `ui/litellm-dashboard` +2. Install dependencies `npm install` +3. Run `npm run dev` to start the dashboard \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1508bd375c..78044c03b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,8 @@ services: POSTGRES_DB: litellm POSTGRES_USER: llmproxy POSTGRES_PASSWORD: dbpassword9090 + ports: + - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"] interval: 1s From 06b8c7e58e792033a8c73719834c44c62fb9ad28 Mon Sep 17 00:00:00 2001 From: Sebastian Sosa <1sebastian1sosa1@gmail.com> Date: Sat, 8 Feb 2025 21:29:07 -0500 Subject: [PATCH 2/3] database management instructions --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7260e50bc8..82d66e53ba 100644 --- a/README.md +++ b/README.md @@ -457,6 +457,9 @@ If you have suggestions on how to improve the code quality feel free to open an ### Services 1. Setup .env file in root 2. Run dependant services `docker-compose up db prometheus` +3. Install prisma `npm install -g prisma` +4. Run `prisma generate` to generate the prisma client +5. (If database needs to be reset run `prisma migrate reset` followed by `prisma db push`) ### Backend 1. (In root) create virtual environment `python -m venv .venv` From 62b0aba5c1811c7e987a2f1ae295d50b467edaab Mon Sep 17 00:00:00 2001 From: Sebastian Sosa <1sebastian1sosa1@gmail.com> Date: Sat, 15 Feb 2025 14:50:28 -0500 Subject: [PATCH 3/3] docker exposed connection on dev --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 82b09ca25e..0eb4ba5898 100644 --- a/.env.example +++ b/.env.example @@ -23,5 +23,5 @@ INFISICAL_TOKEN = "" # Development Configs LITELLM_MASTER_KEY = "sk-1234" -DATABASE_URL = "postgresql://llmproxy:dbpassword9090@db:5432/litellm" +DATABASE_URL = "postgresql://llmproxy:dbpassword9090@localhost:5432/litellm" STORE_MODEL_IN_DB = "True" \ No newline at end of file