Skip to content

Commit d371703

Browse files
dnplkndllclaude
andcommitted
fix(deps): Pin openai<2.0 and migrate to uv
The langfuse fork requires openai 1.x - the beta.chat module was removed in openai 2.x causing import errors. Changes: - Pin openai to 1.78.1 (compatible with langfuse fork) - Update constraints to openai>=1.44,<2.0 - Migrate Dockerfile from pip to uv for faster builds Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 781e618 commit d371703

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

Lightweight.Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ RUN apt-get update && \
2121
git && \
2222
rm -rf /var/lib/apt/lists/*
2323

24+
# Install uv for faster dependency management
25+
RUN pip install uv
26+
2427
# Install td-grpc-bootstrap
2528
RUN curl -L https://storage.googleapis.com/traffic-director/td-grpc-bootstrap-0.16.0.tar.gz | tar -xz && \
2629
mv td-grpc-bootstrap-0.16.0/td-grpc-bootstrap /usr/local/td-grpc-bootstrap && \
2730
rm -rf td-grpc-bootstrap-0.16.0
2831

2932
COPY pyproject.toml .
3033

31-
# Install dependencies
34+
# Install dependencies with uv (faster than pip)
3235
COPY setup.py requirements.txt ./
33-
RUN pip install --upgrade pip==24.0
3436
# pytorch without gpu
35-
RUN pip install torch==2.2.0 --index-url https://download.pytorch.org/whl/cpu
36-
RUN pip install -r requirements.txt --no-cache-dir
37+
RUN uv pip install --system torch==2.2.0 --index-url https://download.pytorch.org/whl/cpu
38+
RUN uv pip install --system -r requirements.txt
3739

3840
# Copy model files (assuming they are in the 'models' directory)
3941
COPY models/ models/
@@ -51,7 +53,7 @@ COPY supervisord.conf /etc/supervisord.conf
5153

5254
# Ignore dependencies, as they are already installed and docker handles the caching
5355
# this skips annoying rebuilds where requirements would technically be met anyways.
54-
RUN pip install --default-timeout=120 -e . --no-cache-dir --no-deps
56+
RUN uv pip install --system -e . --no-deps
5557

5658
ENV FLASK_APP=src.seer.app:start_app()
5759

requirements-constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mpmath==1.3.0
2525
networkx==3.1
2626
numpy==1.26.1
2727
onnx==1.16.0
28-
openai>=1.44
28+
openai>=1.44,<2.0
2929
optimum==1.16.2
3030
packaging
3131
pandas==2.0.3

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ kiwisolver==1.4.5
359359
# matplotlib
360360
kombu==5.4.2
361361
# via celery
362-
langfuse @ git+https://github.com/jennmueng/langfuse-python.git@d7c0127682ddb20f73c5cf4fbb396cdfa8961fc3
362+
langfuse==2.59.2
363363
# via -r requirements-constraints.txt
364364
lazy-object-proxy==1.12.0
365365
# via openapi-spec-validator
@@ -442,7 +442,7 @@ onnx==1.16.0
442442
# via -r requirements-constraints.txt
443443
onnxruntime==1.23.2
444444
# via chromadb
445-
openai==2.16.0
445+
openai==1.78.1
446446
# via -r requirements-constraints.txt
447447
openapi-core==0.18.2
448448
# via -r requirements-constraints.txt

0 commit comments

Comments
 (0)