Skip to content

Commit f476655

Browse files
feat: Add CI workflow, pre-commit configuration, and update project files for v2.1 release
1 parent c735f58 commit f476655

8 files changed

Lines changed: 264 additions & 4 deletions

File tree

.gitattributes

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
*.7z filter=lfs diff=lfs merge=lfs -text
2+
*.arrow filter=lfs diff=lfs merge=lfs -text
3+
*.bin filter=lfs diff=lfs merge=lfs -text
4+
*.bz2 filter=lfs diff=lfs merge=lfs -text
5+
*.ckpt filter=lfs diff=lfs merge=lfs -text
6+
*.ftz filter=lfs diff=lfs merge=lfs -text
7+
*.gz filter=lfs diff=lfs merge=lfs -text
8+
*.h5 filter=lfs diff=lfs merge=lfs -text
9+
*.joblib filter=lfs diff=lfs merge=lfs -text
10+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
11+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
12+
*.model filter=lfs diff=lfs merge=lfs -text
13+
*.msgpack filter=lfs diff=lfs merge=lfs -text
14+
*.npy filter=lfs diff=lfs merge=lfs -text
15+
*.npz filter=lfs diff=lfs merge=lfs -text
16+
*.onnx filter=lfs diff=lfs merge=lfs -text
17+
*.ot filter=lfs diff=lfs merge=lfs -text
18+
*.parquet filter=lfs diff=lfs merge=lfs -text
19+
*.pb filter=lfs diff=lfs merge=lfs -text
20+
*.pickle filter=lfs diff=lfs merge=lfs -text
21+
*.pkl filter=lfs diff=lfs merge=lfs -text
22+
*.pt filter=lfs diff=lfs merge=lfs -text
23+
*.pth filter=lfs diff=lfs merge=lfs -text
24+
*.rar filter=lfs diff=lfs merge=lfs -text
25+
*.safetensors filter=lfs diff=lfs merge=lfs -text
26+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27+
*.tar.* filter=lfs diff=lfs merge=lfs -text
28+
*.tar filter=lfs diff=lfs merge=lfs -text
29+
*.tflite filter=lfs diff=lfs merge=lfs -text
30+
*.tgz filter=lfs diff=lfs merge=lfs -text
31+
*.wasm filter=lfs diff=lfs merge=lfs -text
32+
*.xz filter=lfs diff=lfs merge=lfs -text
33+
*.zip filter=lfs diff=lfs merge=lfs -text
34+
*.zst filter=lfs diff=lfs merge=lfs -text
35+
*tfevents* filter=lfs diff=lfs merge=lfs -text
36+
docs/images/animation.gif filter=lfs diff=lfs merge=lfs -text
37+
docs/images/logo.png filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
# Cancel in-progress runs of the same workflow on the same branch / PR.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
lint:
20+
name: Ruff lint
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
cache: pip
28+
- name: Install ruff
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install "ruff>=0.5.0"
32+
- name: Run ruff
33+
run: ruff check .
34+
35+
tests:
36+
name: Tests (Python ${{ matrix.python-version }})
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
python-version: ["3.10", "3.11", "3.12"]
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
cache: pip
48+
- name: Install minimal runtime deps
49+
# We deliberately install CPU-only ``torch`` to keep CI fast and avoid
50+
# pulling CUDA / cuDNN wheels. ``bitsandbytes`` is also skipped (it is
51+
# GPU-only). Tests stub out the heavy I/O and never touch a real GPU.
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install --index-url https://download.pytorch.org/whl/cpu "torch>=2.0.0"
55+
pip install \
56+
"transformers>=4.36.0" \
57+
"datasets>=2.14.0" \
58+
"accelerate>=0.24.0" \
59+
"peft>=0.6.0" \
60+
"scipy>=1.10.0" \
61+
"scikit-learn>=1.3.0" \
62+
"tqdm>=4.65.0" \
63+
"rich>=13.0.0" \
64+
"huggingface_hub>=0.20.0" \
65+
"psutil" \
66+
"gguf" \
67+
"py-cpuinfo" \
68+
"pytest>=7.4.0"
69+
- name: Install QuantLLM (no deps; we already installed them above)
70+
# ``--no-deps`` skips re-resolving the heavy dependency set (notably
71+
# ``bitsandbytes``, which is GPU-only and not needed by the test
72+
# suite). The import-only install is what makes ``import quantllm``
73+
# work in the test workers.
74+
run: pip install --no-deps -e .
75+
- name: Run pytest
76+
env:
77+
QUANTLLM_BANNER: "0"
78+
run: pytest tests/ -ra
79+
80+
build:
81+
name: Build sdist + wheel
82+
runs-on: ubuntu-latest
83+
needs: [lint, tests]
84+
steps:
85+
- uses: actions/checkout@v4
86+
- uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.11"
89+
cache: pip
90+
- name: Install build tooling
91+
run: |
92+
python -m pip install --upgrade pip
93+
pip install build twine
94+
- name: Build distribution
95+
run: python -m build
96+
- name: Validate artifacts
97+
run: twine check dist/*
98+
- name: Upload artifacts
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: dist-${{ github.sha }}
102+
path: dist/
103+
retention-days: 14

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Pre-commit configuration for QuantLLM contributors.
2+
#
3+
# Setup:
4+
# pip install pre-commit
5+
# pre-commit install
6+
#
7+
# The hooks below run a fast subset of CI locally before each commit. The full
8+
# test suite still runs in GitHub Actions; pre-commit only blocks obviously
9+
# broken commits (lint failures, leftover merge markers, accidentally
10+
# committed large files, etc.).
11+
12+
repos:
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v4.6.0
15+
hooks:
16+
- id: trailing-whitespace
17+
- id: end-of-file-fixer
18+
- id: check-yaml
19+
- id: check-toml
20+
- id: check-merge-conflict
21+
- id: check-added-large-files
22+
args: ["--maxkb=1024"]
23+
- id: debug-statements
24+
- id: mixed-line-ending
25+
args: ["--fix=lf"]
26+
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.5.7
29+
hooks:
30+
- id: ruff
31+
args: ["--fix"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 codewithdark-git (QuantLLM)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/images/logo.png

-571 KB
Binary file not shown.

pyproject.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[build-system]
2+
requires = ["setuptools>=68", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
# NOTE: Project metadata, dependencies and extras are still declared in
6+
# ``setup.py`` for now to keep a single source of truth and avoid duplicating
7+
# the install-requires list. ``setup.py`` defines:
8+
#
9+
# * ``install_requires`` (mandatory deps)
10+
# * ``extras_require`` (``gguf``, ``onnx``, ``mlx``, ``triton``, ``flash``,
11+
# ``hub``, ``full``, ``dev``)
12+
# * ``entry_points`` (the ``quantllm`` CLI)
13+
#
14+
# Adding a ``[project]`` table here would silently override those values in
15+
# editable installs, which has tripped up several contributors. Once the
16+
# ``setup.py`` migration to PEP 621 is complete, this file will own the full
17+
# project metadata.
18+
19+
[tool.ruff]
20+
line-length = 120
21+
target-version = "py310"
22+
extend-exclude = [
23+
"build",
24+
"dist",
25+
".venv",
26+
"examples/output",
27+
"docs/_build",
28+
]
29+
30+
[tool.ruff.lint]
31+
# Minimal "blocker" ruleset enforced on every push. The codebase predates
32+
# ruff, so we deliberately start small -- this catches genuine bugs (syntax
33+
# errors, undefined names, broken comparisons) without producing a giant
34+
# reformatting diff. Stricter rules can be opted-in incrementally.
35+
select = [
36+
"E9", # pycodestyle runtime errors (syntax, indentation)
37+
"F63", # invalid `is` comparisons / `not in` issues
38+
"F7", # syntax errors in expressions
39+
"F82", # undefined names actually used
40+
"F811", # redefinition of unused name
41+
"F821", # undefined-name reference
42+
"F823", # local variable referenced before assignment
43+
# NOTE: F841 (unused local) is intentionally NOT enabled yet. The existing
44+
# codebase has several intentional unused-binding patterns (progress
45+
# tasks, documenting intent, etc.) and fixing them is out of scope.
46+
"B006", # mutable default arguments (genuine bug class)
47+
"B017", # ``assertRaises(Exception)`` -- masks real failures
48+
]
49+
ignore = [
50+
"E501", # line length: not enforced strictly
51+
"E402", # module-level import not at top of file
52+
"E741", # ambiguous variable names
53+
]
54+
55+
[tool.ruff.lint.per-file-ignores]
56+
"tests/*" = ["F401", "F811", "F841"]
57+
"quantllm/__init__.py" = ["F401", "E402"]
58+
"quantllm/core/__init__.py" = ["F401"]
59+
60+
[tool.pytest.ini_options]
61+
minversion = "7.0"
62+
testpaths = ["tests"]
63+
addopts = "-ra --strict-markers"
64+
filterwarnings = [
65+
"ignore::DeprecationWarning",
66+
"ignore::FutureWarning",
67+
]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# QuantLLM v2.0 Requirements
1+
# QuantLLM v2.1 (pre-release) Requirements
22

33
# Core dependencies
44
torch>=2.0.0

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="quantllm",
14-
version="2.0.0",
14+
version="2.1.0rc1",
1515
author="Dark Coder",
1616
author_email="codewithdark90@gmail.com",
1717
description="Ultra-fast LLM quantization, fine-tuning, and deployment with one line of code",
@@ -24,7 +24,7 @@
2424
"Bug Tracker": "https://github.com/codewithdark-git/QuantLLM/issues",
2525
"Sponsor": "https://github.com/sponsors/codewithdark-git",
2626
},
27-
packages=find_packages(exclude=["test", "test.*", "docs", "examples"]),
27+
packages=find_packages(exclude=["tests", "tests.*", "docs", "examples"]),
2828
classifiers=[
2929
"Development Status :: 4 - Beta",
3030
"Intended Audience :: Science/Research",
@@ -97,6 +97,7 @@
9797
"wandb>=0.15.0",
9898
"tensorboard>=2.14.0",
9999
"evaluate>=0.4.0",
100+
"flash-attn>=2.3.0",
100101
],
101102
"dev": [
102103
"pytest>=7.4.0",
@@ -117,4 +118,4 @@
117118
},
118119
include_package_data=True,
119120
zip_safe=False,
120-
)
121+
)

0 commit comments

Comments
 (0)