rabbitllm 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. rabbitllm-1.0.0/.dockerignore +33 -0
  2. rabbitllm-1.0.0/.github/FUNDING.yml +1 -0
  3. rabbitllm-1.0.0/.github/workflows/ci.yml +35 -0
  4. rabbitllm-1.0.0/.github/workflows/publish.yml +42 -0
  5. rabbitllm-1.0.0/.gitignore +53 -0
  6. rabbitllm-1.0.0/.python-version +1 -0
  7. rabbitllm-1.0.0/CHANGELOG.md +25 -0
  8. rabbitllm-1.0.0/CONTRIBUTING.md +151 -0
  9. rabbitllm-1.0.0/LICENSE +201 -0
  10. rabbitllm-1.0.0/Makefile +27 -0
  11. rabbitllm-1.0.0/PKG-INFO +230 -0
  12. rabbitllm-1.0.0/README.md +199 -0
  13. rabbitllm-1.0.0/assets/logo-rabbitllm.jpg +0 -0
  14. rabbitllm-1.0.0/docs/ARCHITECTURE.md +81 -0
  15. rabbitllm-1.0.0/docs/BENCHMARK_HISTORY.md +110 -0
  16. rabbitllm-1.0.0/docs/COMPATIBILITY.md +100 -0
  17. rabbitllm-1.0.0/docs/TRANSFORMERS_UPGRADE_PLAN.md +205 -0
  18. rabbitllm-1.0.0/docs/TROUBLESHOOTING.md +235 -0
  19. rabbitllm-1.0.0/pyproject.toml +65 -0
  20. rabbitllm-1.0.0/scripts/benchmark_cpu_vs_cuda.py +158 -0
  21. rabbitllm-1.0.0/scripts/chat_inference.py +38 -0
  22. rabbitllm-1.0.0/scripts/check_attention_and_benchmark.py +153 -0
  23. rabbitllm-1.0.0/scripts/check_model_families.py +125 -0
  24. rabbitllm-1.0.0/scripts/inference_example.py +105 -0
  25. rabbitllm-1.0.0/scripts/profile_inference.py +110 -0
  26. rabbitllm-1.0.0/src/__init__.py +0 -0
  27. rabbitllm-1.0.0/src/rabbitllm/__init__.py +29 -0
  28. rabbitllm-1.0.0/src/rabbitllm/_version.py +1 -0
  29. rabbitllm-1.0.0/src/rabbitllm/compat/__init__.py +0 -0
  30. rabbitllm-1.0.0/src/rabbitllm/compat/tokenization_baichuan.py +282 -0
  31. rabbitllm-1.0.0/src/rabbitllm/engine/__init__.py +0 -0
  32. rabbitllm-1.0.0/src/rabbitllm/engine/attention.py +103 -0
  33. rabbitllm-1.0.0/src/rabbitllm/engine/base.py +1341 -0
  34. rabbitllm-1.0.0/src/rabbitllm/engine/forward_utils.py +129 -0
  35. rabbitllm-1.0.0/src/rabbitllm/engine/layer_loading.py +324 -0
  36. rabbitllm-1.0.0/src/rabbitllm/engine/mlx_engine.py +490 -0
  37. rabbitllm-1.0.0/src/rabbitllm/engine/model_init.py +47 -0
  38. rabbitllm-1.0.0/src/rabbitllm/persist/__init__.py +1 -0
  39. rabbitllm-1.0.0/src/rabbitllm/persist/base.py +54 -0
  40. rabbitllm-1.0.0/src/rabbitllm/persist/mlx.py +81 -0
  41. rabbitllm-1.0.0/src/rabbitllm/persist/safetensor.py +39 -0
  42. rabbitllm-1.0.0/src/rabbitllm/profiler.py +36 -0
  43. rabbitllm-1.0.0/src/rabbitllm/utils/__init__.py +19 -0
  44. rabbitllm-1.0.0/src/rabbitllm/utils/compression.py +208 -0
  45. rabbitllm-1.0.0/src/rabbitllm/utils/memory.py +18 -0
  46. rabbitllm-1.0.0/src/rabbitllm/utils/platform.py +84 -0
  47. rabbitllm-1.0.0/src/rabbitllm/utils/splitting.py +405 -0
  48. rabbitllm-1.0.0/tests/conftest.py +0 -0
  49. rabbitllm-1.0.0/tests/test_base_model.py +312 -0
  50. rabbitllm-1.0.0/tests/test_compression.py +51 -0
  51. rabbitllm-1.0.0/tests/test_model_registry.py +40 -0
  52. rabbitllm-1.0.0/tests/test_persister.py +28 -0
  53. rabbitllm-1.0.0/tests/test_platform.py +24 -0
  54. rabbitllm-1.0.0/tests/test_profiler.py +24 -0
  55. rabbitllm-1.0.0/tests/test_splitting.py +61 -0
  56. rabbitllm-1.0.0/uv.lock +1976 -0
