Skip to content

Commit c6b0a36

Browse files
committed
unify packages and also set keys when initializing
1 parent 7ff50db commit c6b0a36

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

eval_protocol/proxy/Dockerfile.gateway

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ WORKDIR /app
66
# Prevent Python from buffering stdout/stderr
77
ENV PYTHONUNBUFFERED=1
88

9-
# Copy requirements file
10-
COPY ./requirements.txt /app/requirements.txt
9+
# Copy the entire package for local install (context is repo root)
10+
COPY pyproject.toml /app/pyproject.toml
11+
COPY eval_protocol /app/eval_protocol
12+
COPY README.md /app/README.md
1113

12-
# Install dependencies
13-
RUN pip install --no-cache-dir -r requirements.txt
14+
# Install from local source with proxy extras
15+
RUN pip install --no-cache-dir ".[proxy]"
1416

15-
# Copy the proxy package
16-
COPY ./proxy_core /app/proxy_core
17+
# Copy the proxy package (local overrides for main.py, auth.py, etc.)
18+
COPY eval_protocol/proxy/proxy_core /app/proxy_core
1719

1820
# Expose port
1921
EXPOSE 4000

eval_protocol/proxy/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ services:
1616
# Metadata Gateway - Handles LLM calls directly via LiteLLM SDK with Langfuse OTEL
1717
metadata-gateway:
1818
build:
19-
context: .
20-
dockerfile: Dockerfile.gateway
19+
context: ../..
20+
dockerfile: eval_protocol/proxy/Dockerfile.gateway
2121
container_name: metadata-gateway
2222
environment:
2323
- PORT=4000

eval_protocol/proxy/proxy_core/app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ async def lifespan(app: FastAPI):
108108
app.state.config = build_proxy_config(preprocess_chat_request, preprocess_traces_request)
109109
app.state.redis = init_redis()
110110

111+
config = app.state.config
112+
default_keys = config.langfuse_keys[config.default_project_id]
113+
os.environ["LANGFUSE_PUBLIC_KEY"] = default_keys["public_key"]
114+
os.environ["LANGFUSE_SECRET_KEY"] = default_keys["secret_key"]
115+
os.environ.setdefault("LANGFUSE_HOST", config.langfuse_host)
116+
111117
import litellm
112118

113119
litellm.callbacks = ["langfuse_otel"]

eval_protocol/proxy/requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ proxy = [
153153
"redis>=5.0.0",
154154
"langfuse>=2.0.0",
155155
"uuid6>=2025.0.0",
156+
"opentelemetry-api>=1.20.0",
157+
"opentelemetry-sdk>=1.20.0",
158+
"opentelemetry-exporter-otlp>=1.20.0",
156159
]
157160

158161
[project.scripts]

0 commit comments

Comments
 (0)