Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@


```shell
docker build -t nillion/nilai:latest -f docker/Dockerfile .
```

```shell
docker run -it -p 12345:12345 -v hugging_face_models:/root/.cache/huggingface nillion/nilai:latest
docker compose up --build web
```
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

services:
web:
build:
context: .
dockerfile: docker/Dockerfile
ports:
- "12345:12345"
volumes:
- hugging_face_models:/root/.cache/huggingface

volumes:
hugging_face_models:
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ COPY . /app

WORKDIR /app

RUN pip install poetry
RUN poetry install
RUN pip install uv
RUN uv sync

EXPOSE 12345

ENTRYPOINT ["poetry", "run", "fastapi", "run", "nilai/server.py"]
ENTRYPOINT ["uv", "run", "fastapi", "run", "nilai/server.py"]
CMD ["--host", "0.0.0.0", "--port", "12345"]
2 changes: 1 addition & 1 deletion nilai/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def get_models() -> dict[str, list[Model]]:

# Chat Completion Endpoint
@app.post("/v1/chat/completions", tags=["Chat"])
async def chat_completion(
def chat_completion(
req: ChatRequest = Body(
ChatRequest(
model=state.models[0].name,
Expand Down
2,509 changes: 0 additions & 2,509 deletions poetry.lock

This file was deleted.

55 changes: 27 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
[tool.poetry]
[project]
name = "nilai"
version = "0.1.0"
description = ""
authors = ["José Cabrero-Holgueras <jose.cabrero@nillion.com>"]
authors = [
{ name = "José Cabrero-Holgueras", email = "jose.cabrero@nillion.com" }
]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
fastapi = {extras = ["standard"], version = "^0.115.5"}
cryptography = "^43.0.3"
uvicorn = "^0.32.1"
transformers = "^4.46.3"
black = {version="24.8.0", optional=true}
isort = {version="^5.13.2", optional=true}
torch = "^2.5.1"
accelerate = "^1.1.1"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
pylint = "^3.2.3"
mypy = "^1.11.2"
requires-python = ">=3.12"
dependencies = [
"accelerate>=1.1.1",
"cryptography>=43.0.3",
"fastapi[standard]>=0.115.5",
"gunicorn>=23.0.0",
"python-dotenv>=1.0.1",
"torch>=2.5.1",
"transformers>=4.46.3",
"uvicorn>=0.32.1",
]

[dependency-groups]
dev = [
"black>=24.10.0",
"isort>=5.13.2",
"ruff>=0.8.0",
"uvicorn>=0.32.1",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.extras]
linter = ["black", "isort"]
examples = ["scikit-learn"]



requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages]
find = { include = ["nilai"] }
1,272 changes: 1,272 additions & 0 deletions uv.lock

Large diffs are not rendered by default.