@@ -0,0 +1,33 @@
1
+ # Git and IDE
2
+ .git
3
+ .gitignore
4
+ .cursor
5
+ *.md
6
+ !README.md
7
+
8
+ # Python
9
+ __pycache__
10
+ *.py[cod]
11
+ *$py.class
12
+ *.so
13
+ .venv
14
+ venv
15
+ env
16
+ .pytest_cache
17
+ .mypy_cache
18
+ .ruff_cache
19
+ *.egg-info
20
+ .eggs
21
+
22
+ # Cache and local data
23
+ .cache
24
+ *.lock
25
+ uv.lock
26
+
27
+ # Docs/plans (optional; uncomment to keep in image)
28
+ # .cursor/plans
29
+ # docs
30
+ # PLAN.md
31
+
32
+ # Tests (keep if you want to run tests in container)
33
+ # src/tests
@@ -0,0 +1 @@
1
+ buy_me_a_coffee: l5gr4mn
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+ branches: [master, main]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv and set Python
21
+ uses: astral-sh/setup-uv@v4
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: uv sync
27
+
28
+ - name: Lint (ruff check)
29
+ run: uv run ruff check src/ tests/
30
+
31
+ - name: Format check (ruff format)
32
+ run: uv run ruff format --check src/ tests/
33
+
34
+ - name: Tests
35
+ run: uv run pytest tests/ -v
@@ -0,0 +1,42 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v4
16
+ with:
17
+ python-version: "3.12"
18
+
19
+ - name: Build package
20
+ run: uv build
21
+
22
+ - name: Upload dist artefacts
23
+ uses: actions/upload-artifact@v4
24
+ with:
25
+ name: dist
26
+ path: dist/
27
+
28
+ publish:
29
+ needs: build
30
+ runs-on: ubuntu-latest
31
+ environment: pypi
32
+ permissions:
33
+ id-token: write # required for OIDC trusted publishing
34
+ steps:
35
+ - name: Download dist artefacts
36
+ uses: actions/download-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ - name: Publish to PyPI
42
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,53 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Environments
7
+ .env
8
+ .venv
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+
29
+ # Unit test / coverage reports
30
+ htmlcov/
31
+ .tox/
32
+ .coverage
33
+ .coverage.*
34
+ .cache
35
+ nosetests.xml
36
+ coverage.xml
37
+ *.cover
38
+ .hypothesis/
39
+ .pytest_cache/
40
+
41
+ # Type checker / linter caches
42
+ .mypy_cache/
43
+ .ruff_cache/
44
+
45
+ # IDE specific files
46
+ .idea/
47
+ .vscode/
48
+ *.swp
49
+ *.swo
50
+
51
+ # Local model cache (downloads and split layers) — do not commit
52
+ models/
53
+ .models/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to RabbitLLM are documented here.
4
+
5
+ ## [1.0.0] — 2026-02-21
6
+
7
+ Initial release of **RabbitLLM** — a complete rewrite and rebrand of the layer-streaming inference engine.
8
+
9
+ ### Added
10
+ - Layer-streaming inference engine: runs 70B+ models on 4GB VRAM without quantization
11
+ - `AutoModel.from_pretrained()` — auto-detects architecture from HuggingFace config
12
+ - Optional 4-bit/8-bit block-wise compression via bitsandbytes (up to 3× speed-up)
13
+ - Async CPU→GPU transfer pipeline to overlap layer loading with compute
14
+ - KV cache support (`DynamicCache`) for incremental decoding
15
+ - Flash Attention 2 auto-detection (`attn_implementation="auto"`)
16
+ - macOS / Apple Silicon support via MLX (`RabbitLLMLlamaMlx`)
17
+ - Supported architectures: Llama 2/3/3.1/3.2, Qwen v1/2/2.5/3, Mistral, Mixtral, ChatGLM, Baichuan, InternLM, Gemma 2/3, DeepSeek V2/V3, Phi 2/3/4
18
+ - `src/` layout with `pyproject.toml`, `uv` packaging, `ruff`, `mypy`, `pytest`
19
+ - GitHub Actions CI across Python 3.10 / 3.11 / 3.12
20
+ - Technical documentation: `ARCHITECTURE.md`, `COMPATIBILITY.md`, `TROUBLESHOOTING.md`
21
+ - `scripts/`: inference examples, benchmark, attention checker, profiling
22
+
23
+ ### Notes
24
+ - Requires Python ≥ 3.10, PyTorch ≥ 2.5, transformers 5.0–5.2
25
+ - For Qwen2/Qwen2.5, use transformers 5.0.x; 5.1+ has a known RoPE head_dim issue (see `docs/COMPATIBILITY.md`)
@@ -0,0 +1,151 @@
1
+ # Contributing to RabbitLLM
2
+
3
+ Thank you for your interest in contributing. This document explains how to set up
4
+ the development environment, run tests, and add support for new models.
5
+
6
+ ## Development setup
7
+
8
+ RabbitLLM uses [uv](https://docs.astral.sh/uv/) as the package manager.
9
+
10
+ ```bash
11
+ # Install uv (if not already installed)
12
+ curl -LsSf https://astral.sh/uv/install.sh | sh
13
+
14
+ # Clone the repository
15
+ git clone https://github.com/manuelslemos/rabbitllm
16
+ cd rabbitllm
17
+
18
+ # Install all dependencies including dev tools
19
+ uv sync --extra dev
20
+ # or: make install
21
+ ```
22
+
23
+ This creates a virtual environment at `.venv/` with ruff, mypy, pytest, and pytest-cov.
24
+
25
+ ## Running tests
26
+
27
+ ```bash
28
+ # All tests (skips GPU-only compression test)
29
+ make test
30
+ # or: uv run pytest tests/
31
+
32
+ # With coverage report
33
+ make test-cov
34
+ # or: uv run pytest tests/ --cov=rabbitllm --cov-report=term-missing
35
+
36
+ # Single test module
37
+ uv run python -m unittest tests.test_model_registry
38
+
39
+ # GPU tests (requires CUDA)
40
+ uv run pytest tests/test_compression.py
41
+ ```
42
+
43
+ Most tests run without a GPU. The compression test (`test_compression.py`) requires CUDA
44
+ and is skipped automatically in CI.
45
+
46
+ ## Code style
47
+
48
+ RabbitLLM uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting.
49
+
50
+ ```bash
51
+ make lint # ruff check
52
+ make format # ruff format
53
+ make typecheck # mypy
54
+ ```
55
+
56
+ Line length is 100 characters. Imports are sorted (isort via ruff). Type hints are
57
+ required on all public APIs.
58
+
59
+ ## Project structure
60
+
61
+ ```
62
+ src/rabbitllm/
63
+ ├── engine/ # Core layer-streaming engine
64
+ │ ├── base.py # RabbitLLMBaseModel — the main class
65
+ │ ├── attention.py # Attention implementation resolution
66
+ │ ├── model_init.py # Model skeleton creation
67
+ │ ├── layer_loading.py # Layer I/O and async transfer
68
+ │ ├── forward_utils.py # Attention mask, position ids, KV extraction
69
+ │ └── mlx_engine.py # macOS/MLX implementation
70
+ ├── models/ # Architecture-specific subclasses
71
+ │ ├── registry.py # AutoModel factory
72
+ │ ├── llama.py # Llama2/3, Gemma, Phi, DeepSeek
73
+ │ ├── qwen.py # Qwen v1
74
+ │ ├── qwen2.py # Qwen2/2.5/3
75
+ │ ├── mistral.py # Mistral
76
+ │ ├── mixtral.py # Mixtral
77
+ │ ├── chatglm.py # ChatGLM
78
+ │ ├── baichuan.py # Baichuan
79
+ │ └── internlm.py # InternLM
80
+ ├── persist/ # Layer serialization (safetensors / mlx)
81
+ ├── utils/ # Splitting, compression, memory, platform
82
+ ├── compat/ # Tokenizer compatibility shims
83
+ └── profiler.py # Per-layer timing
84
+ ```
85
+
86
+ ## Adding a new model
87
+
88
+ 1. **Check if the existing Llama-based class works.** Many Llama-like architectures
89
+ (Gemma, Phi, DeepSeek) share the same layer naming convention and work without a
90
+ dedicated subclass. Try `AutoModel.from_pretrained("your/model")` first.
91
+
92
+ 2. **Create a subclass** if the architecture uses different layer names:
93
+
94
+ ```python
95
+ # src/rabbitllm/models/mymodel.py
96
+ from ..engine.base import RabbitLLMBaseModel
97
+
98
+ class RabbitLLMMyModel(RabbitLLMBaseModel):
99
+ def set_layer_names_dict(self) -> None:
100
+ self.layer_names_dict = {
101
+ "embed": "transformer.wte", # embedding layer
102
+ "layer_prefix": "transformer.h", # decoder layers
103
+ "norm": "transformer.ln_f", # final norm
104
+ "lm_head": "lm_head", # language model head
105
+ }
106
+ ```
107
+
108
+ 3. **Register the architecture** in `src/rabbitllm/models/registry.py`:
109
+
110
+ ```python
111
+ if "MyModelForCausalLM" in arch:
112
+ return "rabbitllm.models.mymodel", "RabbitLLMMyModel"
113
+ ```
114
+
115
+ Check the model's `config.json` on HuggingFace to find the exact `architectures` value.
116
+
117
+ 4. **Export the class** in `src/rabbitllm/__init__.py`:
118
+
119
+ ```python
120
+ from .models.mymodel import RabbitLLMMyModel
121
+ ```
122
+
123
+ 5. **Add a test** in `tests/test_model_registry.py`:
124
+
125
+ ```python
126
+ "org/my-model": "RabbitLLMMyModel",
127
+ ```
128
+
129
+ 6. **Verify with a small model** (e.g. 1B–7B parameter variant):
130
+
131
+ ```python
132
+ from rabbitllm import AutoModel
133
+ model = AutoModel.from_pretrained("org/my-model-7b")
134
+ out = model.generate(model.tokenizer(["Hello"], return_tensors="pt")["input_ids"].cuda(), max_new_tokens=10)
135
+ print(model.tokenizer.decode(out.sequences[0]))
136
+ ```
137
+
138
+ ## Submitting a pull request
139
+
140
+ - Open an issue first for large changes to discuss the approach.
141
+ - Include tests for any new functionality.
142
+ - Run `make lint && make test` before opening the PR.
143
+ - Keep PRs focused; one feature or fix per PR.
144
+
145
+ ## Reporting issues
146
+
147
+ Please include:
148
+ - Python version, PyTorch version, transformers version
149
+ - GPU model and VRAM (if applicable)
150
+ - The model repo ID being used
151
+ - Full traceback
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,27 @@
1
+ .PHONY: install dev lint format test test-cov typecheck clean bash
2
+
3
+ install:
4
+ uv sync
5
+
6
+ dev: install
7
+
8
+ lint:
9
+ uv run ruff check src/ tests/
10
+
11
+ format:
12
+ uv run ruff format src/ tests/
13
+
14
+ test:
15
+ uv run pytest tests/
16
+
17
+ test-cov:
18
+ uv run pytest tests/ --cov=rabbitllm --cov-report=term-missing
19
+
20
+ typecheck:
21
+ uv run mypy src/rabbitllm/ --ignore-missing-imports
22
+
23
+ clean:
24
+ rm -rf build/ dist/ *.egg-info .pytest_cache .ruff_cache .mypy_cache htmlcov/ .coverage .coverage.*
25
+
26
+ bash:
27
+ docker run --gpus all --rm -it -v $(PWD):/app -w /app python:3.12 bash