strata-engine-git
LOW
maintainer zeakz
0 votes
scanned 2026-10-06 08:02:16.298752
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Your Name <you@example.com>
2
3
pkgname=strata-engine-git
4
pkgver=0.1.39.r845.g6f32ec07
5
pkgrel=1
6
pkgdesc='Run Qwen3.8-Flash-Next (125B MoE) on one consumer NVIDIA GPU plus system RAM, with a local OpenAI/Anthropic-compatible API (git version)'
7
arch=('x86_64')
8
url='https://github.com/Niko1221/Strata'
9
# Strata and the ggml code it builds on are MIT. data/experimental-speed-projection is under the
10
# Qwen Community License, and every model you download has its own license (see the project's docs).
11
license=('MIT')
12
depends=(
13
'cuda>=13' # libcudart and libcublas 13 (the engine is built against CUDA 13)
14
'nvidia-utils>=580' # nvidia-smi and a driver new enough for CUDA 13
15
'gcc-libs'
16
'python'
17
'python-numpy'
18
'python-jinja'
19
'python-regex'
20
'python-yaml'
21
'python-tqdm'
22
'python-requests'
23
'python-pillow'
24
'python-psutil'
25
)
26
makedepends=('git' 'cmake' 'ninja' 'gcc' 'python')
27
optdepends=(
28
'cmake: recompile the engine when your GPU is outside the architectures built here'
29
'ninja: recompile the engine when your GPU is outside the architectures built here'
30
'gcc: recompile the engine when your GPU is outside the architectures built here'
31
'nodejs: run npx-based MCP servers from the web chat'
32
)
33
provides=('strata-engine')
34
conflicts=('strata-engine')
35
options=('!lto' '!debug')
36
37
# llama.cpp commit that Strata pins (LLAMA_CPP_COMMIT in setup.py). prepare() stops if upstream moves it.
38
_llama_commit=3cf03257f219afbe7334045ff7c6a06ac68c627d
39
40
# CUDA architectures compiled into the engine, as a fat binary. Default is upstream's Docker set:
41
# RTX 20 (75), A-series (80), RTX 30 (86), RTX 40 (89), RTX 50 (120).
42
# Narrow it to your card for a much faster build: _cuda_archs=89 makepkg -si
43
: "${_cuda_archs:=75;80;86;89;120}"
44
45
# Also build strata-vision, the image encoder (adds 10-20 minutes). Skip it: _build_vision=0 makepkg -si
46
: "${_build_vision:=1}"
47
48
source=("Strata::git+https://github.com/Niko1221/Strata.git"
49
"llama.cpp::git+https://github.com/ggml-org/llama.cpp.git#commit=${_llama_commit}")
50
sha256sums=('SKIP'
51
'SKIP')
52
53
pkgver() {
54
cd Strata
55
local _v
56
_v=$(grep -oP 'project\(strata VERSION \K[0-9.]+' CMakeLists.txt)
57
printf '%s.r%s.g%s' "$_v" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
58
}
59
60
prepare() {
61
cd Strata
62
local _pinned
63
_pinned=$(grep -oP '^LLAMA_CPP_COMMIT = "\K[0-9a-f]{40}' setup.py)
64
if [[ $_pinned != "$_llama_commit" ]]; then
65
error "Strata now pins llama.cpp $_pinned"
66
error "Set _llama_commit to that value in this PKGBUILD and rebuild."
67
return 1
68
fi
69
}
70
71
build() {
72
export PATH="/opt/cuda/bin:$PATH"
73
local _nvcc=/opt/cuda/bin/nvcc
74
local _jobs=$(( $(nproc) / 2 ))
75
(( _jobs < 2 )) && _jobs=2 # nvcc is memory hungry, so use half the cores like upstream's setup.py
76
77
# Upstream's own build uses CMake defaults: ggml adds -march=native and Strata adds per-file
78
# AVX2/AVX-512 flags. Arch's -march=x86-64 and -Werror=format-security would fight with that.
79
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
80
81
# If nvcc rejects the host compiler, point CMake at a supported one: CUDAHOSTCXX=/usr/bin/g++-NN
82
cmake -S Strata -B build-engine -G Ninja -Wno-dev \
83
-DCMAKE_BUILD_TYPE=Release \
84
-DCMAKE_CUDA_COMPILER="$_nvcc" \
85
-DCMAKE_CUDA_ARCHITECTURES="$_cuda_archs" \
86
-DSTRATA_ENABLE_CUDA=ON \
87
-DSTRATA_BUILD_TESTS=OFF \
88
-DSTRATA_GGML_DIR="$srcdir/llama.cpp"
89
cmake --build build-engine --target strata -j "$_jobs"
90
91
if [[ $_build_vision == 1 ]]; then
92
cmake -S Strata/tools/vision -B build-vision -G Ninja -Wno-dev \
93
-DCMAKE_BUILD_TYPE=Release \
94
-DCMAKE_CUDA_COMPILER="$_nvcc" \
95
-DCMAKE_CUDA_ARCHITECTURES="$_cuda_archs" \
96
-DSTRATA_VISION_CUDA=ON \
97
-DLLAMA_DIR="$srcdir/llama.cpp"
98
cmake --build build-vision --target strata-vision -j "$_jobs"
99
fi
100
}
101
102
package() {
103
local _share="$pkgdir/usr/share/strata"
104
local _engine="$pkgdir/usr/lib/strata/engine"
105
install -d "$_share" "$_engine" "$pkgdir/usr/bin"
106
107
# --- the read-only application tree -------------------------------------------------------------
108
cd "$srcdir/Strata"
109
cp -r serve tools data include src third_party "$_share/"
110
install -Dm644 -t "$_share" CMakeLists.txt setup.py chat.py requirements.txt
111
112
# llama.cpp at the pinned commit: gguf-py for the tools, plus enough of the tree to recompile
113
# the engine or the image encoder on a GPU generation that was not built here.
114
install -d "$_share/third_party/llama.cpp"
115
git -C "$srcdir/llama.cpp" archive HEAD | tar -x -C "$_share/third_party/llama.cpp"
116
(
117
cd "$_share/third_party/llama.cpp"
118
rm -rf docs media models tests benches pocs examples tools/ui scripts ci skills app
119
)
120
121
# --- the compiled engine ------------------------------------------------------------------------
122
install -Dm755 "$srcdir/build-engine/strata" "$_engine/strata"
123
if [[ $_build_vision == 1 ]]; then
124
install -Dm755 "$srcdir/build-vision/bin/strata-vision" "$_engine/strata-vision"
125
fi
126
127
# BUILD.json is how setup.py decides an engine is current ("source": "local" plus a hash of the
128
# sources it was built from), so it computes the hash with upstream's own functions.
129
cd "$_share"
130
PYTHONDONTWRITEBYTECODE=1 python - "$_cuda_archs" "$_build_vision" "$_engine/BUILD.json" <<'PYEOF'
131
import json, sys
132
sys.path.insert(0, ".")
133
import setup
134
135
archs = [int(a.split("-")[0]) for a in sys.argv[1].replace(",", ";").split(";") if a.split("-")[0].isdigit()]
136
vision = sys.argv[2] == "1"
137
meta = {
138
"source": "local",
139
"version": setup.source_version(),
140
"archs": archs,
141
"vision": "gpu" if vision else "none",
142
"cuda_dirs": ["/opt/cuda/bin", "/opt/cuda/lib64"],
143
"src": setup.source_hash(setup.ENGINE_SOURCES),
144
"vision_src": setup.source_hash(setup.VISION_SOURCES) if vision else None,
145
}
146
with open(sys.argv[3], "w") as f:
147
json.dump(meta, f, indent=1)
148
PYEOF
149
echo "$pkgver-$pkgrel" > "$_share/PKG_VERSION"
150
151
# --- launcher -----------------------------------------------------------------------------------
152
# Upstream's setup.py writes models, configs, logs and build folders next to itself, so it cannot
153
# run from /usr. The launcher builds a small per-user folder of symlinks to the installed files
154
# and runs setup.py from there. Python packages come from pacman, so setup.py's pip step is a no-op.
155
cat > "$pkgdir/usr/bin/strata" <<'EOF'
156
#!/bin/bash
157
# Launcher for the strata-git package.
158
# strata first run: pick a model and install it; later runs: start the server
159
# strata --setup install another model or change settings
160
# strata --help every option (the same ones as upstream's ./setup.sh)
161
# strata chat terminal chat with a running server
162
# Files live in ${STRATA_HOME:-~/.local/share/strata}; model files go to Strata-data next to app/
163
# (about 70-120 GB, change it with --data-dir).
164
set -e
165
166
share=/usr/share/strata
167
lib=/usr/lib/strata
168
home="${STRATA_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/strata}"
169
app="$home/app"
170
stamp="$(cat "$share/PKG_VERSION")"
171
172
if [ "$(cat "$app/.pkg-version" 2>/dev/null)" != "$stamp" ]; then
173
mkdir -p "$app/engine"
174
for f in setup.py chat.py requirements.txt; do
175
cp -f "$share/$f" "$app/$f"
176
done
177
for d in CMakeLists.txt serve tools data include src third_party; do
178
ln -sfn "$share/$d" "$app/$d"
179
done
180
cp -f "$lib/engine/BUILD.json" "$app/engine/BUILD.json"
181
for b in strata strata-vision; do
182
if [ -e "$lib/engine/$b" ]; then ln -sf "$lib/engine/$b" "$app/engine/$b"; fi
183
done
184
echo "$stamp" > "$app/.pkg-version"
185
echo "strata: set up $app" >&2
186
echo "strata: model files go to $home/Strata-data (use --data-dir to put them elsewhere)" >&2
187
fi
188
189
cd "$app"
190
191
# if the engine ever has to be recompiled, use the CUDA from pacman
192
if [ -z "$STRATA_NVCC" ] && [ -x /opt/cuda/bin/nvcc ]; then
193
export STRATA_NVCC=/opt/cuda/bin/nvcc
194
fi
195
196
if [ "${1:-}" = chat ]; then
197
shift
198
exec python3 chat.py "$@"
199
fi
200
201
exec python3 -c '
202
import sys
203
sys.path.insert(0, ".")
204
import setup
205
setup.pip_install = lambda *args, **kwargs: None # Python packages come from pacman
206
sys.argv[0] = "strata"
207
try:
208
sys.exit(setup.main())
209
except KeyboardInterrupt:
210
setup.say("\nstopped.")
211
sys.exit(1)
212
' "$@"
213
EOF
214
chmod 755 "$pkgdir/usr/bin/strata"
215
216
# --- licenses and docs --------------------------------------------------------------------------
217
cd "$srcdir/Strata"
218
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
219
install -Dm644 third_party/ggml/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE.ggml"
220
install -Dm644 "$srcdir/llama.cpp/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.llama.cpp"
221
install -Dm644 -t "$pkgdir/usr/share/doc/strata" README.md SECURITY.md docs/*.md
222
}
223
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-06 08:02:16 | Low | 1 |