This repository was archived by the owner on Sep 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (131 loc) · 5.7 KB
/
pyproject.toml
File metadata and controls
153 lines (131 loc) · 5.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
[project]
name = "llama-cpp-cffi"
version = "0.4.42"
description = "Python binding for llama.cpp using cffi"
authors = [
{ name = "Tangled Group, Inc", email = "info@tangledgroup.com" },
{ name = "Marko Tasic", email = "mtasic85@gmail.com" },
]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10,<4.0"
keywords = [ "llama", "llama-cpp", "llama.cpp", "llama-cpp-cffi", "cffi" ]
classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
[project.urls]
homepage = "https://github.com/tangledgroup/llama-cpp-cffi"
repository = "https://github.com/tangledgroup/llama-cpp-cffi"
documentation = "https://github.com/tangledgroup/llama-cpp-cffi"
"Bug Tracker" = "https://github.com/tangledgroup/llama-cpp-cffi/issues"
[project.scripts]
build = "scripts.build:build"
clean = "scripts.clean:clean"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0", "cffi", "setuptools"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
packages = [{ include = "llama" }]
include = [
{ path = "llama/**/*.so", format = "wheel" },
{ path = "llama/**/*.dll", format = "wheel" },
{ path = "llama/**/*.dylib", format = "wheel" },
]
[tool.poetry.build]
script = "scripts/build.py"
[tool.poetry.dependencies]
python = "^3.10"
attrs = "^25.1.0"
huggingface-hub = "^0.28.1"
psutil = "^7.0.0"
transformers = "^4.49.0"
jinja2 = "^3.1.5"
sentencepiece = "^0.2.0"
protobuf = "^5.29.3"
uvloop = {version = "^0.21.0", optional = true}
aiohttp = {extras = ["speedups"], version = "^3.11.12", optional = true}
gunicorn = {version = "23.0.0", optional = true}
openai = {version = "^1.63.2", optional = true}
[tool.poetry.extras]
server = ["uvloop", "aiohttp", "gunicorn", "openai"]
[tool.poetry.group.dev.dependencies]
poetry = "^2.1.1"
cffi = "^1.17.1"
setuptools = "^75.8.0"
cibuildwheel = "^2.22.0"
# pyright = "^1.1.394"
# ruff = "^0.9.6"
# mkdocs-material = "^9.6.4"
[tool.cibuildwheel]
[tool.cibuildwheel.linux]
container-engine = { name = "docker", create-args = ["--cpus", "16"]}
build-frontend = "build"
before-build = """
ARCH=$(uname -m)
pip install poetry
if [[ $AUDITWHEEL_PLAT == manylinux* ]]; then
dnf update -y
dnf install -y epel-release
dnf update -y
dnf group install -y "Development Tools"
# # dnf install -y unzip p7zip p7zip-plugins upx clang-tools-extra libcurl-devel
# dnf install -y clang clang-tools-extra ninja-build gcc-toolset-12
dnf install -y clang-tools-extra ninja-build
# # cuda requires gcc 12
# source /opt/rh/gcc-toolset-12/enable
# vulkan
dnf install -y vulkan-tools vulkan-headers vulkan-loader vulkan-loader-devel vulkan-validation-layers spirv-tools libshaderc libshaderc-devel glslc glslang
else
# # apk -U add unzip 7zip upx clang-extra-tools
# apk -U add clang clang-extra-tools ninja-build
apk -U add clang-extra-tools ninja-build
# vulkan
if [[ "$ARCH" == "x86_64" ]]; then
apk -U add mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-layers mesa-vulkan-swrast vulkan-headers vulkan-loader vulkan-loader-dev vulkan-tools vulkan-validation-layers vulkan-validation-layers-dev vulkan-validation-layers-static shaderc glslang glslang-dev glslang-libs glslang-static
else
apk -U add mesa-vulkan-ati mesa-vulkan-layers mesa-vulkan-swrast vulkan-headers vulkan-loader vulkan-loader-dev vulkan-tools vulkan-validation-layers vulkan-validation-layers-dev vulkan-validation-layers-static shaderc glslang glslang-dev glslang-libs glslang-static
fi
fi
"""
build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "pp310-*"]
# build = ["cp312-*"]
# skip = ["*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686", "*manylinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_34_x86_64:2025.03.07-1"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_34_aarch64:2025.03.07-1"
manylinux-pypy_x86_64-image = "quay.io/pypa/manylinux_2_34_x86_64:2025.03.07-1"
manylinux-pypy_aarch64-image = "quay.io/pypa/manylinux_2_34_aarch64:2025.03.07-1"
musllinux-x86_64-image = "quay.io/pypa/musllinux_1_2_x86_64:2025.03.07-1"
musllinux-aarch64-image = "quay.io/pypa/musllinux_1_2_aarch64:2025.03.07-1"
build-verbosity=3
repair-wheel-command = ""
# repair-wheel-command = """
# for file in {wheel}; do
# tempdir=$(mktemp -d)
# unzip -d "$tempdir" "$file"
#
# # Compress shared libraries in the tempdir using UPX
# find "$tempdir" -type f \\( -name "*.so" -o -name "*.dylib" -o -name "*.dll" \\) -exec upx -9 {} \\;
#
# # Repackage with 7z
# (cd "$tempdir" && 7z a -tzip -mx=9 -mfb=258 -mpass=15 -mmt=on "{dest_dir}/$(basename $file)" .)
#
# # Clean up
# rm -rf "$tempdir"
# done
# """
[tool.cibuildwheel.macos]
[tool.cibuildwheel.windows]
[tool.cibuildwheel.pyodide]