BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.56k stars 1.71k forks source link

[Bug]: Helm Chart doesn't work #5830

Open didlawowo opened 2 months ago

didlawowo commented 2 months ago

What happened?

lite llm doesn't find Database, even if postgresql-ready-check works

Relevant log output

│
│ db-ready                                                                                                                                                    │
│ db-ready Database is ready                                                                                                                                  │
│ Stream closed EOF for mlops/litellm-6c84b45d89-xsj48 (db-ready)                                                                                             │
│ litellm {"is_panic":false,"message":"Can't reach database server at `$(DATABASE_HOST)`:`5432`\n\nPlease make sure your database server is running at `$(DAT │
│ ABASE_HOST)`:`5432`.","meta":{"database_host":"$(DATABASE_HOST)","database_port":5432},"error_code":"P1001"}                                                │
│ litellm                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                               │
│ litellm   File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request                                    │
│ litellm     raise exc                                                                                                                                       │
│ litellm   File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request                                    │
│ litellm     stream = await self._connect(request)                                                                                                           │
│ litellm              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Twitter / LinkedIn details

No response

ishaan-jaff commented 2 months ago

hi @didlawowo can we hop on a call to debug this issue and understand what you need / how to repro this ? my cal for your convenience: https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat my linkedin if you prefer DMs: https://www.linkedin.com/in/reffajnaahsi/

ishaan-jaff commented 2 months ago

hi @didlawowo following up on this. I want to get this issue resolved for you, do you have any availability this week?

miah0x41 commented 2 months ago

I have a similar issues using the deployStandalone: true setting the values.yaml file. See discord discussion.

The advice whilst insightful, didn't state how it should be used with the helm chart directly as no available setting for DATABASE_URL.

miah0x41 commented 2 months ago

I managed to fix it for version 0.2.3.

It appears the templates/deployment.yaml is missing the DATABASE_URL environmental variable. In this location ...containers.env marked by the {{- if .Values.db.deployStandalone }} flag:

https://github.com/BerriAI/litellm/blob/7500855654373d24a96edf919f4cf55608d29346/deploy/charts/litellm-helm/templates/deployment.yaml#L110-L124

Add the following two lines:

- name: DATABASE_URL
  value: postgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME)

Edit - additional clarification.

didlawowo commented 1 month ago

i have found my mistake, but i think the chart need to be updated with the last version image

didlawowo commented 1 month ago

you can add DATABASE_URL in deployment to enable UI by default . also should be a good idea to provide secret loading to provide key