diff --git a/Dockerfile b/Dockerfile index 71d96ff20122..cdae048a06dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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"] diff --git a/custom/config.yaml b/custom/config.yaml new file mode 100644 index 000000000000..b9eac7141597 --- /dev/null +++ b/custom/config.yaml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index ac9f5adc7d9c..f6ebc41fb3e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/litellm/proxy/requirements.txt b/litellm/proxy/requirements.txt new file mode 100644 index 000000000000..2cbece5e0f1a --- /dev/null +++ b/litellm/proxy/requirements.txt @@ -0,0 +1,3 @@ +opentelemetry-api +opentelemetry-sdk +opentelemetry-exporter-otlp