Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
77e5dc5
Update CI workflow to utilize UV for Python package management and te…
aniketmaurya Jul 1, 2025
20cd348
fiix
aniketmaurya Jul 1, 2025
3838fb2
fix
aniketmaurya Jul 1, 2025
c99a59e
updae
aniketmaurya Jul 1, 2025
c615787
upgrade uv
aniketmaurya Jul 1, 2025
eaec97b
add env
aniketmaurya Jul 1, 2025
ff33c3a
Merge branch 'main' into faster-ci-with-uv
aniketmaurya Jul 1, 2025
ba61048
fix
aniketmaurya Jul 1, 2025
19e687f
update
aniketmaurya Jul 1, 2025
ce76130
fix
aniketmaurya Jul 1, 2025
624de5d
fix
aniketmaurya Jul 1, 2025
7600c9a
up
aniketmaurya Jul 1, 2025
058fdeb
Update project configuration and dependencies in pyproject.toml and .…
aniketmaurya Jul 1, 2025
000b696
Merge branch 'main' into faster-ci-with-uv
aniketmaurya Jul 1, 2025
8378946
Merge branch 'migrate-uv' into faster-ci-with-uv
aniketmaurya Jul 1, 2025
ad5c537
update
aniketmaurya Jul 1, 2025
bd1681a
Refactor project configuration by consolidating setup into pyproject.…
aniketmaurya Jul 1, 2025
cd655af
fix
aniketmaurya Jul 1, 2025
7cf8a03
fix
aniketmaurya Jul 1, 2025
eafb4b7
fic ci
aniketmaurya Jul 1, 2025
d8677eb
fix
aniketmaurya Jul 2, 2025
be5385b
update
aniketmaurya Jul 2, 2025
f5dc4a4
Merge branch 'main' into faster-ci-with-uv
aniketmaurya Jul 2, 2025
0a0ca9b
fix
aniketmaurya Jul 2, 2025
00ff528
Merge branch 'main' into faster-ci-with-uv
aniketmaurya Jul 8, 2025
0770334
sync
aniketmaurya Jul 8, 2025
1b992e4
fix
aniketmaurya Jul 8, 2025
9009bf9
fix
aniketmaurya Jul 8, 2025
4b7e683
fix azure
aniketmaurya Jul 8, 2025
168dc12
fix requirements
aniketmaurya Jul 9, 2025
93a346f
fix toml
aniketmaurya Jul 9, 2025
ee76360
backward compatibility
aniketmaurya Jul 9, 2025
890c178
fix
aniketmaurya Jul 9, 2025
99d09eb
fix ci
aniketmaurya Jul 9, 2025
b6c6d44
fix gpu test
aniketmaurya Jul 9, 2025
256cacb
fix python script subprocess
aniketmaurya Jul 9, 2025
2efcd81
update
aniketmaurya Jul 9, 2025
a2c2e8e
fix gpu test
aniketmaurya Jul 9, 2025
e4bba1e
fix gpu
aniketmaurya Jul 9, 2025
8a4f787
Apply suggestions from code review
Borda Jul 9, 2025
dd5a323
Apply suggestions from code review
Borda Jul 9, 2025
47b9965
cat requirements.txt
Borda Jul 9, 2025
e068929
list before and after
aniketmaurya Jul 9, 2025
37ae942
echo
Borda Jul 9, 2025
f4c4e78
echo
Borda Jul 9, 2025
fd8e804
remove min dep
aniketmaurya Jul 9, 2025
3e249a6
Update ci-testing.yml
Borda Jul 9, 2025
d49312d
fixes
aniketmaurya Jul 9, 2025
9c130bc
Merge branch 'faster-ci-with-uv' of github.com:Lightning-AI/LitServe …
aniketmaurya Jul 9, 2025
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
33 changes: 18 additions & 15 deletions .azure/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${CUDA_version_mm}/torch_stable.html"
displayName: "set Env. vars"

- bash: |
pip install uv
displayName: "Install uv"

- bash: |
whoami && id
lspci | egrep 'VGA|3D'
Expand All @@ -53,44 +57,43 @@ jobs:
echo $CUDA_VISIBLE_DEVICES
echo $TORCH_URL
python --version
pip --version
pip cache dir
pip list
uv --version
uv cache dir
uv pip list
displayName: "Image info & NVIDIA"

- bash: |
pip install . -U --prefer-binary \
-r ./_requirements/test.txt --find-links=${TORCH_URL}
uv sync --all-extras --dev
displayName: "Install environment"

- bash: |
pip list
uv pip list
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'found GPUs: {mgpu}'"
displayName: "Sanity check"

- bash: |
pip install -q py-tree
py-tree /var/tmp/torch
uv pip install -q py-tree
uv run py-tree /var/tmp/torch
displayName: "Show caches"

- bash: |
coverage run --source litserve -m pytest src tests -v
uv run coverage run --source litserve -m pytest src tests -v
displayName: "Testing"

- bash: |
python -m coverage report
python -m coverage xml
python -m codecov --token=$(CODECOV_TOKEN) --name="GPU-coverage" \
uv run coverage report
uv run coverage xml
uv run codecov --token=$(CODECOV_TOKEN) --name="GPU-coverage" \
--commit=$(Build.SourceVersion) --flags=gpu,unittest --env=linux,azure
ls -l
displayName: "Statistics"

