File size: 1,284 Bytes
1ddeb51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Hugging Face Spaces — cloud pilot API (no laptop).
# OpenSearch = Aiven · LLM + embeddings = Featherless · no local torch.
#
# Space secrets / env (set in Space Settings → Variables):
#   OPENSEARCH_URL, OPENSEARCH_USER, OPENSEARCH_ADMIN_PASSWORD
#   OPENSEARCH_VERIFY_CERTS=true
#   RETRIEVAL_BACKEND=opensearch
#   PILOT_MODE=true
#   VLLM_URL=https://api.featherless.ai/v1
#   LLM_MODEL=m42-health/Llama3-Med42-8B
#   LLM_API_KEY=<featherless>
#   EMBEDDING_URL=https://api.featherless.ai
#   EMBEDDING_MODEL=Qwen/Qwen3-Embedding-0.6B
#   EMBEDDING_DIM=1024
#   EMBEDDING_API_KEY=<featherless>
#   DEID_NER=false
#   REFRESH_ENABLED=false
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    HF_HOME=/tmp/hf-cache \
    TRANSFORMERS_CACHE=/tmp/hf-cache \
    PILOT_MODE=true \
    RETRIEVAL_BACKEND=opensearch \
    OHIP_DATA_DIR=/tmp/ohip \
    REFRESH_ENABLED=false \
    DEID_NER=false \
    PORT=7860

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

COPY requirements-spaces.txt .
RUN pip install --upgrade pip && pip install -r requirements-spaces.txt

COPY app ./app

EXPOSE 7860

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]