mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
(feat) - allow building litellm proxy from pip package (#7633)
* fix working build from pip * add tests for proxy_build_from_pip_tests * doc clean up for deployment * docs cleanup * docs build from pip * fix cd docker/build_from_pip
This commit is contained in:
parent
43566e9842
commit
fd0a03f719
7 changed files with 248 additions and 49 deletions
23
docker/build_from_pip/Dockerfile.build_from_pip
Normal file
23
docker/build_from_pip/Dockerfile.build_from_pip
Normal file
|
@ -0,0 +1,23 @@
|
|||
FROM cgr.dev/chainguard/python:latest-dev
|
||||
|
||||
USER root
|
||||
WORKDIR /app
|
||||
|
||||
ENV HOME=/home/litellm
|
||||
ENV PATH="${HOME}/venv/bin:$PATH"
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk update && \
|
||||
apk add --no-cache gcc python3-dev openssl openssl-dev
|
||||
|
||||
RUN python -m venv ${HOME}/venv
|
||||
RUN ${HOME}/venv/bin/pip install --no-cache-dir --upgrade pip
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=cache,target=${HOME}/.cache/pip \
|
||||
${HOME}/venv/bin/pip install -r requirements.txt
|
||||
|
||||
EXPOSE 4000/tcp
|
||||
|
||||
ENTRYPOINT ["litellm"]
|
||||
CMD ["--port", "4000"]
|
9
docker/build_from_pip/Readme.md
Normal file
9
docker/build_from_pip/Readme.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Docker to build LiteLLM Proxy from litellm pip package
|
||||
|
||||
### When to use this ?
|
||||
|
||||
If you need to build LiteLLM Proxy from litellm pip package, you can use this Dockerfile as a reference.
|
||||
|
||||
### Why build from pip package ?
|
||||
|
||||
- If your company has a strict requirement around security / building images you can follow steps outlined here
|
9
docker/build_from_pip/litellm_config.yaml
Normal file
9
docker/build_from_pip/litellm_config.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
model_list:
|
||||
- model_name: "gpt-4"
|
||||
litellm_params:
|
||||
model: openai/fake
|
||||
api_key: fake-key
|
||||
api_base: https://exampleopenaiendpoint-production.up.railway.app/
|
||||
|
||||
general_settings:
|
||||
alerting: ["slack"]
|
4
docker/build_from_pip/requirements.txt
Normal file
4
docker/build_from_pip/requirements.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
litellm[proxy]==1.57.3 # Specify the litellm version you want to use
|
||||
prometheus_client
|
||||
langfuse
|
||||
prisma
|
Loading…
Add table
Add a link
Reference in a new issue