arimatch1's picture
Squashed: promptfoo agent with xAI
d2a0149
Raw History Blame Contribute Delete
960 Bytes
FROM python:3.12-slim
WORKDIR /app
# Install Node.js (required for promptfoo CLI)
RUN apt-get update && apt-get install -y --no-install-recommends curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Pre-install promptfoo globally to avoid npx download on every request
RUN npm install -g promptfoo@latest
# Python dependencies
RUN pip install --no-cache-dir \
fastapi uvicorn httpx litellm pyyaml
# Copy agent code
COPY demo_agents/__init__.py demo_agents/__init__.py
COPY demo_agents/base.py demo_agents/base.py
COPY demo_agents/promptfoo/__init__.py demo_agents/promptfoo/__init__.py
COPY demo_agents/promptfoo/agent.py demo_agents/promptfoo/agent.py
USER 1000
ENV PORT=7860
ENV PROMPTFOO_DISABLE_TELEMETRY=1
EXPOSE 7860
CMD ["uvicorn", "demo_agents.promptfoo.agent:app", "--host", "0.0.0.0", "--port", "7860"]