- bash: |
pip install torch torchvision -U -q --find-links=${TORCH_URL} -r _requirements/perf.txt
export PYTHONPATH=$PWD && python tests/parity_fastapi/main.py
uv pip install torch torchvision -U -q --find-links=${TORCH_URL}
export PYTHONPATH=$PWD && uv run tests/parity_fastapi/main.py
displayName: "Run FastAPI parity tests"

- bash: |
pip install gpustat wget -U -q
uv pip install gpustat wget -U -q
bash tests/perf_test/bert/run_test.sh
displayName: "Run GPU perf test"
14 changes: 8 additions & 6 deletions .github/workflows/ci-minimal-dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv and setup python
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
activate-environment: true
python-version: "3.12"
enable-cache: true

- name: Install LitServe
run: |
pip --version
pip install . psutil -U -q
pip list
uv sync --no-dev
uv pip install . psutil -U -q
uv pip list

- name: Tests
run: python tests/minimal_run.py
15 changes: 9 additions & 6 deletions .github/workflows/ci-parity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv and setup python
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
activate-environment: true
python-version: "3.12"
enable-cache: true

- name: Install LitServe
run: |
pip --version
pip install . torchvision jsonargparse uvloop tenacity -U -q -r _requirements/test.txt -U -q
pip list
uv sync --all-extras --dev
uv pip compile pyproject.toml -o requirements.txt
uv pip install torchvision jsonargparse uvloop tenacity -U -q
uv pip list

- name: Parity test
run: export PYTHONPATH=$PWD && python tests/parity_fastapi/main.py
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,36 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv and setup python
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
python-version: ${{ matrix.python-version }}
cache: "pip"
enable-cache: true

- name: Set up dependencies
run: uv pip compile pyproject.toml -o requirements.txt

- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
pip install 'lightning-utilities[cli]'
python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt", "_requirements/test.txt"]'
uv pip install 'lightning-utilities[cli]'
uv run python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt"]'
echo "======requirements.txt======"
cat requirements.txt
echo "----------------------------"

- name: Install package & dependencies
- name: Install package
run: |
pip --version
pip install -e '.[test]' -U -q --find-links $TORCH_URL
pip list
uv pip install -r requirements.txt -U -q
uv pip list
uv sync --group dev
uv pip list

- name: Tests
timeout-minutes: 15
run: |
python -m pytest --cov=litserve src/ tests/ -v -s --durations=100
pytest --cov=litserve src/ tests/ -v -s --durations=100

- name: Statistics
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ venv.bak/
lightning_logs/
MNIST
.DS_Store
uv.lock
18 changes: 0 additions & 18 deletions _requirements/test.txt

This file was deleted.

87 changes: 82 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,63 @@
license_file = "LICENSE"
description-file = "README.md"

[build-system]
requires = [
"setuptools",
"wheel",
[project]
name = "litserve"
dynamic = ["version"]
description = "Lightweight AI server."
readme = "README.md"
license = {text = "Apache-2.0"}
authors = [
{name = "Lightning-AI et al.", email = "[email protected]"}
]
requires-python = ">=3.9"
keywords = ["deep learning", "pytorch", "AI"]
classifiers = [
"Environment :: Console",
"Natural Language :: English",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Information Analysis",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

dependencies = [
"fastapi>=0.100",
"pyzmq>=22.0.0",
"uvicorn[standard]>=0.29.0",
]

[project.urls]
Homepage = "https://github.com/Lightning-AI/litserve"
"Bug Tracker" = "https://github.com/Lightning-AI/litserve/issues"
Documentation = "https://lightning-ai.github.io/litserve/"
"Source Code" = "https://github.com/Lightning-AI/litserve"
Download = "https://github.com/Lightning-AI/litserve"

[project.scripts]
litserve = "litserve.__main__:main"
lightning = "litserve.cli:main"


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/litserve/__about__.py"
pattern = "__version__ = \"(?P<version>.+)\""


[tool.hatch.metadata]
allow-direct-references = true

[tool.check-manifest]
ignore = [
Expand All @@ -16,7 +67,6 @@ ignore = [
".github/*"
]


[tool.pytest.ini_options]
norecursedirs = [
".git",
Expand Down Expand Up @@ -128,3 +178,30 @@ convention = "google"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[dependency-groups]
dev = [
"asgi-lifespan>=2.1.0",
"coverage[toml]>=7.5.3",
"fastmcp>=2.9.2 ; python_full_version >= '3.10'",
"httpx>=0.27.0",
"lightning>2.0.0",
"mypy==1.16.1",
"numpy<3.0",
"openai>=1.12.0",
"pillow>=11.3.0",
"psutil>=7.0.0",
"pytest>=8.0",
"pytest-asyncio>=1.0.0",
"pytest-cov>=6.2.1",
"pytest-retry>=1.6.3",
"python-multipart>=0.0.20",
"requests>=2.32.4",
"torch>2.0.0",
"transformers>=4.53.0",
"uvloop>=0.21.0 ; sys_platform != 'win32'",
"tenacity>=9.1.2",
"jsonargparse",
"rich",
"torchvision>=0.22.1",
]
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

Loading
Loading