File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ RUN apt-get update && \
1111 make && \
1212 rm -rf /var/lib/apt/lists/*
1313
14- ARG PYTHON_VERSION=3.12.4
14+ ARG PYTHON_VERSION=3.13.13
1515ARG PROJECT_NAME=vector-serve
1616
1717ARG UV_PYTHON_INSTALL_DIR=/opt/python
@@ -28,7 +28,9 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
2828
2929ENV UV_LINK_MODE=copy
3030
31- COPY vector-serve .
31+ COPY vector-serve/pyproject.toml .
32+ COPY vector-serve/uv.lock .
33+ COPY vector-serve/app ./app
3234
3335RUN uv venv --python "${PYTHON_VERSION}" && \
3436 uv sync --no-dev --frozen && \
Original file line number Diff line number Diff line change @@ -6,25 +6,24 @@ authors = [
66 { name = " Adam Hendel" , email = " adam@hendel.dev" }
77]
88readme = " README.md"
9- requires-python = " >=3.10 "
9+ requires-python = " >=3.13 "
1010dependencies = [
1111 " fastapi[standard]>=0.115.2" ,
1212 " sentence-transformers>=5" ,
1313 " torch>=2.4.1" ,
1414 " einops>=0.8.0" ,
1515 " prometheus-client>=0.21.0" ,
1616 " prometheus-fastapi-instrumentator>=7.0.0" ,
17- " huggingface-hub>=0.34.4 " ,
18- " transformers>=4.55 .0" ,
17+ " huggingface-hub>=1.0.0 " ,
18+ " transformers>=5.6 .0" ,
1919]
2020
21- [tool .uv ]
22- dev-dependencies = [
21+ [tool .pytest .ini_options ]
22+ pythonpath = [" ." ]
23+
24+ [dependency-groups ]
25+ dev = [
2326 " ruff" ,
24- " pytest>=8 " ,
27+ " pytest>=9 " ,
2528 " httpx>=0.27" ,
2629]
27-
28- [build-system ]
29- requires = [" hatchling" ]
30- build-backend = " hatchling.build"
Original file line number Diff line number Diff line change 11import os
22
3+
34def test_ready_endpoint (test_client ):
45 response = test_client .get ("/ready" )
56 assert response .status_code == 200
@@ -24,18 +25,19 @@ def test_metrics_endpoint(test_client):
2425 assert response .status_code == 200
2526 assert "all-MiniLM-L6-v2" in response .text
2627
28+
2729def test_private_hf_model (test_client ):
2830 response = test_client .post (
2931 "/v1/embeddings" ,
3032 headers = {"authorization" : f"bearer { os .environ ['HF_API_KEY' ]} " },
3133 json = {
3234 "input" : ["string" ],
3335 "model" : "chuckhend/private-model" ,
34- "normalize" : False
35- }
36+ "normalize" : False ,
37+ },
3638 )
3739 assert response .status_code == 200
3840 assert "data" in response .json ()
3941 embed = response .json ()["data" ][0 ]["embedding" ]
4042 assert isinstance (embed , list )
41- assert len (embed ) == 384
43+ assert len (embed ) == 384
You can’t perform that action at this time.
0 commit comments