Skip to content

Commit

Permalink
[grit] modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Mar 23, 2024
1 parent 05dfc9e commit b4fe26e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 8 deletions.
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN pip install dist/*.whl
# install dependencies as wheels
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt

# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
RUN pip install redisvl==0.0.7 --no-deps

# ensure pyjwt is used, not jwt
Expand Down Expand Up @@ -65,10 +65,22 @@ RUN pip install *.whl /wheels/* --no-index --find-links=/wheels/ && rm -f *.whl
RUN prisma generate
RUN chmod +x entrypoint.sh

# Install proxy requirements
COPY litellm/proxy/requirements.txt /app/litellm/proxy/requirements.txt
RUN pip wheel --no-cache-dir --wheel-dir=wheels -r litellm/proxy/requirements.txt
RUN pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp


# Copy the rest
COPY . /app

EXPOSE 4000/tcp

ENTRYPOINT ["litellm"]

# Append "--detailed_debug" to the end of CMD to view detailed debug logs
# Copy in custom config
COPY custom/config.yaml /app/proxy_server_config.yaml

# Append "--detailed_debug" to the end of CMD to view detailed debug logs
# CMD ["--port", "4000", "--config", "./proxy_server_config.yaml", "--run_gunicorn", "--detailed_debug"]
CMD ["--port", "4000", "--config", "./proxy_server_config.yaml", "--run_gunicorn", "--num_workers", "4"]
56 changes: 56 additions & 0 deletions custom/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
model_list:
- model_name: gpt-3.5-turbo
litellm_params:
model: gpt-3.5-turbo
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-4
litellm_params:
model: gpt-4
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-4-turbo-preview
litellm_params:
model: gpt-4-turbo-preview
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-4-0314
litellm_params:
model: gpt-4-0314
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-3.5-turbo-0301
litellm_params:
model: gpt-3.5-turbo-0301
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-3.5-turbo-16k
litellm_params:
model: gpt-3.5-turbo-16k
api_key: os.environ/OPENAI_API_KEY
# Anthropic
- model_name: claude-3-opus-20240229
litellm_params:
model: claude-3-opus-20240229
api_key: 'os.environ/ANTHROPIC_API_KEY'
- model_name: claude-3-sonnet-20240229
litellm_params:
model: claude-3-sonnet-20240229
api_key: 'os.environ/ANTHROPIC_API_KEY'
- model_name: claude-3-haiku-20240307
litellm_params:
model: claude-3-haiku-20240307
api_key: 'os.environ/ANTHROPIC_API_KEY'
- model_name: claude-2
litellm_params:
model: claude-2
api_key: 'os.environ/ANTHROPIC_API_KEY'
- model_name: claude-2.0
litellm_params:
model: claude-2
api_key: 'os.environ/ANTHROPIC_API_KEY'
litellm_settings:
drop_params: True
otel: True
set_verbose: True
cache: True
cache_params:
type: 'redis'
host: os.environ/REDIS_HOST
port: os.environ/REDIS_PORT
password: os.environ/REDIS_PASSWORD
15 changes: 9 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
version: "3.9"
version: '3.9'
services:
litellm:
image: ghcr.io/berriai/litellm:main-latest
build:
context: ./
dockerfile: Dockerfile
volumes:
- ./proxy_server_config.yaml:/app/proxy_server_config.yaml # mount your litellm config.yaml
- ./custom/config.yaml:/app/proxy_server_config.yaml
# - ./litellm:/app/litellm
ports:
- "4000:4000"
environment:
- AZURE_API_KEY=sk-123
- '9200:4000'
env_file:
- .env
3 changes: 3 additions & 0 deletions litellm/proxy/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
opentelemetry-api
opentelemetry-sdk
opentelemetry-exporter-otlp

0 comments on commit b4fe26e

Please sign in to comment.