Spaces:
Running
Running
Commit Β·
74479a8
1
Parent(s): 79cdd38
fix: use slim requirements-api.txt in Dockerfile, exclude torch/GPU packages
Browse files- Dockerfile +4 -3
- requirements-api.txt +44 -0
Dockerfile
CHANGED
|
@@ -7,9 +7,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 7 |
git curl build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
# Copy project code
|
| 15 |
COPY . .
|
|
|
|
| 7 |
git curl build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Use slim API-only requirements (no torch/GPU/fine-tuning packages)
|
| 11 |
+
# This keeps the image ~2GB instead of ~8GB
|
| 12 |
+
COPY requirements-api.txt .
|
| 13 |
+
RUN pip install --no-cache-dir --timeout=120 -r requirements-api.txt
|
| 14 |
|
| 15 |
# Copy project code
|
| 16 |
COPY . .
|
requirements-api.txt
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# requirements-api.txt
|
| 2 |
+
# Lightweight dependencies for the API server only.
|
| 3 |
+
# Fine-tuning packages (torch, peft, bitsandbytes, trl) are NOT included here
|
| 4 |
+
# β they are only needed when running fine_tuning/train.py on a GPU machine.
|
| 5 |
+
|
| 6 |
+
# ββ API framework βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 7 |
+
fastapi>=0.111.0
|
| 8 |
+
uvicorn[standard]>=0.29.0
|
| 9 |
+
websockets>=12.0
|
| 10 |
+
python-dotenv>=1.0.0
|
| 11 |
+
pydantic>=2.7.0
|
| 12 |
+
pydantic-settings>=2.2.0
|
| 13 |
+
httpx>=0.27.0
|
| 14 |
+
tenacity>=8.3.0
|
| 15 |
+
|
| 16 |
+
# ββ LLM providers (free) ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 17 |
+
groq>=0.9.0
|
| 18 |
+
google-generativeai>=0.7.0
|
| 19 |
+
|
| 20 |
+
# ββ Retrieval & Localisation ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 21 |
+
rank-bm25>=0.2.2
|
| 22 |
+
sentence-transformers>=3.0.0 # includes torch (CPU), but much smaller than full torch
|
| 23 |
+
networkx>=3.3
|
| 24 |
+
numpy>=1.26.0
|
| 25 |
+
scipy>=1.13.0
|
| 26 |
+
scikit-learn>=1.4.0
|
| 27 |
+
|
| 28 |
+
# ββ AST & Code Understanding ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 29 |
+
tree-sitter>=0.22.0
|
| 30 |
+
tree-sitter-python>=0.22.0
|
| 31 |
+
|
| 32 |
+
# ββ Caching & Redis βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 33 |
+
diskcache>=5.6.3
|
| 34 |
+
redis>=5.0.4
|
| 35 |
+
|
| 36 |
+
# ββ Observability βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
+
structlog>=24.1.0
|
| 38 |
+
prometheus-client>=0.20.0
|
| 39 |
+
slowapi>=0.1.9
|
| 40 |
+
|
| 41 |
+
# ββ Utilities βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
+
gitpython>=3.1.43
|
| 43 |
+
unidiff>=0.7.5
|
| 44 |
+
rich>=13.7.0
|